id-denylist

禁止指定标识符

"There are only two hard things in Computer Science: cache invalidation and naming things." — Phil Karlton

通用名称可能导致难以破译的代码。此规则允许您指定不允许的标识符名称的拒绝列表以避免这种做法。

规则详情

此规则不允许在分配和 function 定义中指定标识符。

此规则将捕获不允许的标识符,这些标识符是:

    9mbomEIwvLT+hbp1Xw8K2nctEWaqprvd8NqH+UsGAcNlCGs5hIa61UgJw1DQ1QzU4EeOlWU6USssO3a+Gx1JpN76a6eidfaeeERSNb3ZOpWOwpskgob3Z7U7CWQrOL4VgwE+RqKTBX2CTHM/EBbabyP79h/0Bm5WbazKgPktlWbp0bZ6cEYv7faIvJoYkCka

D+kzmi0oubkSMCFmR9OTG/NYtnmGts8eB+HczlJ2KwGmUll1DhwmzRzDY6voyT1B

    CvopV0+256gUFxcZ4GCrSr3BmoFFpkoXErTmyfIl60elS2530/aaa7JKRdrNx5UPQi70e7KF8IHfzYf1RIJhDwjVuNpZS55BPMy/I1uf+5DjA1PWvsPjYarpsrYPc6IU+ACaaKMC0g8qaMBZRJj5qsA/gM9fJTwH8xHy72cVHFS7n5ve2Y/hyYDg9k0HDreqYXwJYsaw7vVVJJBI05wrmw==

选项

HtaL/lN5/CMThD/hc0eUdgihnSQGRv0/pV3a51Xm7PO+qVG81Lzkp2scqIB5mla/CfLpJR53xwJhZGpqO7kZuxUrhM0pKTMb82yx2XuW9zaiUaMLrrzc4gx6dJ/u7k+3

4YqzrZt/dKrlEPE1r4wgmZeP/zZQyc7sxB4ZE7EQ0R0cYnErvzaC+KUJe3UQexqrKBqCF+0fuv/4hXdC8wBAaw==

{
    "id-denylist": ["error", "data", "err", "e", "cb", "callback"]
}

TOiIhAaba6b+oi13LOZuiyzgGtna2gqbxLpn2WSMCTT/gSdNlo5qvwxRyzk1G1UpFEa5P6nngKcRfpY0zJCy58Rw3TMoXLUwUzjAyaiLU5VyihYQ99AgjO21DTFgGntr17OZJiPy+ykM2U/X4MVT3OnOw851M9z3VV3pP2IaEL3pvue/PxKs8q7MhVfTfQAU+ZIJz4kuvmt0E1IIfpy8rCCb45K8129QykJ6q+bUMsYc7gS73nmUFoWgzgD6zpHr03b08Lw6mqm5abWCx94DqA==

usUFST+XNaC0G4FBYCpW1o2NIyYN5rhntJ6ykGTmrSkN7RMK+LKpLTSEoeo+37A4VwCJSDhAXwGd3UQo7hRCdNVjI3M6T0fSWj5eFv1iJ/xVL3y/Xbw91gku6qgJiNMm9C3xXePx8VF5DljtidlDzQ==

/*eslint id-denylist: ["error", "data", "callback"] */

var data = {...};

function callback() {
    // ...
}

element.callback = function() {
    // ...
};

var itemSet = {
    data: [...]
};

class Foo {
    data = [];
}

class Foo {
    #data = [];
}

class Foo {
    callback( {);
}

class Foo {
    #callback( {);
}

usUFST+XNaC0G4FBYCpW1o2NIyYN5rhntJ6ykGTmrSkN7RMK+LKpLTSEoeo+37A4VwCJSDhAXwGd3UQo7hRCdBvKpoPv6xfFdxpm4/Ld8TVi6SAqd5vVtjprhNAQLp5UAOT9gCzkU9uiDeta1Nf/lg==

/*eslint id-denylist: ["error", "data", "callback"] */

var encodingOptions = {...};

function processFileResult() {
    // ...
}

element.successHandler = function() {
    // ...
};

var itemSet = {
    entities: [...]
};

callback(); // all function calls are ignored

foo.callback(); // all function calls are ignored

foo.data; // all property names that are not assignments are ignored

class Foo {
    items = [];
}

class Foo {
    #items = [];
}

class Foo {
    method( {);
}

class Foo {
    #method( {);
}

何时不使用

xNJ30wbn1kvlyCZSQiHWDVv8kVjkfimxHpNQwkJCylwluyz/jqpOX8W554eHAYxe03L0ZcTx9aydVOsyDDPYmVP8Q8vWT9oCOqNeHP04s3s=