@innovixx/eslint-config 5.0.0-alpha.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { importX } from 'eslint-plugin-import-x';
|
|
2
2
|
import sortExportAllPlugin from 'eslint-plugin-sort-export-all';
|
|
3
3
|
import nodePlugin from 'eslint-plugin-n';
|
|
4
4
|
import globals from 'globals';
|
|
@@ -46,7 +46,7 @@ export const index = deepMerge(
|
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
plugins: {
|
|
49
|
-
import:
|
|
49
|
+
'import-x': importX,
|
|
50
50
|
'sort-export-all': sortExportAllPlugin,
|
|
51
51
|
...nodePlugin.configs['flat/recommended'].plugins,
|
|
52
52
|
},
|
|
@@ -56,7 +56,7 @@ export const index = deepMerge(
|
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
rules: {
|
|
59
|
-
'import/extensions': 'off',
|
|
59
|
+
'import-x/extensions': 'off',
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import globals from 'globals';
|
|
2
|
-
import importPlugin from 'eslint-plugin-import';
|
|
2
|
+
import importPlugin from 'eslint-plugin-import-x';
|
|
3
3
|
|
|
4
4
|
/** @type {import('eslint').Linter.Config} */
|
|
5
5
|
|
|
@@ -19,7 +19,7 @@ const importRules = {
|
|
|
19
19
|
import: importPlugin,
|
|
20
20
|
},
|
|
21
21
|
settings: {
|
|
22
|
-
'import/resolver': {
|
|
22
|
+
'import-x/resolver': {
|
|
23
23
|
node: {
|
|
24
24
|
extensions: [
|
|
25
25
|
'.ts',
|
|
@@ -35,84 +35,84 @@ const importRules = {
|
|
|
35
35
|
|
|
36
36
|
// ensure imports point to files/modules that can be resolved
|
|
37
37
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
|
|
38
|
-
'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
|
|
38
|
+
'import-x/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
|
|
39
39
|
|
|
40
40
|
// ensure named imports coupled with named exports
|
|
41
41
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
|
|
42
|
-
'import/named': 'error',
|
|
42
|
+
'import-x/named': 'error',
|
|
43
43
|
|
|
44
44
|
// ensure default import coupled with default export
|
|
45
45
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
|
|
46
|
-
'import/default': 'off',
|
|
46
|
+
'import-x/default': 'off',
|
|
47
47
|
|
|
48
48
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/namespace.md
|
|
49
|
-
'import/namespace': 'off',
|
|
49
|
+
'import-x/namespace': 'off',
|
|
50
50
|
|
|
51
51
|
// Helpful warnings:
|
|
52
52
|
|
|
53
53
|
// disallow invalid exports, e.g. multiple defaults
|
|
54
54
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/export.md
|
|
55
|
-
'import/export': 'error',
|
|
55
|
+
'import-x/export': 'error',
|
|
56
56
|
|
|
57
57
|
// do not allow a default import name to match a named export
|
|
58
58
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
|
|
59
|
-
'import/no-named-as-default': 'error',
|
|
59
|
+
'import-x/no-named-as-default': 'error',
|
|
60
60
|
|
|
61
61
|
// warn on accessing default export property names that are also named exports
|
|
62
62
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
|
|
63
|
-
'import/no-named-as-default-member': 'error',
|
|
63
|
+
'import-x/no-named-as-default-member': 'error',
|
|
64
64
|
|
|
65
65
|
// disallow use of jsdoc-marked-deprecated imports
|
|
66
66
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
|
|
67
|
-
'import/no-deprecated': 'off',
|
|
67
|
+
'import-x/no-deprecated': 'off',
|
|
68
68
|
|
|
69
69
|
// Forbid the use of extraneous packages
|
|
70
70
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
71
71
|
// paths are treated both as absolute paths, and relative to process.cwd()
|
|
72
|
-
'import/no-extraneous-dependencies': ['error'],
|
|
72
|
+
'import-x/no-extraneous-dependencies': ['error'],
|
|
73
73
|
|
|
74
74
|
// Forbid mutable exports
|
|
75
75
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
|
|
76
|
-
'import/no-mutable-exports': 'error',
|
|
76
|
+
'import-x/no-mutable-exports': 'error',
|
|
77
77
|
|
|
78
78
|
// Module systems:
|
|
79
79
|
|
|
80
80
|
// disallow require()
|
|
81
81
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
|
|
82
|
-
'import/no-commonjs': 'off',
|
|
82
|
+
'import-x/no-commonjs': 'off',
|
|
83
83
|
|
|
84
84
|
// disallow AMD require/define
|
|
85
85
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
|
|
86
|
-
'import/no-amd': 'error',
|
|
86
|
+
'import-x/no-amd': 'error',
|
|
87
87
|
|
|
88
88
|
// No Node.js builtin modules
|
|
89
89
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
|
|
90
90
|
// TODO: enable?
|
|
91
|
-
'import/no-nodejs-modules': 'off',
|
|
91
|
+
'import-x/no-nodejs-modules': 'off',
|
|
92
92
|
|
|
93
93
|
// Style guide:
|
|
94
94
|
|
|
95
95
|
// disallow non-import statements appearing before import statements
|
|
96
96
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md
|
|
97
|
-
'import/first': 'error',
|
|
97
|
+
'import-x/first': 'error',
|
|
98
98
|
|
|
99
99
|
// disallow non-import statements appearing before import statements
|
|
100
100
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md
|
|
101
101
|
// deprecated: use `import/first`
|
|
102
|
-
'import/imports-first': 'off',
|
|
102
|
+
'import-x/imports-first': 'off',
|
|
103
103
|
|
|
104
104
|
// disallow duplicate imports
|
|
105
105
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
106
|
-
'import/no-duplicates': 'error',
|
|
106
|
+
'import-x/no-duplicates': 'error',
|
|
107
107
|
|
|
108
108
|
// disallow namespace imports
|
|
109
109
|
// TODO: enable?
|
|
110
110
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
|
|
111
|
-
'import/no-namespace': 'off',
|
|
111
|
+
'import-x/no-namespace': 'off',
|
|
112
112
|
|
|
113
113
|
// Ensure consistent use of file extension within the import path
|
|
114
114
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
|
|
115
|
-
'import/extensions': [
|
|
115
|
+
'import-x/extensions': [
|
|
116
116
|
'error',
|
|
117
117
|
'ignorePackages',
|
|
118
118
|
{
|
|
@@ -126,35 +126,35 @@ const importRules = {
|
|
|
126
126
|
// ensure absolute imports are above relative imports and that unassigned imports are ignored
|
|
127
127
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
|
|
128
128
|
// TODO: enforce a stricter convention in module import order?
|
|
129
|
-
'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }],
|
|
129
|
+
'import-x/order': ['error', { groups: [['builtin', 'external', 'internal']] }],
|
|
130
130
|
|
|
131
131
|
// Require a newline after the last import/require in a group
|
|
132
132
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
|
|
133
|
-
'import/newline-after-import': 'error',
|
|
133
|
+
'import-x/newline-after-import': 'error',
|
|
134
134
|
|
|
135
135
|
// Require modules with a single export to use a default export
|
|
136
136
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
|
|
137
|
-
'import/prefer-default-export': 'off',
|
|
137
|
+
'import-x/prefer-default-export': 'off',
|
|
138
138
|
|
|
139
139
|
// Restrict which files can be imported in a given folder
|
|
140
140
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
|
|
141
|
-
'import/no-restricted-paths': 'off',
|
|
141
|
+
'import-x/no-restricted-paths': 'off',
|
|
142
142
|
|
|
143
143
|
// Forbid modules to have too many dependencies
|
|
144
144
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
|
|
145
|
-
'import/max-dependencies': ['off', { max: 10 }],
|
|
145
|
+
'import-x/max-dependencies': ['off', { max: 10 }],
|
|
146
146
|
|
|
147
147
|
// Forbid import of modules using absolute paths
|
|
148
148
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
|
|
149
|
-
'import/no-absolute-path': 'error',
|
|
149
|
+
'import-x/no-absolute-path': 'error',
|
|
150
150
|
|
|
151
151
|
// Forbid require() calls with expressions
|
|
152
152
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
|
|
153
|
-
'import/no-dynamic-require': 'error',
|
|
153
|
+
'import-x/no-dynamic-require': 'error',
|
|
154
154
|
|
|
155
155
|
// prevent importing the submodules of other modules
|
|
156
156
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
|
|
157
|
-
'import/no-internal-modules': ['off', {
|
|
157
|
+
'import-x/no-internal-modules': ['off', {
|
|
158
158
|
allow: [],
|
|
159
159
|
}],
|
|
160
160
|
|
|
@@ -163,24 +163,24 @@ const importRules = {
|
|
|
163
163
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/unambiguous.md
|
|
164
164
|
// this should not be enabled until this proposal has at least been *presented* to TC39.
|
|
165
165
|
// At the moment, it's not a thing.
|
|
166
|
-
'import/unambiguous': 'off',
|
|
166
|
+
'import-x/unambiguous': 'off',
|
|
167
167
|
|
|
168
168
|
// Forbid Webpack loader syntax in imports
|
|
169
169
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
170
|
-
'import/no-webpack-loader-syntax': 'error',
|
|
170
|
+
'import-x/no-webpack-loader-syntax': 'error',
|
|
171
171
|
|
|
172
172
|
// Prevent unassigned imports
|
|
173
173
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
|
|
174
174
|
// importing for side effects is perfectly acceptable, if you need side effects.
|
|
175
|
-
'import/no-unassigned-import': 'off',
|
|
175
|
+
'import-x/no-unassigned-import': 'off',
|
|
176
176
|
|
|
177
177
|
// Prevent importing the default as if it were named
|
|
178
178
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
|
|
179
|
-
'import/no-named-default': 'error',
|
|
179
|
+
'import-x/no-named-default': 'error',
|
|
180
180
|
|
|
181
181
|
// Reports if a module's default export is unnamed
|
|
182
182
|
// https://github.com/benmosher/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
|
|
183
|
-
'import/no-anonymous-default-export': ['off', {
|
|
183
|
+
'import-x/no-anonymous-default-export': ['off', {
|
|
184
184
|
allowArray: false,
|
|
185
185
|
allowArrowFunction: false,
|
|
186
186
|
allowAnonymousClass: false,
|
|
@@ -192,49 +192,49 @@ const importRules = {
|
|
|
192
192
|
// This rule enforces that all exports are declared at the bottom of the file.
|
|
193
193
|
// https://github.com/benmosher/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
|
|
194
194
|
// TODO: enable?
|
|
195
|
-
'import/exports-last': 'off',
|
|
195
|
+
'import-x/exports-last': 'off',
|
|
196
196
|
|
|
197
197
|
// Reports when named exports are not grouped together in a single export declaration
|
|
198
198
|
// or when multiple assignments to CommonJS module.exports or exports object are present
|
|
199
199
|
// in a single file.
|
|
200
200
|
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
|
|
201
|
-
'import/group-exports': 'off',
|
|
201
|
+
'import-x/group-exports': 'off',
|
|
202
202
|
|
|
203
203
|
// forbid default exports. this is a terrible rule, do not use it.
|
|
204
204
|
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
|
|
205
|
-
'import/no-default-export': 'off',
|
|
205
|
+
'import-x/no-default-export': 'off',
|
|
206
206
|
|
|
207
207
|
// Prohibit named exports. this is a terrible rule, do not use it.
|
|
208
208
|
// https://github.com/benmosher/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
|
|
209
|
-
'import/no-named-export': 'off',
|
|
209
|
+
'import-x/no-named-export': 'off',
|
|
210
210
|
|
|
211
211
|
// Forbid a module from importing itself
|
|
212
212
|
// https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
|
|
213
|
-
'import/no-self-import': 'error',
|
|
213
|
+
'import-x/no-self-import': 'error',
|
|
214
214
|
|
|
215
215
|
// Forbid cyclical dependencies between modules
|
|
216
216
|
// https://github.com/benmosher/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
|
|
217
|
-
'import/no-cycle': ['error', { maxDepth: Infinity }],
|
|
217
|
+
'import-x/no-cycle': ['error', { maxDepth: Infinity }],
|
|
218
218
|
|
|
219
219
|
// Ensures that there are no useless path segments
|
|
220
220
|
// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
|
|
221
|
-
'import/no-useless-path-segments': ['error', { commonjs: true }],
|
|
221
|
+
'import-x/no-useless-path-segments': ['error', { commonjs: true }],
|
|
222
222
|
|
|
223
223
|
// dynamic imports require a leading comment with a webpackChunkName
|
|
224
224
|
// https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
|
|
225
|
-
'import/dynamic-import-chunkname': ['off', {
|
|
225
|
+
'import-x/dynamic-import-chunkname': ['off', {
|
|
226
226
|
importFunctions: [],
|
|
227
227
|
webpackChunknameFormat: '[0-9a-zA-Z-_/.]+',
|
|
228
228
|
}],
|
|
229
229
|
|
|
230
230
|
// Use this rule to prevent imports to folders in relative parent paths.
|
|
231
231
|
// https://github.com/benmosher/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
|
|
232
|
-
'import/no-relative-parent-imports': 'off',
|
|
232
|
+
'import-x/no-relative-parent-imports': 'off',
|
|
233
233
|
|
|
234
234
|
// Reports modules without any exports, or with unused exports
|
|
235
235
|
// https://github.com/benmosher/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
|
|
236
236
|
// TODO: enable, semver-major
|
|
237
|
-
'import/no-unused-modules': ['off', {
|
|
237
|
+
'import-x/no-unused-modules': ['off', {
|
|
238
238
|
ignoreExports: [],
|
|
239
239
|
missingExports: true,
|
|
240
240
|
unusedExports: true,
|
|
@@ -3,10 +3,15 @@ import tsParser from '@typescript-eslint/parser';
|
|
|
3
3
|
import typeScriptSettings from './settings/typescript.mjs';
|
|
4
4
|
import allRules from './rules/all.mjs';
|
|
5
5
|
import { deepMerge } from '../../deepMerge.mjs';
|
|
6
|
+
import { importX } from 'eslint-plugin-import-x';
|
|
6
7
|
|
|
7
8
|
/** @type {import('eslint').Linter.Config} */
|
|
8
9
|
|
|
9
10
|
export const index = deepMerge(
|
|
11
|
+
{
|
|
12
|
+
settings: importX.flatConfigs.typescript.settings,
|
|
13
|
+
rules: importX.flatConfigs.typescript.rules,
|
|
14
|
+
},
|
|
10
15
|
{
|
|
11
16
|
files: ['**/*.{ts,tsx}'],
|
|
12
17
|
settings: typeScriptSettings.settings,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innovixx/eslint-config",
|
|
3
|
-
"version": "5.0.0
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"main": "config/index.mjs",
|
|
5
5
|
"repository": "git@github.com:innovixx/eslint-config.git",
|
|
6
6
|
"description": "Opinionated ESLint config for JavaScript developers",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
|
25
25
|
"@typescript-eslint/parser": "^8.72.1",
|
|
26
26
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
27
|
-
"eslint-plugin-import": "^
|
|
27
|
+
"eslint-plugin-import-x": "^4.18.0",
|
|
28
28
|
"eslint-plugin-jest": "^29.17.0",
|
|
29
29
|
"eslint-plugin-jest-dom": "^5.10.1",
|
|
30
30
|
"eslint-plugin-jsx-a11y-x": "^0.2.0",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@types/react-dom": "^19.3.0",
|
|
47
47
|
"eslint": "10.14.0",
|
|
48
48
|
"graphql": "^16",
|
|
49
|
+
"react": "^19.3.1",
|
|
49
50
|
"typescript": "6.0.3"
|
|
50
51
|
}
|
|
51
52
|
}
|