Skip to content

Commit c7e9d9d

Browse files
committed
chore: add import-x plugin/rules to eslint
1 parent a1e0484 commit c7e9d9d

File tree

3 files changed

+660
-1901
lines changed

3 files changed

+660
-1901
lines changed

eslint.config.mjs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* -------------------------------------------------------------------------------------------- */
55

66
import { defineConfig, globalIgnores } from 'eslint/config';
7-
import _import from 'eslint-plugin-import';
7+
import importX from 'eslint-plugin-import-x';
88
import globals from 'globals';
99
import js from '@eslint/js';
1010
import json from '@eslint/json';
@@ -14,17 +14,13 @@ import tseslint from 'typescript-eslint';
1414

1515

1616
export default defineConfig([
17-
18-
_import.flatConfigs.recommended,
19-
_import.flatConfigs.typescript,
2017

2118
globalIgnores([
2219
'out/*',
2320
'dist/*',
2421
'eslint.config.mjs',
2522
]),
2623

27-
//tseslint.configs.recommendedTypeChecked,
2824
{
2925
files: [
3026
'src/**/*.ts',
@@ -51,6 +47,13 @@ export default defineConfig([
5147
}
5248
},
5349

50+
plugins:{
51+
'import-x': importX,
52+
'@typescript-eslint': tseslint.plugin
53+
},
54+
55+
extends: [ 'import-x/flat/recommended', 'import-x/flat/typescript'],
56+
5457
rules: {
5558
'@typescript-eslint/naming-convention': [
5659
'warn',
@@ -72,9 +75,9 @@ export default defineConfig([
7275
],
7376
'curly': ['error', 'all'],
7477
'eqeqeq': 'error',
75-
'import/no-dynamic-require': 'error',
76-
'import/no-default-export': 'error',
77-
'import/no-self-import': 'error',
78+
'import-x/no-dynamic-require': 'error',
79+
'import-x/no-default-export': 'error',
80+
'import-x/no-self-import': 'error',
7881
'max-len': ['error', {
7982
'code': 120, // needs to be in sync w/ .prettierrc printWidth
8083
'ignoreUrls': true,

0 commit comments

Comments
 (0)