|
1 | 1 | # eslint-plugin-eslint-comments
|
2 |
| -Additional ESLint rules for directive comments of ESLint. |
| 2 | + |
| 3 | +[](https://www.npmjs.com/package/eslint-plugin-eslint-comments) |
| 4 | +[](http://www.npmtrends.com/eslint-plugin-eslint-comments) |
| 5 | +[](https://travis-ci.org/mysticatea/eslint-plugin-eslint-comments) |
| 6 | +[](https://codecov.io/gh/mysticatea/eslint-plugin-eslint-comments) |
| 7 | +[](https://david-dm.org/mysticatea/eslint-plugin-eslint-comments) |
| 8 | + |
| 9 | +Additional ESLint rules for ESLint's directive comments (e.g. `//eslint-disable-line`). |
| 10 | + |
| 11 | +## :cd: Installation |
| 12 | + |
| 13 | +``` |
| 14 | +npm install --save-dev eslint eslint-plugin-eslint-comments |
| 15 | +``` |
| 16 | + |
| 17 | +### Requirements |
| 18 | + |
| 19 | +- Node.js `^4.0.0`, `^6.0.0`, or newer. |
| 20 | +- ESLint `^3.1.0`, or newer. |
| 21 | + |
| 22 | +## :book: Usage |
| 23 | + |
| 24 | +Write in your ESLint configurations: http://eslint.org/docs/user-guide/configuring#using-the-configuration-from-a-plugin |
| 25 | + |
| 26 | +### Example |
| 27 | + |
| 28 | +**.eslintrc.json** |
| 29 | + |
| 30 | +```json |
| 31 | +{ |
| 32 | + "plugins": [ |
| 33 | + "eslint-comments" |
| 34 | + ], |
| 35 | + "rules": { |
| 36 | + "eslint-comments/disable-enable-pair": "error", |
| 37 | + "eslint-comments/no-duplicate-disable": "error", |
| 38 | + "eslint-comments/no-unlimited-disable": "error", |
| 39 | + "eslint-comments/no-unused-disable": "error", |
| 40 | + "eslint-comments/no-use": "error", |
| 41 | + "eslint-comments/no-useless-enable": "error", |
| 42 | + } |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +### Rules |
| 47 | + |
| 48 | +- [eslint-comments/disable-enable-pair](docs/rules/disable-enable-pair.md) requires a `eslint-enable` comment for every `eslint-disable` comment. |
| 49 | +- [eslint-comments/no-duplicate-disable](docs/rules/no-duplicate-disable.md) disallows duplicate `eslint-disable` comments. |
| 50 | +- [eslint-comments/no-unlimited-disable](docs/rules/no-unlimited-disable.md) disallows `eslint-disable` comments without rule names. |
| 51 | +- [eslint-comments/no-unused-disable](docs/rules/no-unused-disable.md) disallows unused `eslint-disable` comments. |
| 52 | +- [eslint-comments/no-use](docs/rules/no-use.md) disallows ESLint directive comments. |
| 53 | +- [eslint-comments/no-useless-enable](docs/rules/no-useless-enable.md) disallows useless `eslint-enable` comments. |
| 54 | + |
| 55 | +## :anchor: Semantic Versioning Policy |
| 56 | + |
| 57 | +`eslint-plugin-eslint-comments` follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy). |
| 58 | + |
| 59 | +- Patch release (intended to not break your lint build) |
| 60 | + - A bug fix in a rule that results in `eslint-plugin-eslint-comments` reporting fewer errors. |
| 61 | + - Improvements to documentation. |
| 62 | + - Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage. |
| 63 | + - Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone). |
| 64 | +- Minor release (might break your lint build) |
| 65 | + - A bug fix in a rule that results in `eslint-plugin-eslint-comments` reporting more errors. |
| 66 | + - A new rule is created. |
| 67 | + - A new option to an existing rule is created. |
| 68 | + - An existing rule is deprecated. |
| 69 | +- Major release (likely to break your lint build) |
| 70 | + - A support for old Node version is dropped. |
| 71 | + - A support for old ESLint version is dropped. |
| 72 | + - An existing rule is removed. |
| 73 | + - An existing option of a rule is removed. |
| 74 | + - An existing config is updated. |
| 75 | + |
| 76 | +## :newspaper: Changelog |
| 77 | + |
| 78 | +- [GitHub Releases](https://github.com/mysticatea/eslint-plugin-eslint-comments/releases) |
| 79 | + |
| 80 | +## :muscle: Contributing |
| 81 | + |
| 82 | +Welcome contributing! |
| 83 | + |
| 84 | +Please use GitHub's Issues/PRs. |
| 85 | + |
| 86 | +### Development Tools |
| 87 | + |
| 88 | +- `npm test` runs tests and measures coverage. |
| 89 | +- `npm run watch` runs tests and measures coverage when source code are changed. |
| 90 | +- `npm run coverage` shows the coverage result of `npm test` command. |
| 91 | +- `npm run clean` removes the coverage result of `npm test` command. |
0 commit comments