no-shadow-restricted-names
Configuration
rslint.config.ts
Rule Details
ECMAScript defines several special names that should not be redefined by user code: NaN, Infinity, undefined, eval, arguments, and globalThis. Shadowing these restricted names obscures runtime globals and makes programs harder to reason about.
This rule disallows shadowing of these restricted names by variable declarations, function names, function parameters, catch clause parameters, imported bindings, and class names.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule has an object option:
"reportGlobalThis": true(default) — report shadowing ofglobalThis."reportGlobalThis": false— allow shadowingglobalThis.
Examples of correct code for this rule with { "reportGlobalThis": false }: