Skip to content

Commit 221e7be

Browse files
committed
chore: update eslint config
1 parent 32834c4 commit 221e7be

File tree

3 files changed

+649
-23
lines changed

3 files changed

+649
-23
lines changed

eslint.config.mjs

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,46 @@
11
import pluginJs from '@eslint/js';
2-
import eslintConfigPrettier from 'eslint-config-prettier';
32
import jsdoc from 'eslint-plugin-jsdoc';
3+
import importX from 'eslint-plugin-import-x';
4+
45
import globals from 'globals';
56

67
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+
},
813
{
914
files: ['src/**/*.mjs', 'bin/**/*.mjs'],
1015
plugins: {
1116
jsdoc: jsdoc,
1217
},
13-
languageOptions: { globals: globals.node },
18+
languageOptions: {
19+
ecmaVersion: 'latest',
20+
globals: { ...globals.node },
21+
},
1422
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+
],
1544
'jsdoc/check-alignment': 'error',
1645
'jsdoc/check-indentation': 'error',
1746
'jsdoc/require-jsdoc': [
@@ -39,15 +68,8 @@ export default [
3968
'jsdoc/require-param': 'off',
4069
},
4170
},
42-
// @see https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores
4371
{
4472
files: ['src/generators/legacy-html/assets/*.js'],
4573
languageOptions: { globals: { ...globals.browser } },
4674
},
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-
},
5375
];

0 commit comments

Comments
 (0)