|
1 | | -const globals = require('globals'); |
2 | | -const js = require('@eslint/js'); |
| 1 | +const globals = require("globals"); |
| 2 | +const js = require("@eslint/js"); |
3 | 3 |
|
4 | 4 | module.exports = [ |
5 | | - js.configs.recommended, |
6 | | - { |
7 | | - languageOptions: { |
8 | | - ecmaVersion: 2020, |
9 | | - sourceType: "script", |
10 | | - globals: { |
11 | | - // https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables |
12 | | - ...globals.browser, |
13 | | - ...globals.node, |
14 | | - }, |
| 5 | + js.configs.recommended, |
| 6 | + { |
| 7 | + languageOptions: { |
| 8 | + ecmaVersion: 2020, |
| 9 | + sourceType: "script", |
| 10 | + globals: { |
| 11 | + // https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables |
| 12 | + ...globals.browser, |
| 13 | + ...globals.node, |
| 14 | + }, |
| 15 | + }, |
| 16 | + rules: { |
| 17 | + semi: "error", |
| 18 | + "prefer-const": "error", |
| 19 | + "no-async-promise-executor": "off", |
| 20 | + "no-empty": ["error", { allowEmptyCatch: true }], |
| 21 | + "no-prototype-builtins": "off", |
| 22 | + "node/no-extraneous-require": "off", |
| 23 | + "node/shebang": "off", |
| 24 | + // https://eslint.org/docs/latest/rules/no-unused-vars |
| 25 | + "no-unused-vars": [ |
| 26 | + "error", |
| 27 | + { |
| 28 | + vars: "all", |
| 29 | + args: "after-used", |
| 30 | + caughtErrors: "none", // ignore catch block variables |
| 31 | + ignoreRestSiblings: false, |
| 32 | + reportUsedIgnorePattern: false, |
15 | 33 | }, |
16 | | - rules: { |
17 | | - semi: "error", |
18 | | - "prefer-const": "error", |
19 | | - "no-async-promise-executor": 'off', |
20 | | - "no-empty": ["error", { "allowEmptyCatch": true }], |
21 | | - "no-prototype-builtins": 'off', |
22 | | - "node/no-extraneous-require": 'off', |
23 | | - "node/shebang": 'off', |
24 | | - // https://eslint.org/docs/latest/rules/no-unused-vars |
25 | | - "no-unused-vars": ["error", { |
26 | | - "vars": "all", |
27 | | - "args": "after-used", |
28 | | - "caughtErrors": "none", // ignore catch block variables |
29 | | - "ignoreRestSiblings": false, |
30 | | - "reportUsedIgnorePattern": false, |
31 | | - }] |
32 | | - } |
33 | | - } |
| 34 | + ], |
| 35 | + }, |
| 36 | + }, |
34 | 37 | ]; |
0 commit comments