]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/docs/rules/id-denylist.md
import 8.3.0 source
[pve-eslint.git] / eslint / docs / rules / id-denylist.md
index 040f26e894c099f633ca57cbbd40de5fd06c3426..071a34f7940f8dfe5e2423d37e6655bbe1f97fc7 100644 (file)
@@ -13,6 +13,8 @@ This rule will catch disallowed identifiers that are:
 - variable declarations
 - function declarations
 - object properties assigned to during object creation
+- class fields
+- class methods
 
 It will not catch disallowed identifiers that are:
 
@@ -49,6 +51,22 @@ element.callback = function() {
 var itemSet = {
     data: [...]
 };
+
+class Foo {
+    data = [];
+}
+
+class Foo {
+    #data = [];
+}
+
+class Foo {
+    callback( {);
+}
+
+class Foo {
+    #callback( {);
+}
 ```
 
 Examples of **correct** code for this rule with sample `"data", "callback"` restricted identifiers:
@@ -75,6 +93,22 @@ 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( {);
+}
 ```
 
 ## When Not To Use It