ban-unknown-rule-code
NOTE: this rule is part of the
recommended
rule set.Enable full set in
deno.json
:{ "lint": { "rules": { "tags": ["recommended"] } } }
Enable full set using the Deno CLI:
deno lint --rules-tags=recommended
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the
include
or exclude
array in deno.json
:{ "lint": { "rules": { "include": ["ban-unknown-rule-code"], "exclude": ["ban-unknown-rule-code"] } } }
Warns the usage of unknown rule codes in ignore directives.
We sometimes have to suppress and ignore lint errors for some reasons. We can do so using ignore directives with rule names that should be ignored like so:
// deno-lint-ignore no-explicit-any no-unused-vars
const foo: any = 42;
This rule checks for the validity of the specified rule names (i.e. whether
deno_lint
provides the rule or not).
Invalid:
// typo
// deno-lint-ignore eq-eq-e
console.assert(x == 42);
// unknown rule name
// deno-lint-ignore UNKNOWN_RULE_NAME
const b = "b";
Valid:
// deno-lint-ignore eq-eq-eq
console.assert(x == 42);
// deno-lint-ignore no-unused-vars
const b = "b";