Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (41 sloc) 2.67 KB

Contributing

We love contribution from everyone. Please open an issue if you encounter a bug, or have feature requests, or get a documentation issue, or anything.

Issues tagged with help-wanted are desired to get support.

Setup machine

Clone the repository, install the npm dependencies. That is all:

git clone https://github.com/depcheck/depcheck.git
cd depcheck
npm install

Design

Please read and understand the pluggable design if you are going to implement new features.

Basically, it divides the depcheck process into three steps handled by different components.

  1. Walk the files under the depcheck directory, managed by depcheck itself.
  2. Parse file to abstract syntax tree (aka, AST), handled by parser. Besides, dependencies can be reported directly with special parser.
  3. Detect dependencies from AST, handled by detector.

Test driven

Run test:

npm run test

All modification should have test to support it and avoid regression if possible.

Depcheck API and CLI test cases are defined in spec.json. Special parsers test cases are defined in their own test files.

Code style

Run code style check:

npm run lint

This project follows the Airbnb JavaScript Style Guide, and is enforced by eslint-config-airbnb preset.

It is a must to pass code style check when you do code modifications.

Self check

Run self check commands:

npm run depcheck
npm run depcheck-json

To be a better tool, we decide to eat our own dog food. Self check will check the unused dependencies in this project.

It might get false alerts or regressions if introducing new features. Some could be skipped using --ignores parameter as a workaround, some should be fixed to avoid broking existing features. Please let us know if you get into such situation.

Pull request

Please rebase to the top main branch when sending a pull request. Both Travis and AppVeyor check should be passed.

Test coverage is minor. However, if there is a huge effect on test coverage, we could take a look.

You can’t perform that action at this time.