1.0.1 • Published 3 years ago
eslint-plugin-eslint-disable-enforce-comment-above v1.0.1
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-devNext, install eslint-plugin-eslint-disable-enforce-comment-above:
npm install eslint-plugin-eslint-disable-enforce-comment-above --save-devUsage
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 */