Skip to content

eslint/rules/disable-comments ​

Disable comments (// eslint-disable-next-line <rule> -- <reason>): a rule set to warn may be disabled for one line, with a reason; a rule set to error cannot be disabled at all. A disable that is no longer needed is an error too (linterOptions, setup/javascript).

3 rules, 3 on. Source: lint/eslint/rules/disable-comments.mjs.

RuleSettingFilesWhat it checksWhy
local/disable-next-line-onlyerrorJS + TSAllow only eslint-disable-next-line comments, and no inline config.Custom: // eslint-disable-next-line <rule> -- <reason> only; no block or file disable, no inline config.
local/disable-only-warningserrorJS + TSAllow eslint-disable comments only for rules set to warn.Custom: only a warn rule may be disabled; an error is fixed.
local/disable-reasonwarnJS + TSRequire a reason after -- in eslint-disable comments.Warn: the reason after -- is expected; a missing one is a warning.

Generated from the JSDoc of the sources.