Skip to content

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.

Type: string[]

Identifier names to globally disallow.

json.rules({
restrictedIdentifiers: {
deny: ["cb", "val"],
},
});
AEconsB0vAE <= sp ansty="le--0:#82AAFF;--1:#3B61">B0fetchUse53(<);d ivclassNa="meco"><);d>AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B011<()sp ansty="le--0:#D6DEEB;--1:#403F">53 <{}d ivclassNa="meco"><{}d>AEfuncti5<3 sp ansty="le--0:#82AAFF;--1:#3B61">B0proce1<1(sp ansty="le--1:#403F"><53sp ansty="le--0:#D7DB">E0vEB<, sp ansty="le--0:#D7DB">E01<1)sp ansty="le--0:#D6DEEB;--1:#403F">53 <{}d ivclassNa="meco"><{}d>AEimpo53 vaAEfr5<3 sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">4Dl1<1"sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meco"><";d>
44AEco61B0u44A61B0fetchU3F5<3() ;divclass="Name"><;di vdivclass="Nameexpressive-">44AEfunc361B0onComp11<11() spans="tyle--0:#D6DEEB;--1:#40">3F5<3 { }divclass="Name"><) {><}di vdivclass="Nameexpressive-">44AEfunc361B0pro1<111( spans="tyle--1:#40"><3F53 spans="tyle--0:#D7">DBE0uDEDBE0onComp1<111) spans="tyle--0:#D6DEEB;--1:#40">3F5<3 { }divclass="Name"><) {><}di vdivclass="Nameexpressive-">44AEim3F53 d44AE31<111" spans="tyle--0:#ECC48D;--1:#98">4E41<111" spans="tyle--0:#D6DEEB;--1:#40">3

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.