|
| 1 | +# CONTRIBUTING to eslint-plugin-jsdoc |
| 2 | + |
| 3 | +## Testing changes locally |
| 4 | + |
| 5 | +You might try a TDD approach and add tests within the `test` directory, |
| 6 | +to try different configs, you may find it easier to try out changes in |
| 7 | +a separate local directory. |
| 8 | + |
| 9 | +You can run [`npm link`](https://docs.npmjs.com/cli/link) for this purpose, |
| 10 | +pointing from your project to this project. For example, while in your project |
| 11 | +root and with `eslint-plugin-jsdoc` as a sibling, run: |
| 12 | + |
| 13 | +```shell |
| 14 | +npm link ../eslint-plugin-jsdoc |
| 15 | +``` |
| 16 | + |
| 17 | +## Building the project |
| 18 | + |
| 19 | +After running `npm install` to get the latest dependencies and devDependencies, |
| 20 | +you can run the following command to update the `dist` files, with `dist/index.js` |
| 21 | +being the `main` entrance point from `package.json`: |
| 22 | + |
| 23 | +```shell |
| 24 | +npm run build |
| 25 | +``` |
| 26 | + |
| 27 | +## Coding standards |
| 28 | + |
| 29 | +The project follows ESLint rules from [`canonical`](https://www.npmjs.com/package/eslint-config-canonical) |
| 30 | +and testing follows its subconfig, `canonical/mocha`. |
| 31 | + |
| 32 | +## Testing |
| 33 | + |
| 34 | +Tests are expected. Each rule file should be in CamelCase (despite the rule names themselves being hyphenated) and should be added within `test/assertions` and then imported/required by |
| 35 | +`test/rules/index.js`. |
| 36 | + |
| 37 | +Each rule file should be an ESM default export of an object which has `valid` and `invalid` array properties containing the tests. Tests of each type should be provided. |
| 38 | + |
| 39 | +`parserOptions` will be `ecmaVersion: 6` by default, but tests can override `parserOptions` |
| 40 | +with their own. |
| 41 | + |
| 42 | +See ESLint's [RuleTester](https://eslint.org/docs/developer-guide/nodejs-api#ruletester) |
| 43 | +for more on the allowable properties (e.g., `code`, `errors` (for invalid rules), |
| 44 | +`options`, `settings`, etc.). |
| 45 | + |
| 46 | +## Requirements for PRs |
| 47 | + |
| 48 | +PRs should be mergeable, [rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) |
| 49 | +first against the latest `master`. |
| 50 | + |
| 51 | +The number of commits will ideally be limited in number, unless extra commits |
| 52 | +can better show a progression of features. |
| 53 | + |
| 54 | +Commit messages should be worded clearly and the reason for any PR made clear |
| 55 | +by linking to an issue or giving a full description of what it achieves. |
0 commit comments