restrictedIdentifiers
Disallows specific identifier names in binding positions.
✅ This rule is included in the ts stylisticStrict presets.
Some projects like to ban specific identifiers, or names, in code.
This rule provides a deny option that can be used to disallow specific identifier names.
Options
Section titled “Options”Type:
string[]
Identifier names to globally disallow.
json.rules({ restrictedIdentifiers: { deny: ["cb", "val"], },});const val = fetchUsers();function cb() {}function process(val, cb) {}import val from "lib";const users = fetchUsers();function onComplete() {}function process(users, onComplete) {}import data from "lib";When Not To Use It
Section titled “When Not To Use It”This rule is only relevant for projects that have established conventions of names that should not be used. If you’re not particular about banning specific identifier names, you likely don’t need this rule.
Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
id-denylist
Made with ❤️🔥 around the world by
the Flint team and contributors.