Package Exports
- eslint-plugin-eslint-comments
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-eslint-comments) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eslint-plugin-eslint-comments
Additional ESLint rules for ESLint's directive-comments (e.g. //eslint-disable-line
).
💿 Installation
npm install --save-dev eslint eslint-plugin-eslint-comments
Requirements
- Node.js
^4.0.0
,^6.0.0
, or newer. - ESLint
^4.7.0
, or newer.
📖 Usage
Write in your ESLint configurations: http://eslint.org/docs/user-guide/configuring#using-the-configuration-from-a-plugin
Example
.eslintrc.json
{
"extends": [
"eslint:recommended",
"plugin:eslint-comments/recommended"
],
}
Or you can specify for each rule:
{
"plugins": [
"eslint-comments"
],
"rules": {
"eslint-comments/no-unused-disable": "error",
"eslint-comments/no-unused-enable": "error",
// ...
}
}
Rules
- 🌟 mark: the rule is enabled by
eslint-comments/recommended
preset. - ✒️ mark: the rule is fixable by
eslint --fix
command.
Best Practices
Rule ID | Description | |
---|---|---|
🌟 | eslint-comments/disable-enable-pair | requires a eslint-enable comment for every eslint-disable comment |
🌟 | eslint-comments/no-aggregating-enable | disallows eslint-enable comments for multiple eslint-disable comments |
🌟 | eslint-comments/no-duplicate-disable | disallows duplicate eslint-disable comments |
🌟 | eslint-comments/no-unlimited-disable | disallows eslint-disable comments without rule names |
🌟 | eslint-comments/no-unused-disable | disallows unused eslint-disable comments |
🌟 | eslint-comments/no-unused-enable | disallows unused eslint-enable comments |
Stylistic Issues
Rule ID | Description | |
---|---|---|
eslint-comments/no-restricted-disable | disallows eslint-disable comments about specific rules |
|
eslint-comments/no-use | disallows ESLint directive-comments |
🚥 Semantic Versioning Policy
eslint-plugin-eslint-comments
follows semantic versioning and ESLint's Semantic Versioning Policy.
📰 Changelog
🍻 Contributing
Welcome contributing!
Please use GitHub's Issues/PRs.
Development Tools
npm test
runs tests and measures coverage.npm run build
updatesREADME.md
,index.js
, and the header of all rule's documents.npm run clean
removes the coverage of the lastnpm test
command.npm run coverage
shows the coverage of the lastnpm test
command.npm run lint
runs ESLint for this codebase.npm run watch
runs tests and measures coverage when source code are changed.