require a eslint-enable comment for every eslint-disable comment
🌟 The "extends": "plugin:@eslint-community/eslint-comments/recommended" property in a configuration file enables this rule.
eslint-disable directive-comments disable ESLint rules in all lines preceded by the comment. If you forget eslint-enable directive-comment, you may overlook ESLint warnings unintentionally.
This rule warns eslint-disable directive-comments if the eslint-enable directive-comment for that does not exist.
The allowWholeFile option lets you allow disabling rules for the entire file while still catching "open" eslint-disable directives in the middle of a file.
@eslint-community/eslint-comments/disable-enable-pair
"extends": "plugin:@eslint-community/eslint-comments/recommended"
property in a configuration file enables this rule.eslint-disable
directive-comments disable ESLint rules in all lines preceded by the comment. If you forgeteslint-enable
directive-comment, you may overlook ESLint warnings unintentionally.This rule warns
eslint-disable
directive-comments if theeslint-enable
directive-comment for that does not exist.Rule Details
Examples of 👎 incorrect code for this rule:
Examples of 👍 correct code for this rule:
Options
The
allowWholeFile
option lets you allow disabling rules for the entire file while still catching "open"eslint-disable
directives in the middle of a file.Examples of 👎 incorrect code for this rule:
Examples of 👍 correct code for this rule: