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.
Clone the repository, install the npm dependencies. That is all:
git clone https://github.com/depcheck/depcheck.git
cd depcheck
npm install
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.
- Walk the files under the depcheck directory, managed by depcheck itself.
- Parse file to abstract syntax tree (aka, AST), handled by parser. Besides, dependencies can be reported directly with special parser.
- Detect dependencies from AST, handled by detector.
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.
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.
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.
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.