@mrpalmer/eslint-config 2.0.0 → 2.1.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.
- package/CHANGELOG.md +13 -0
- package/configs/base.js +42 -38
- package/configs/typescript.js +13 -4
- package/package.json +4 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @mrpalmer/eslint-config
|
|
2
|
+
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 63cec80: - Replace `eslint-plugin-import` with `eslint-plugin-import-x`
|
|
8
|
+
- Add `@mrpalmer/eslint-plugin` to default config
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [1e5fa18]
|
|
13
|
+
- @mrpalmer/eslint-plugin@1.0.0
|
package/configs/base.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import eslint from '@eslint/js'
|
|
2
|
-
import
|
|
2
|
+
import mrpalmerPlugin from '@mrpalmer/eslint-plugin'
|
|
3
|
+
import pluginImport from 'eslint-plugin-import-x'
|
|
3
4
|
import { config } from 'typescript-eslint'
|
|
4
5
|
|
|
5
6
|
export default config(
|
|
@@ -7,6 +8,7 @@ export default config(
|
|
|
7
8
|
name: 'eslint/recommended',
|
|
8
9
|
...eslint.configs.recommended,
|
|
9
10
|
},
|
|
11
|
+
mrpalmerPlugin.configs.recommended,
|
|
10
12
|
{
|
|
11
13
|
name: 'mrpalmer/base',
|
|
12
14
|
|
|
@@ -186,48 +188,50 @@ export default config(
|
|
|
186
188
|
{
|
|
187
189
|
name: 'mrpalmer/import',
|
|
188
190
|
rules: {
|
|
189
|
-
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
|
|
190
|
-
'import/dynamic-import-chunkname': 'off',
|
|
191
|
-
'import/exports-last': 'off',
|
|
192
|
-
'import/extensions': 'off',
|
|
193
|
-
'import/first': 'error',
|
|
194
|
-
'import/group-exports': 'off',
|
|
195
|
-
'import/max-dependencies': 'off',
|
|
196
|
-
'import/newline-after-import': 'off',
|
|
197
|
-
'import/no-absolute-path': 'error',
|
|
198
|
-
'import/no-amd': 'error',
|
|
199
|
-
'import/no-anonymous-default-export': [
|
|
191
|
+
'import-x/consistent-type-specifier-style': ['error', 'prefer-inline'],
|
|
192
|
+
'import-x/dynamic-import-chunkname': 'off',
|
|
193
|
+
'import-x/exports-last': 'off',
|
|
194
|
+
'import-x/extensions': 'off',
|
|
195
|
+
'import-x/first': 'error',
|
|
196
|
+
'import-x/group-exports': 'off',
|
|
197
|
+
'import-x/max-dependencies': 'off',
|
|
198
|
+
'import-x/newline-after-import': 'off',
|
|
199
|
+
'import-x/no-absolute-path': 'error',
|
|
200
|
+
'import-x/no-amd': 'error',
|
|
201
|
+
'import-x/no-anonymous-default-export': [
|
|
200
202
|
'error',
|
|
201
203
|
{ allowArray: true, allowObject: true },
|
|
202
204
|
],
|
|
203
|
-
'import/no-commonjs': 'off',
|
|
204
|
-
'import/no-cycle': 'off',
|
|
205
|
-
'import/no-default-export': 'off',
|
|
206
|
-
'import/no-deprecated': 'warn',
|
|
207
|
-
'import/no-dynamic-require': 'off',
|
|
208
|
-
'import/no-empty-named-blocks': 'warn',
|
|
209
|
-
'import/no-extraneous-dependencies': 'error',
|
|
210
|
-
'import/no-import-module-exports': 'error',
|
|
211
|
-
'import/no-internal-modules': 'off',
|
|
212
|
-
'import/no-mutable-exports': 'error',
|
|
213
|
-
'import/no-named-default': 'error',
|
|
214
|
-
'import/no-named-export': 'off',
|
|
215
|
-
'import/no-namespace': 'off',
|
|
216
|
-
'import/no-nodejs-modules': 'off',
|
|
217
|
-
'import/no-relative-packages': 'warn',
|
|
218
|
-
'import/no-relative-parent-imports': 'off',
|
|
219
|
-
'import/no-
|
|
220
|
-
'import/no-
|
|
221
|
-
'import/no-
|
|
222
|
-
'import/no-
|
|
223
|
-
'import/no-
|
|
224
|
-
'import/no-
|
|
225
|
-
'import/
|
|
226
|
-
'import/
|
|
227
|
-
'import/
|
|
205
|
+
'import-x/no-commonjs': 'off',
|
|
206
|
+
'import-x/no-cycle': 'off',
|
|
207
|
+
'import-x/no-default-export': 'off',
|
|
208
|
+
'import-x/no-deprecated': 'warn',
|
|
209
|
+
'import-x/no-dynamic-require': 'off',
|
|
210
|
+
'import-x/no-empty-named-blocks': 'warn',
|
|
211
|
+
'import-x/no-extraneous-dependencies': 'error',
|
|
212
|
+
'import-x/no-import-module-exports': 'error',
|
|
213
|
+
'import-x/no-internal-modules': 'off',
|
|
214
|
+
'import-x/no-mutable-exports': 'error',
|
|
215
|
+
'import-x/no-named-default': 'error',
|
|
216
|
+
'import-x/no-named-export': 'off',
|
|
217
|
+
'import-x/no-namespace': 'off',
|
|
218
|
+
'import-x/no-nodejs-modules': 'off',
|
|
219
|
+
'import-x/no-relative-packages': 'warn',
|
|
220
|
+
'import-x/no-relative-parent-imports': 'off',
|
|
221
|
+
'import-x/no-rename-default': 'off',
|
|
222
|
+
'import-x/no-restricted-paths': 'off',
|
|
223
|
+
'import-x/no-self-import': 'error',
|
|
224
|
+
'import-x/no-unassigned-import': 'off',
|
|
225
|
+
'import-x/no-unused-modules': 'off',
|
|
226
|
+
'import-x/no-useless-path-segments': 'error',
|
|
227
|
+
'import-x/no-webpack-loader-syntax': 'error',
|
|
228
|
+
'import-x/order': 'off',
|
|
229
|
+
'import-x/prefer-default-export': 'off',
|
|
230
|
+
'import-x/unambiguous': 'off',
|
|
228
231
|
},
|
|
229
232
|
settings: {
|
|
230
|
-
'import/ignore': ['node_modules', '.json$', '.(scss|less|css|styl)$'],
|
|
233
|
+
'import-x/ignore': ['node_modules', '.json$', '.(scss|less|css|styl)$'],
|
|
234
|
+
'import-x/resolver-x': [pluginImport.createNodeResolver()],
|
|
231
235
|
},
|
|
232
236
|
}
|
|
233
237
|
)
|
package/configs/typescript.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'
|
|
2
|
+
import pluginImport from 'eslint-plugin-import-x'
|
|
2
3
|
import tseslint from 'typescript-eslint'
|
|
3
4
|
|
|
4
5
|
// typescript-eslint still enables a couple of base rules that are deprecated in v9
|
|
@@ -10,11 +11,13 @@ function disableDeprecatedRules(config) {
|
|
|
10
11
|
tseslint.configs.strictTypeChecked.forEach(disableDeprecatedRules)
|
|
11
12
|
tseslint.configs.stylisticTypeChecked.forEach(disableDeprecatedRules)
|
|
12
13
|
|
|
14
|
+
delete pluginImport.flatConfigs.typescript.settings['import-x/resolver']
|
|
15
|
+
|
|
13
16
|
export default tseslint.config({
|
|
14
17
|
extends: [
|
|
15
18
|
...tseslint.configs.strictTypeChecked,
|
|
16
19
|
...tseslint.configs.stylisticTypeChecked,
|
|
17
|
-
pluginImport.
|
|
20
|
+
pluginImport.flatConfigs.typescript,
|
|
18
21
|
],
|
|
19
22
|
files: ['**/*.ts?(x)'],
|
|
20
23
|
languageOptions: {
|
|
@@ -24,8 +27,8 @@ export default tseslint.config({
|
|
|
24
27
|
},
|
|
25
28
|
name: 'mrpalmer/typescript',
|
|
26
29
|
rules: {
|
|
27
|
-
'import/consistent-type-specifier-style': 'off',
|
|
28
|
-
'import/no-unresolved': 'off', // ts(2307)
|
|
30
|
+
'import-x/consistent-type-specifier-style': 'off',
|
|
31
|
+
'import-x/no-unresolved': 'off', // ts(2307)
|
|
29
32
|
|
|
30
33
|
'constructor-super': 'off', // ts(2335) & ts(2377)
|
|
31
34
|
'getter-return': 'off', // ts(2378)
|
|
@@ -147,4 +150,10 @@ export default tseslint.config({
|
|
|
147
150
|
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
148
151
|
'@typescript-eslint/typedef': 'off',
|
|
149
152
|
},
|
|
153
|
+
settings: {
|
|
154
|
+
'import-x/resolver-next': [
|
|
155
|
+
createTypeScriptImportResolver(),
|
|
156
|
+
pluginImport.createNodeResolver(),
|
|
157
|
+
],
|
|
158
|
+
},
|
|
150
159
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrpalmer/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Mike Palmer's personal ESLint rules",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,8 +16,10 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@eslint/js": "^9.20.0",
|
|
19
|
+
"@mrpalmer/eslint-plugin": "^1.0.0",
|
|
19
20
|
"@types/eslint__js": "^8.42.3",
|
|
20
|
-
"eslint-
|
|
21
|
+
"eslint-import-resolver-typescript": "^4.3.4",
|
|
22
|
+
"eslint-plugin-import-x": "^4.11.1",
|
|
21
23
|
"eslint-plugin-jest": "^28.11.0",
|
|
22
24
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
23
25
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|