@forsakringskassan/eslint-config 14.2.0 → 15.0.3
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/index.mjs +35 -36
- package/package.json +7 -8
package/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fileURLToPath } from "node:url";
|
|
2
1
|
import js from "@eslint/js";
|
|
3
2
|
import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
4
3
|
import prettierConfig from "eslint-config-prettier";
|
|
5
|
-
import
|
|
4
|
+
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
|
5
|
+
import { createNodeResolver, importX } from "eslint-plugin-import-x";
|
|
6
6
|
import prettierPlugin from "eslint-plugin-prettier";
|
|
7
7
|
import sonarjsPlugin from "eslint-plugin-sonarjs";
|
|
8
8
|
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
@@ -57,20 +57,16 @@ export default [
|
|
|
57
57
|
defineConfig({
|
|
58
58
|
plugins: {
|
|
59
59
|
prettier: prettierPlugin,
|
|
60
|
-
import:
|
|
60
|
+
"import-x": importX,
|
|
61
61
|
"@eslint-community/eslint-comments": eslintCommentsPlugin,
|
|
62
62
|
sonarjs: sonarjsPlugin,
|
|
63
63
|
unicorn: eslintPluginUnicorn,
|
|
64
64
|
},
|
|
65
65
|
settings: {
|
|
66
|
-
"import/resolver":
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
[fileURLToPath(
|
|
71
|
-
import.meta.resolve("eslint-import-resolver-typescript"),
|
|
72
|
-
)]: true,
|
|
73
|
-
},
|
|
66
|
+
"import-x/resolver-next": [
|
|
67
|
+
createNodeResolver(),
|
|
68
|
+
createTypeScriptImportResolver(),
|
|
69
|
+
],
|
|
74
70
|
},
|
|
75
71
|
rules: {
|
|
76
72
|
...filterRules(prettierConfig.rules, (rule) => {
|
|
@@ -95,7 +91,7 @@ export default [
|
|
|
95
91
|
return true;
|
|
96
92
|
}),
|
|
97
93
|
...prettierPlugin.configs.recommended.rules,
|
|
98
|
-
...
|
|
94
|
+
...importX.flatConfigs.errors.rules,
|
|
99
95
|
...eslintCommentsPlugin.configs.recommended.rules,
|
|
100
96
|
...sonarjsPlugin.configs.recommended.rules,
|
|
101
97
|
},
|
|
@@ -365,8 +361,8 @@ export default [
|
|
|
365
361
|
"no-debugger": "warn",
|
|
366
362
|
"prettier/prettier": "warn",
|
|
367
363
|
|
|
368
|
-
"import/default": "off",
|
|
369
|
-
"import/extensions": [
|
|
364
|
+
"import-x/default": "off",
|
|
365
|
+
"import-x/extensions": [
|
|
370
366
|
"error",
|
|
371
367
|
"never",
|
|
372
368
|
{
|
|
@@ -374,25 +370,25 @@ export default [
|
|
|
374
370
|
json: "always",
|
|
375
371
|
},
|
|
376
372
|
],
|
|
377
|
-
"import/newline-after-import": "error",
|
|
378
|
-
"import/no-absolute-path": "error",
|
|
379
|
-
"import/no-deprecated": "error",
|
|
380
|
-
"import/no-duplicates": "error",
|
|
381
|
-
"import/no-dynamic-require": "error",
|
|
382
|
-
"import/no-extraneous-dependencies": "error",
|
|
383
|
-
"import/no-mutable-exports": "error",
|
|
384
|
-
"import/no-named-as-default": "error",
|
|
385
|
-
"import/no-named-as-default-member": "error",
|
|
386
|
-
"import/no-named-default": "error",
|
|
387
|
-
"import/no-unresolved": [
|
|
373
|
+
"import-x/newline-after-import": "error",
|
|
374
|
+
"import-x/no-absolute-path": "error",
|
|
375
|
+
"import-x/no-deprecated": "error",
|
|
376
|
+
"import-x/no-duplicates": "error",
|
|
377
|
+
"import-x/no-dynamic-require": "error",
|
|
378
|
+
"import-x/no-extraneous-dependencies": "error",
|
|
379
|
+
"import-x/no-mutable-exports": "error",
|
|
380
|
+
"import-x/no-named-as-default": "error",
|
|
381
|
+
"import-x/no-named-as-default-member": "error",
|
|
382
|
+
"import-x/no-named-default": "error",
|
|
383
|
+
"import-x/no-unresolved": [
|
|
388
384
|
"error",
|
|
389
385
|
{
|
|
390
386
|
/* neither of the resolvers will handle @ alias */
|
|
391
387
|
ignore: ["^@"],
|
|
392
388
|
},
|
|
393
389
|
],
|
|
394
|
-
"import/no-useless-path-segments": "error",
|
|
395
|
-
"import/order": [
|
|
390
|
+
"import-x/no-useless-path-segments": "error",
|
|
391
|
+
"import-x/order": [
|
|
396
392
|
"error",
|
|
397
393
|
{
|
|
398
394
|
pathGroups: [
|
|
@@ -455,8 +451,11 @@ export default [
|
|
|
455
451
|
name: "@forsakringskassan/eslint-config/esm",
|
|
456
452
|
files: ["**/*.mjs"],
|
|
457
453
|
rules: {
|
|
458
|
-
|
|
459
|
-
|
|
454
|
+
"import-x/extensions": [
|
|
455
|
+
"error",
|
|
456
|
+
"always",
|
|
457
|
+
{ ignorePackages: true },
|
|
458
|
+
],
|
|
460
459
|
},
|
|
461
460
|
}),
|
|
462
461
|
|
|
@@ -480,7 +479,7 @@ export default [
|
|
|
480
479
|
name: "@forsakringskassan/eslint-config/legacy-dts",
|
|
481
480
|
files: ["*.d.ts", "packages/*/*.d.ts"],
|
|
482
481
|
rules: {
|
|
483
|
-
"import/no-unresolved": "off",
|
|
482
|
+
"import-x/no-unresolved": "off",
|
|
484
483
|
},
|
|
485
484
|
}),
|
|
486
485
|
|
|
@@ -489,9 +488,9 @@ export default [
|
|
|
489
488
|
files: ["bin/*.{js,cjs,mjs}"],
|
|
490
489
|
rules: {
|
|
491
490
|
/* esm requires the usage of extension in this context */
|
|
492
|
-
"import/extensions": "off",
|
|
491
|
+
"import-x/extensions": "off",
|
|
493
492
|
/* needed to run eslint before sources are compiled to dist folder */
|
|
494
|
-
"import/no-unresolved": "off",
|
|
493
|
+
"import-x/no-unresolved": "off",
|
|
495
494
|
},
|
|
496
495
|
}),
|
|
497
496
|
|
|
@@ -501,8 +500,8 @@ export default [
|
|
|
501
500
|
name: "@forsakringskassan/eslint-config/cypress-pageobjects",
|
|
502
501
|
files: ["cypress/**/*.[jt]s"],
|
|
503
502
|
rules: {
|
|
504
|
-
"import/no-extraneous-dependencies": "off",
|
|
505
|
-
"import/order": "off",
|
|
503
|
+
"import-x/no-extraneous-dependencies": "off",
|
|
504
|
+
"import-x/order": "off",
|
|
506
505
|
},
|
|
507
506
|
},
|
|
508
507
|
];
|
|
@@ -535,8 +534,8 @@ const defaultExampleConfig = {
|
|
|
535
534
|
"@eslint-community/eslint-comments/require-description": "off",
|
|
536
535
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
537
536
|
"@typescript-eslint/no-unused-vars": "off",
|
|
538
|
-
"import/no-duplicates": "off",
|
|
539
|
-
"import/no-extraneous-dependencies": "off",
|
|
537
|
+
"import-x/no-duplicates": "off",
|
|
538
|
+
"import-x/no-extraneous-dependencies": "off",
|
|
540
539
|
"no-console": "off",
|
|
541
540
|
"no-unused-vars": "off",
|
|
542
541
|
"sonarjs/no-dead-store": "off",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.3",
|
|
4
4
|
"description": "Försäkringskassans eslint shareable config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint"
|
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
"index.d.mts"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@eslint-community/eslint-plugin-eslint-comments": "4.7.
|
|
28
|
-
"@eslint/js": "
|
|
29
|
-
"eslint": "
|
|
27
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.7.2",
|
|
28
|
+
"@eslint/js": "10.0.1",
|
|
29
|
+
"eslint": "10.4.0",
|
|
30
30
|
"eslint-config-prettier": "10.1.8",
|
|
31
|
-
"eslint-import-resolver-node": "0.4.0",
|
|
32
31
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
33
|
-
"eslint-plugin-import": "
|
|
32
|
+
"eslint-plugin-import-x": "4.16.2",
|
|
34
33
|
"eslint-plugin-prettier": "5.5.5",
|
|
35
34
|
"eslint-plugin-sonarjs": "4.0.3",
|
|
36
35
|
"eslint-plugin-unicorn": "64.0.0",
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
"prettier": "^2.0.0 || ^3.0.0"
|
|
41
40
|
},
|
|
42
41
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
42
|
+
"node": "^22.13 || >= 24"
|
|
44
43
|
},
|
|
45
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "b66c66ec47fcd7c52c2dc7feed5ae0540d422091"
|
|
46
45
|
}
|