Disallow eslint-disable
comments without at least one rule.
npm i -D eslint-plugin-no-empty-disable
no-empty-eslint-disable/no-empty-eslint-disable
// .eslintrc
{
...
"plugins": ["no-empty-eslint-disable"]
...
"rules": {
...
"no-empty-eslint-disable/no-empty-eslint-disable": "error"
...
}
}
const x = 1; // eslint-disable-line
// eslint-disable-next-line
/* eslint-disable */
console.log('') // eslint-disable-line no-console
// eslint-disable-next-line eqeqeq
/* eslint-disable no-empty */
- Uses tslint which has now been depecated. Migrate to eslint
Heavily inspired by [https://github.com/unlight/eslint-plugin-no-eslint-disable]