Thanks for being willing to contribute!
Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub.
- Fork this repository
- Clone your forked repository
- Run
npm ci
to install corresponding dependencies - Create a branch for your PR named like
pr/your-branch-name
(you can do this through git CLI withgit checkout -b pr/your-branch-name
)
Tip: Keep your
main
branch pointing at the original repository and make pull requests from branches on your fork. To do this, run:git remote add upstream https://github.com/timdeschryver/eslint-plugin-ngrx.git git fetch upstream git branch --set-upstream-to=upstream/main mainThis will add the original repository as a "remote" called "upstream," Then fetch the git information from that remote, then set your local
main
branch to use the upstream main branch whenever you rungit pull
. Then you can make all of your pull request branches based on thismain
branch. Whenever you want to update your version ofmain
, do a regulargit pull
.
Git hooks are configured on this project when you install dependencies. The following will be run on every commit:
- Format files automatically (using prettier)
- The recommended configuration will be generated (this is important for when a new rule is added)
Based on ESLint's Rule Naming Conventions, you must follow these rules:
- Use dashes between words;
- Try to keep the name simple and clear;
- If the rule is disallowing something, prefix it with
no-
, for exampleno-dispatch-in-effects
; - If the rule is suggesting to prefer a way of doing something, among other ways, you can optionally prefix it with
prefer-
, for exampleprefer-selector-in-select
; - If the rule is enforcing the inclusion of something, use a short name without a special prefix, for example,
avoid-dispatching-multiple-actions-sequentially
.
In the same way as ESLint, each rule has three files named with its identifie:
- in the
src/rules
directory: a source file - in the
tests/rules
directory: a test file - in the
docs/rules
directory: a Markdown documentation file - run
npm run g:all
to add the rule to the README.md and additionally to the needed configuration files
A couple of things you need to remember when editing already existing rules:
- If renaming a rule, make sure to update all points mentioned in the "Adding new rules" section.
- Add tests to cover the changes introduced, no matter if that's a bug fix or a new feature.
- While fixing a bug, add a link to the issue above the test case
Please check the the open issues
Also, please watch the repo and respond to questions/bug reports/feature requests! Thanks!