id-blacklist
Disallow the identifier names you list (old name of id-denylist)
deprecated
This is the old name for id-denylist. It takes the same options. Use id-denylist in new configs.
Names like data, tmp or cb don't say much about what they hold. The rule reports the names you list when they name a variable, parameter, function, class, import, object key or class member, or a property you assign to. Without a list, it reports nothing.
Examples#
bunfig.toml
[lint.rules]
id-blacklist = ["error", "data", "callback"]example.jswith
"data", "callback"4 problemsconst dataIdentifier data is restricted. = loadUser(id);
function save(user, callbackIdentifier callback is restricted.) {}
const response = { dataIdentifier data is restricted.: 1 };
response.dataIdentifier data is restricted. = 2;example.jswith
"data", "callback"No problemsconst user = loadUser(id);
function save(user, onSaved) {}
console.log(response.data);Unlike id-denylist, this rule doesn't look at private names:
example.jswith
"data"No problemsclass Store {
#data = new Map();
}Options#
Each option is a name to disallow. Names are compared exactly, so "data" doesn't match userData.