Skip to content

@eslint-community/eslint-comments/no-restricted-disable

disallow eslint-disable comments about specific rules

This rule warns eslint-disable directive-comments if the comment disable specific rules.

Rule Details

👎 Examples of incorrect code for this rule:

Now loading...
Now loading...
Now loading...

👍 Examples of correct code for this rule:

Now loading...

Options

json
{
    "no-restricted-disable": ["error", ...]
}

This rule takes a list of strings, where each string is a glob pattern. For example:

json
{
    "@eslint-community/eslint-comments/no-restricted-disable": [
        "error",
        "no-undef",
        "*semi*", // rules which includes `semi`. E.g. `semi`, `semi-style`, `no-extra-semi`, ...
        "react/*" // rules of `eslint-plugin-react`
    ]
}
json
{
    "no-restricted-disable": [
        "error",
        "*",          // any rules
        "!no-console" // but except `no-console`.
    ]
}