Procházet zdrojové kódy

Modify no-unused-vars behaviour

using @typescript-eslint/no-unused-vars reduces the number of false
positives in TS code. The changes:
1. Allow the arguments to a function to be checked (reporting only after
the last used variable)
2. Allow rest siblings to be checked
3. Allow these rules to be skipped with an _ prefix to a variable

GitOrigin-RevId: 1f6eac4109859415218248d5b2068a22b34cfd7e
andrew rumble před 2 roky
rodič
revize
3da4dc71f1
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. 12 0
      services/web/.eslintrc.js

+ 12 - 0
services/web/.eslintrc.js

@@ -383,6 +383,18 @@ module.exports = {
               'Modify location via customLocalStorage instead of calling window.localStorage methods directly',
           },
         ],
+        'no-unused-vars': 'off',
+        '@typescript-eslint/no-unused-vars': [
+          'error',
+          {
+            args: 'after-used',
+            argsIgnorePattern: '^_',
+            ignoreRestSiblings: false,
+            caughtErrors: 'none',
+            vars: 'all',
+            varsIgnorePattern: '^_',
+          },
+        ],
       },
     },
     {