|
1 | 1 | import pluginJs from '@eslint/js'; |
2 | | -import eslintConfigPrettier from 'eslint-config-prettier'; |
3 | 2 | import jsdoc from 'eslint-plugin-jsdoc'; |
| 3 | +import importX from 'eslint-plugin-import-x'; |
| 4 | + |
4 | 5 | import globals from 'globals'; |
5 | 6 |
|
6 | 7 | export default [ |
7 | | - // @see https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores |
| 8 | + pluginJs.configs.recommended, |
| 9 | + importX.flatConfigs.recommended, |
| 10 | + { |
| 11 | + ignores: ['out/', 'src/generators/api-links/test/fixtures/'], |
| 12 | + }, |
8 | 13 | { |
9 | 14 | files: ['src/**/*.mjs', 'bin/**/*.mjs'], |
10 | 15 | plugins: { |
11 | 16 | jsdoc: jsdoc, |
12 | 17 | }, |
13 | | - languageOptions: { globals: globals.node }, |
| 18 | + languageOptions: { |
| 19 | + ecmaVersion: 'latest', |
| 20 | + globals: { ...globals.node }, |
| 21 | + }, |
14 | 22 | rules: { |
| 23 | + 'import-x/namespace': 'off', |
| 24 | + 'import-x/no-named-as-default-member': 'off', |
| 25 | + 'import-x/no-unresolved': 'off', |
| 26 | + 'import-x/order': [ |
| 27 | + 'error', |
| 28 | + { |
| 29 | + groups: [ |
| 30 | + 'builtin', |
| 31 | + 'external', |
| 32 | + 'internal', |
| 33 | + ['sibling', 'parent'], |
| 34 | + 'index', |
| 35 | + 'unknown', |
| 36 | + ], |
| 37 | + 'newlines-between': 'always', |
| 38 | + alphabetize: { |
| 39 | + order: 'asc', |
| 40 | + caseInsensitive: true, |
| 41 | + }, |
| 42 | + }, |
| 43 | + ], |
15 | 44 | 'jsdoc/check-alignment': 'error', |
16 | 45 | 'jsdoc/check-indentation': 'error', |
17 | 46 | 'jsdoc/require-jsdoc': [ |
@@ -39,15 +68,8 @@ export default [ |
39 | 68 | 'jsdoc/require-param': 'off', |
40 | 69 | }, |
41 | 70 | }, |
42 | | - // @see https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores |
43 | 71 | { |
44 | 72 | files: ['src/generators/legacy-html/assets/*.js'], |
45 | 73 | languageOptions: { globals: { ...globals.browser } }, |
46 | 74 | }, |
47 | | - // @see https://eslint.org/docs/latest/rules to learn more about these rules |
48 | | - pluginJs.configs.recommended, |
49 | | - eslintConfigPrettier, |
50 | | - { |
51 | | - ignores: ['src/generators/api-links/test/fixtures/**'], |
52 | | - }, |
53 | 75 | ]; |
0 commit comments