eslint-plugin-eslint-disable-enforce-comment-above
v1.0.1
Published
Enforce adding comment above eslint-disable explaining why.
Downloads
2,013
Maintainers
Readme
eslint-plugin-eslint-disable-enforce-comment-above
Enforce adding comment above eslint-disable explaining why.
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-eslint-disable-enforce-comment-above
:
npm install eslint-plugin-eslint-disable-enforce-comment-above --save-dev
Usage
Add eslint-disable-enforce-comment-above
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"eslint-disable-enforce-comment-above"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"eslint-disable-enforce-comment-above/eslint-disable-enforce-comment-above": "warn"
}
}
Example
❌ Bad:
/* eslint-disable */
✔️ Good:
// Add some descriptive comment explaining why.
/* eslint-disable */