|
1 |
| -import stylisticJs from '@stylistic/eslint-plugin-js' |
2 |
| -import eslint from '@eslint/js'; |
3 |
| -import tseslint from 'typescript-eslint'; |
4 |
| -import globals from 'globals'; |
| 1 | +import eslint from "@eslint/js"; |
| 2 | +import tseslint from "typescript-eslint"; |
| 3 | +import stylistic from "@stylistic/eslint-plugin"; |
5 | 4 |
|
6 | 5 | export default tseslint.config(
|
7 |
| - { ignores: ["build", "lib", "examples", "bench"] }, |
| 6 | + { |
| 7 | + ignores: ["build", "lib", "examples", "bench", "eslint.config.mjs"] |
| 8 | + }, |
8 | 9 | eslint.configs.recommended,
|
9 | 10 | ...tseslint.configs.recommended,
|
10 |
| - ...tseslint.configs.stylistic, |
11 | 11 | {
|
12 |
| - "languageOptions": { |
13 |
| - "parser": tseslint.parser, |
14 |
| - "parserOptions": { |
15 |
| - "lib": ["es2023"], |
16 |
| - "module": "commonjs", |
17 |
| - "moduleResolution": "node", |
18 |
| - "target": "es2022", |
19 |
| - |
20 |
| - "strict": true, |
21 |
| - "esModuleInterop": true, |
22 |
| - "skipLibCheck": true, |
23 |
| - "include": [ |
24 |
| - "bin/**/*.ts", |
25 |
| - "src/**/*.ts", |
26 |
| - "test/**/*.ts" |
27 |
| - ], |
28 |
| - "outDir": "./lib", |
29 |
| - "declaration": true, |
30 |
| - "pretty": true, |
31 |
| - "sourceMap": true |
32 |
| - }, |
33 |
| - "globals": { |
34 |
| - ...globals.commonjs, |
35 |
| - ...globals.node, |
36 |
| - ...globals.es6 |
| 12 | + languageOptions: { |
| 13 | + parser: tseslint.parser, |
| 14 | + parserOptions: { |
| 15 | + projectService: true |
37 | 16 | },
|
38 | 17 | },
|
39 | 18 | },
|
40 | 19 | {
|
41 | 20 | plugins: {
|
42 |
| - '@stylistic/js': stylisticJs |
| 21 | + "@stylistic": stylistic, |
43 | 22 | },
|
44 |
| - files: [ |
45 |
| - "bin/**/*.ts", |
46 |
| - 'bench/**/*.ts', |
47 |
| - 'src/**/*.ts', |
48 |
| - 'test/**/*.ts', |
49 |
| - ], |
| 23 | + files: ["bin/**/*.ts", "bench/**/*.ts", "src/**/*.ts", "test/**/*.ts"], |
50 | 24 | rules: {
|
51 |
| - '@stylistic/js/max-len': [ 2, { |
52 |
| - 'code': 120, |
53 |
| - 'ignoreComments': true |
54 |
| - } ], |
55 |
| - "@stylistic/js/array-bracket-spacing": ["error", "always"], |
56 |
| - "@stylistic/js/operator-linebreak": ["error", "after"], |
57 |
| - "@stylistic/js/linebreak-style": ["error", "unix"], |
58 |
| - "@stylistic/js/brace-style": ["error", "1tbs", { "allowSingleLine": true }], |
59 |
| - '@stylistic/js/indent': ["error", 2, { |
60 |
| - "SwitchCase": 1, |
61 |
| - "FunctionDeclaration": { "parameters": "first" }, |
62 |
| - "FunctionExpression": { "parameters": "first" } |
63 |
| - }], |
64 |
| - } |
| 25 | + "@stylistic/max-len": [ |
| 26 | + 2, |
| 27 | + { |
| 28 | + code: 120, |
| 29 | + ignoreComments: true, |
| 30 | + }, |
| 31 | + ], |
| 32 | + "@stylistic/array-bracket-spacing": ["error", "always"], |
| 33 | + "@stylistic/operator-linebreak": ["error", "after"], |
| 34 | + "@stylistic/linebreak-style": ["error", "unix"], |
| 35 | + "@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: true }], |
| 36 | + "@stylistic/indent": [ |
| 37 | + "error", |
| 38 | + 2, |
| 39 | + { |
| 40 | + SwitchCase: 1, |
| 41 | + FunctionDeclaration: { parameters: "first" }, |
| 42 | + FunctionExpression: { parameters: "first" }, |
| 43 | + }, |
| 44 | + ], |
| 45 | + }, |
65 | 46 | }
|
66 | 47 | );
|
0 commit comments