You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.7 KiB
1.7 KiB
Contributing
README.md
is a generated file. Do not edit it directly. Edit the files inside .README
instead.
Pre-Commit Hook
When making a commit, the following Pre-Commit hooks run:
- test and documentation checks
- tests
- lint
- commit message validation (see "Commit Messages" below)
Commit Messages
All commit messages must begin with one of the following prefixes:
fix:
feat:
refactor:
docs:
chore:
The prefix is used to bump the correct segment of the version number during the automatic release.
Tests
Run them with npm test
.
Lint
Run with npm run lint
.
Submitting a PR
Just before submitting a PR, run npm run create-readme
to generate the new README.md
Adding a Rule
Source & Tests
- Create a file in
tests/rules/assertions
named thecamelCase
version of your rule name with the following template:
export default { invalid: [], valid: [] }
- Add your test file to
tests/rules/index.js
- Create a file in
src/rules
named thecamelCase
version of your rule name - Add your rule file to
src/index.js
Adding Documentation
- Create new file in
./.README/rules/[rule-name].md
.
- Use ./.README/rules/require-valid-file-annotation.md as a template.
- Ensure that rule documentation document includes
<!-- assertions spaceAfterTypeColon -->
declaration.
- Update ./.README/README.md to include the new rule.
A CI service will build and publish the new documentation.
Note: Sections "The following patterns are considered problems:" and "The following patterns are not considered problems:" are generated automatically using the test cases.