id-denylist
UnreleasedConfiguration
rslint.config.ts
Rule Details
Generic names can lead to hard-to-decipher code. This rule lets you list identifier names that should not be used, and reports every place the code introduces one.
The rule catches denied identifiers that are:
- variable declarations
- function declarations
- object properties assigned to during object creation
- class fields
- class methods
It leaves alone denied identifiers that are:
- function calls and their arguments, so you can keep calling functions you do not control
- property reads, so you can keep reading properties of objects you do not control
- references to global variables the code does not declare, whose names you do not control
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
The rule takes one or more strings: the names of the denied identifiers.
Differences from ESLint
- TypeScript 6 rejects legacy
assertimport attributes before lint rules run. ESLint can still lint that syntax with parser versions that accept it. Currentwithimport attributes, including import types, are checked normally. - Implicit TypeScript type globals use scope-manager's default
esnextcatalog. An explicitly customizedparserOptions.libdoes not change that catalog in rslint, so additional host-library types may still be reported.