|
1 | 1 | const { |
2 | | - defineConfig, |
3 | | -} = require("eslint/config"); |
| 2 | + defineConfig, |
| 3 | +} = require('eslint/config'); |
4 | 4 |
|
5 | | -const globals = require("globals"); |
6 | | -const js = require("@eslint/js"); |
| 5 | +const globals = require('globals'); |
| 6 | +const js = require('@eslint/js'); |
7 | 7 |
|
8 | 8 | const { |
9 | | - FlatCompat, |
10 | | -} = require("@eslint/eslintrc"); |
| 9 | + FlatCompat, |
| 10 | +} = require('@eslint/eslintrc'); |
11 | 11 |
|
12 | 12 | const compat = new FlatCompat({ |
13 | | - baseDirectory: __dirname, |
14 | | - recommendedConfig: js.configs.recommended, |
15 | | - allConfig: js.configs.all |
| 13 | + baseDirectory: __dirname, |
| 14 | + recommendedConfig: js.configs.recommended, |
| 15 | + allConfig: js.configs.all |
16 | 16 | }); |
17 | 17 |
|
18 | 18 | module.exports = defineConfig([{ |
19 | | - extends: compat.extends("eslint:recommended"), |
20 | | - |
21 | | - languageOptions: { |
22 | | - globals: { |
23 | | - ...globals.browser, |
24 | | - ...globals.commonjs, |
25 | | - ...globals.node, |
26 | | - ...globals.mocha, |
27 | | - Atomics: "readonly", |
28 | | - SharedArrayBuffer: "readonly", |
29 | | - }, |
30 | | - |
31 | | - ecmaVersion: 2018, |
32 | | - sourceType: "commonjs", |
33 | | - |
34 | | - parserOptions: { |
35 | | - allowImportExportEverywhere: false, |
36 | | - codeFrame: false, |
37 | | - |
38 | | - ecmaFeatures: { |
39 | | - modules: true, |
40 | | - blockBindings: true, |
41 | | - }, |
42 | | - }, |
| 19 | + extends: compat.extends('eslint:recommended'), |
| 20 | + |
| 21 | + languageOptions: { |
| 22 | + globals: { |
| 23 | + ...globals.browser, |
| 24 | + ...globals.commonjs, |
| 25 | + ...globals.node, |
| 26 | + ...globals.mocha, |
| 27 | + Atomics: 'readonly', |
| 28 | + SharedArrayBuffer: 'readonly', |
43 | 29 | }, |
44 | 30 |
|
45 | | - rules: { |
46 | | - indent: ["warn", 2, { |
47 | | - SwitchCase: 1, |
48 | | - }], |
| 31 | + ecmaVersion: 2018, |
| 32 | + sourceType: 'commonjs', |
49 | 33 |
|
50 | | - "linebreak-style": ["error", "unix"], |
51 | | - quotes: ["error", "single"], |
52 | | - semi: ["error", "always"], |
53 | | - "no-console": "error", |
| 34 | + parserOptions: { |
| 35 | + allowImportExportEverywhere: false, |
| 36 | + codeFrame: false, |
| 37 | + |
| 38 | + ecmaFeatures: { |
| 39 | + modules: true, |
| 40 | + blockBindings: true, |
| 41 | + }, |
54 | 42 | }, |
| 43 | + }, |
| 44 | + |
| 45 | + rules: { |
| 46 | + indent: ['warn', 2, { |
| 47 | + SwitchCase: 1, |
| 48 | + }], |
| 49 | + |
| 50 | + 'linebreak-style': ['error', 'unix'], |
| 51 | + quotes: ['error', 'single'], |
| 52 | + semi: ['error', 'always'], |
| 53 | + 'no-console': 'error', |
| 54 | + }, |
55 | 55 | }]); |
0 commit comments