Skip to content

unicorn/no-abusive-eslint-disable Restriction

What it does

This rule disallows eslint-disable comments that do not specify any rules to disable.

Why is this bad?

When only one rule should be disabled but the eslint-disable comment does not specify any rules, other useful errors will also be silently ignored.

Examples

Examples of incorrect code for this rule:

javascript
/* eslint-disable */
console.log(message);

console.log(message); // eslint-disable-line

// eslint-disable-next-line
console.log(message);

Examples of correct code for this rule:

javascript
/* eslint-disable no-console */
console.log(message);

console.log(message); // eslint-disable-line no-console

// eslint-disable-next-line no-console
console.log(message);

References

Released under the MIT License.