|
1 | | -const { |
2 | | - defineConfig, |
3 | | - globalIgnores, |
4 | | -} = require("eslint/config"); |
| 1 | +const { defineConfig, globalIgnores } = require('eslint/config'); |
5 | 2 |
|
6 | | -const tsParser = require("@typescript-eslint/parser"); |
7 | | -const typescriptEslint = require("@typescript-eslint/eslint-plugin"); |
8 | | -const globals = require("globals"); |
9 | | -const parser = require("svelte-eslint-parser"); |
10 | | -const js = require("@eslint/js"); |
| 3 | +const tsParser = require('@typescript-eslint/parser'); |
| 4 | +const typescriptEslint = require('@typescript-eslint/eslint-plugin'); |
| 5 | +const globals = require('globals'); |
| 6 | +const parser = require('svelte-eslint-parser'); |
| 7 | +const js = require('@eslint/js'); |
11 | 8 |
|
12 | | -const { |
13 | | - FlatCompat, |
14 | | -} = require("@eslint/eslintrc"); |
| 9 | +const { FlatCompat } = require('@eslint/eslintrc'); |
15 | 10 |
|
16 | 11 | const compat = new FlatCompat({ |
17 | | - baseDirectory: __dirname, |
18 | | - recommendedConfig: js.configs.recommended, |
19 | | - allConfig: js.configs.all |
| 12 | + baseDirectory: __dirname, |
| 13 | + recommendedConfig: js.configs.recommended, |
| 14 | + allConfig: js.configs.all |
20 | 15 | }); |
21 | 16 |
|
22 | | -module.exports = defineConfig([{ |
23 | | - extends: compat.extends( |
24 | | - "eslint:recommended", |
25 | | - "plugin:@typescript-eslint/recommended", |
26 | | - "plugin:svelte/recommended", |
27 | | - "plugin:dci-lint/recommended", |
28 | | - "prettier", |
29 | | - ), |
| 17 | +module.exports = defineConfig([ |
| 18 | + { |
| 19 | + extends: compat.extends( |
| 20 | + 'eslint:recommended', |
| 21 | + 'plugin:@typescript-eslint/recommended', |
| 22 | + 'plugin:svelte/recommended', |
| 23 | + 'plugin:dci-lint/recommended', |
| 24 | + 'prettier' |
| 25 | + ), |
30 | 26 |
|
31 | | - languageOptions: { |
32 | | - parser: tsParser, |
33 | | - sourceType: "module", |
34 | | - ecmaVersion: 2020, |
| 27 | + languageOptions: { |
| 28 | + parser: tsParser, |
| 29 | + sourceType: 'module', |
| 30 | + ecmaVersion: 2020, |
35 | 31 |
|
36 | | - parserOptions: { |
37 | | - extraFileExtensions: [".svelte"], |
38 | | - }, |
| 32 | + parserOptions: { |
| 33 | + extraFileExtensions: ['.svelte'] |
| 34 | + }, |
39 | 35 |
|
40 | | - globals: { |
41 | | - ...globals.browser, |
42 | | - ...globals.node, |
43 | | - }, |
44 | | - }, |
| 36 | + globals: { |
| 37 | + ...globals.browser, |
| 38 | + ...globals.node |
| 39 | + } |
| 40 | + }, |
45 | 41 |
|
46 | | - plugins: { |
47 | | - "@typescript-eslint": typescriptEslint, |
48 | | - }, |
| 42 | + plugins: { |
| 43 | + '@typescript-eslint': typescriptEslint |
| 44 | + }, |
49 | 45 |
|
50 | | - rules: { |
51 | | - "dci-lint/literal-role-contracts": "off", |
52 | | - }, |
53 | | -}, { |
54 | | - files: ["**/*.svelte"], |
| 46 | + rules: { |
| 47 | + 'dci-lint/literal-role-contracts': 'off' |
| 48 | + } |
| 49 | + }, |
| 50 | + { |
| 51 | + files: ['**/*.svelte'], |
55 | 52 |
|
56 | | - languageOptions: { |
57 | | - parser: parser, |
| 53 | + languageOptions: { |
| 54 | + parser: parser, |
58 | 55 |
|
59 | | - parserOptions: { |
60 | | - parser: "@typescript-eslint/parser", |
61 | | - }, |
62 | | - }, |
63 | | -}, { |
64 | | - files: ["src/lib/**"], |
| 56 | + parserOptions: { |
| 57 | + parser: '@typescript-eslint/parser' |
| 58 | + } |
| 59 | + } |
| 60 | + }, |
| 61 | + { |
| 62 | + files: ['src/lib/**'], |
65 | 63 |
|
66 | | - rules: { |
67 | | - "no-console": ["error", { |
68 | | - allow: ["warn"], |
69 | | - }], |
70 | | - }, |
71 | | -}, globalIgnores([ |
72 | | - "**/.DS_Store", |
73 | | - "**/node_modules", |
74 | | - "build", |
75 | | - ".svelte-kit", |
76 | | - "package", |
77 | | - "**/.env", |
78 | | - "**/.env.*", |
79 | | - "!**/.env.example", |
80 | | - "dist", |
81 | | - "**/pnpm-lock.yaml", |
82 | | - "**/package-lock.json", |
83 | | - "**/yarn.lock", |
84 | | -])]); |
| 64 | + rules: { |
| 65 | + 'no-console': [ |
| 66 | + 'error', |
| 67 | + { |
| 68 | + allow: ['warn'] |
| 69 | + } |
| 70 | + ] |
| 71 | + } |
| 72 | + }, |
| 73 | + globalIgnores([ |
| 74 | + '**/.DS_Store', |
| 75 | + '**/node_modules', |
| 76 | + 'build', |
| 77 | + '.svelte-kit', |
| 78 | + 'package', |
| 79 | + '**/.env', |
| 80 | + '**/.env.*', |
| 81 | + '!**/.env.example', |
| 82 | + 'dist', |
| 83 | + '**/pnpm-lock.yaml', |
| 84 | + '**/package-lock.json', |
| 85 | + '**/yarn.lock' |
| 86 | + ]) |
| 87 | +]); |
0 commit comments