|
1 | | -// @ts-check |
2 | | -import { builtinModules } from 'node:module' |
3 | | -import tseslint from 'typescript-eslint' |
4 | | -import importX from 'eslint-plugin-import-x' |
5 | | -import eslint from '@eslint/js' |
6 | | -import eslintConfigPrettier from 'eslint-config-prettier' |
| 1 | +import { sxzz } from '@sxzz/eslint-config' |
7 | 2 |
|
8 | | -export default tseslint.config( |
9 | | - eslint.configs.recommended, |
| 3 | +export default sxzz( |
| 4 | + {}, |
10 | 5 | { |
11 | | - files: ['**/*.js', '**/*.ts', '**/*.tsx'], |
12 | | - extends: [...tseslint.configs.recommended], |
13 | | - plugins: { |
14 | | - import: importX, |
15 | | - }, |
16 | | - |
17 | | - languageOptions: { |
18 | | - parserOptions: { |
19 | | - sourceType: 'module', |
20 | | - ecmaFeatures: { |
21 | | - jsx: true, |
22 | | - }, |
23 | | - }, |
24 | | - }, |
25 | | - |
26 | 6 | rules: { |
27 | | - eqeqeq: ['warn', 'always', { null: 'never' }], |
28 | | - 'no-debugger': ['error'], |
29 | | - 'no-empty': ['warn', { allowEmptyCatch: true }], |
30 | | - 'prefer-const': [ |
31 | | - 'warn', |
32 | | - { |
33 | | - destructuring: 'all', |
34 | | - }, |
35 | | - ], |
36 | | - '@typescript-eslint/ban-ts-comment': 'off', |
37 | | - '@typescript-eslint/no-var-requires': 'off', |
38 | | - '@typescript-eslint/no-non-null-assertion': 'off', |
39 | | - '@typescript-eslint/no-explicit-any': 'off', |
40 | | - '@typescript-eslint/consistent-type-imports': [ |
41 | | - 'error', |
42 | | - { prefer: 'type-imports', fixStyle: 'inline-type-imports' }, |
43 | | - ], |
44 | | - |
45 | | - 'import/no-nodejs-modules': [ |
46 | | - 'error', |
47 | | - { allow: builtinModules.map((mod) => `node:${mod}`) }, |
48 | | - ], |
49 | | - 'import/no-duplicates': 'error', |
50 | | - 'import/order': 'error', |
51 | | - 'sort-imports': [ |
52 | | - 'error', |
53 | | - { |
54 | | - ignoreCase: false, |
55 | | - ignoreDeclarationSort: true, |
56 | | - ignoreMemberSort: false, |
57 | | - memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], |
58 | | - allowSeparatedGroups: false, |
59 | | - }, |
60 | | - ], |
| 7 | + 'import/no-default-export': 'off', |
| 8 | + 'unicorn/filename-case': 'off', |
61 | 9 | }, |
62 | 10 | }, |
63 | | - eslintConfigPrettier, |
64 | | - { |
65 | | - ignores: ['**/dist/', '**/coverage/'], |
66 | | - }, |
67 | 11 | ) |
0 commit comments