@forsakringskassan/eslint-config 12.2.2 → 13.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.
- package/eslint.js +1 -0
- package/{flat.mjs → index.mjs} +5 -5
- package/package.json +10 -13
- package/index.cjs +0 -130
- package/patch/modern-module-resolution.js +0 -1
- /package/{flat.d.mts → index.d.mts} +0 -0
package/eslint.js
CHANGED
|
@@ -6,6 +6,7 @@ const { spawn } = require("child_process");
|
|
|
6
6
|
const pkgPath = path.dirname(require.resolve("eslint/package.json"));
|
|
7
7
|
const binary = path.join(pkgPath, "bin/eslint");
|
|
8
8
|
|
|
9
|
+
/* eslint-disable-next-line sonarjs/no-os-command-from-path -- want to run it from path */
|
|
9
10
|
spawn("node", [binary, ...process.argv.slice(2)], {
|
|
10
11
|
stdio: "inherit",
|
|
11
12
|
}).on("exit", (code) => {
|
package/{flat.mjs → index.mjs}
RENAMED
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from "node:url";
|
|
|
2
2
|
import js from "@eslint/js";
|
|
3
3
|
import prettierConfig from "eslint-config-prettier";
|
|
4
4
|
import importPlugin from "eslint-plugin-import";
|
|
5
|
-
import eslintCommentsPlugin from "eslint-plugin-eslint-comments";
|
|
5
|
+
import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
6
6
|
import prettierPlugin from "eslint-plugin-prettier";
|
|
7
7
|
import sonarjsPlugin from "eslint-plugin-sonarjs";
|
|
8
8
|
import globals from "globals";
|
|
@@ -30,7 +30,7 @@ export default [
|
|
|
30
30
|
plugins: {
|
|
31
31
|
prettier: prettierPlugin,
|
|
32
32
|
import: importPlugin,
|
|
33
|
-
"eslint-comments": eslintCommentsPlugin,
|
|
33
|
+
"@eslint-community/eslint-comments": eslintCommentsPlugin,
|
|
34
34
|
sonarjs: sonarjsPlugin,
|
|
35
35
|
},
|
|
36
36
|
settings: {
|
|
@@ -78,11 +78,11 @@ export default [
|
|
|
78
78
|
radix: "error",
|
|
79
79
|
yoda: "error",
|
|
80
80
|
|
|
81
|
-
"eslint-comments/disable-enable-pair": [
|
|
81
|
+
"@eslint-community/eslint-comments/disable-enable-pair": [
|
|
82
82
|
"error",
|
|
83
83
|
{ allowWholeFile: true },
|
|
84
84
|
],
|
|
85
|
-
"eslint-comments/require-description": [
|
|
85
|
+
"@eslint-community/eslint-comments/require-description": [
|
|
86
86
|
"error",
|
|
87
87
|
{
|
|
88
88
|
ignore: [
|
|
@@ -94,7 +94,7 @@ export default [
|
|
|
94
94
|
],
|
|
95
95
|
},
|
|
96
96
|
],
|
|
97
|
-
"eslint-comments/no-unused-disable": "error",
|
|
97
|
+
"@eslint-community/eslint-comments/no-unused-disable": "error",
|
|
98
98
|
|
|
99
99
|
/* Use eslint native complexity rule instead */
|
|
100
100
|
"sonarjs/cognitive-complexity": "off",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Försäkringskassans eslint shareable config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint"
|
|
@@ -14,35 +14,32 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"author": "Försäkringskassan",
|
|
17
|
-
"main": "index.
|
|
17
|
+
"main": "index.mjs",
|
|
18
18
|
"bin": {
|
|
19
19
|
"eslint": "eslint.js"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
|
-
"patch",
|
|
23
22
|
"eslint.js",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"index.cjs"
|
|
23
|
+
"index.mjs",
|
|
24
|
+
"index.d.mts"
|
|
27
25
|
],
|
|
28
26
|
"dependencies": {
|
|
27
|
+
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
|
|
29
28
|
"@eslint/js": "9.35.0",
|
|
30
|
-
"
|
|
31
|
-
"eslint": "8.57.1",
|
|
29
|
+
"eslint": "9.35.0",
|
|
32
30
|
"eslint-config-prettier": "10.1.8",
|
|
33
31
|
"eslint-import-resolver-node": "0.3.9",
|
|
34
32
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
35
|
-
"eslint-plugin-eslint-comments": "3.2.0",
|
|
36
33
|
"eslint-plugin-import": "2.32.0",
|
|
37
34
|
"eslint-plugin-prettier": "5.5.4",
|
|
38
|
-
"eslint-plugin-sonarjs": "
|
|
39
|
-
"globals": "
|
|
35
|
+
"eslint-plugin-sonarjs": "3.0.5",
|
|
36
|
+
"globals": "16.4.0"
|
|
40
37
|
},
|
|
41
38
|
"peerDependencies": {
|
|
42
39
|
"prettier": "^2.0.0 || ^3.0.0"
|
|
43
40
|
},
|
|
44
41
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
42
|
+
"node": ">= 22.0"
|
|
46
43
|
},
|
|
47
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "6e466e321dc87d4d3e525bbf1711e8ae9f6b8742"
|
|
48
45
|
}
|
package/index.cjs
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
"eslint:recommended",
|
|
4
|
-
"plugin:prettier/recommended",
|
|
5
|
-
"plugin:import/errors",
|
|
6
|
-
"plugin:eslint-comments/recommended",
|
|
7
|
-
"plugin:sonarjs/recommended-legacy",
|
|
8
|
-
],
|
|
9
|
-
|
|
10
|
-
env: {
|
|
11
|
-
es6: true,
|
|
12
|
-
node: true,
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
parserOptions: {
|
|
16
|
-
ecmaVersion: 2022,
|
|
17
|
-
sourceType: "module",
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
settings: {
|
|
21
|
-
"import/resolver": {
|
|
22
|
-
[require.resolve("eslint-import-resolver-node")]: true,
|
|
23
|
-
[require.resolve("eslint-import-resolver-typescript")]: true,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
rules: {
|
|
28
|
-
camelcase: "error",
|
|
29
|
-
complexity: ["error", 20],
|
|
30
|
-
"consistent-return": "error",
|
|
31
|
-
curly: "error",
|
|
32
|
-
eqeqeq: "error",
|
|
33
|
-
"max-depth": ["error", 3],
|
|
34
|
-
"max-params": ["error", { max: 5 }],
|
|
35
|
-
"no-eval": "error",
|
|
36
|
-
"no-implied-eval": "error",
|
|
37
|
-
"no-loop-func": "error",
|
|
38
|
-
"no-new": "error",
|
|
39
|
-
"no-new-func": "error",
|
|
40
|
-
"no-unreachable": "error",
|
|
41
|
-
"no-unused-vars": "error",
|
|
42
|
-
"no-var": "error",
|
|
43
|
-
"no-warning-comments": "error",
|
|
44
|
-
"prefer-const": "error",
|
|
45
|
-
"prefer-rest-params": "error",
|
|
46
|
-
"prefer-spread": "error",
|
|
47
|
-
"prefer-template": "error",
|
|
48
|
-
radix: "error",
|
|
49
|
-
yoda: "error",
|
|
50
|
-
|
|
51
|
-
"eslint-comments/disable-enable-pair": [
|
|
52
|
-
"error",
|
|
53
|
-
{ allowWholeFile: true },
|
|
54
|
-
],
|
|
55
|
-
"eslint-comments/require-description": [
|
|
56
|
-
"error",
|
|
57
|
-
{
|
|
58
|
-
ignore: [
|
|
59
|
-
"eslint-enable",
|
|
60
|
-
"eslint-env",
|
|
61
|
-
"exported",
|
|
62
|
-
"global",
|
|
63
|
-
"globals",
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
"eslint-comments/no-unused-disable": "error",
|
|
68
|
-
|
|
69
|
-
/* Use eslint native complexity rule instead */
|
|
70
|
-
"sonarjs/cognitive-complexity": "off",
|
|
71
|
-
|
|
72
|
-
/* Prefer to use multiple returns even for booleans (looks better and
|
|
73
|
-
* can yield performance increase), see example of this in
|
|
74
|
-
* "example.js". */
|
|
75
|
-
"sonarjs/prefer-single-boolean-return": "off",
|
|
76
|
-
|
|
77
|
-
/* This rule is deemed to provide more trouble than actual value.
|
|
78
|
-
* Especially because of the prevalence of translations, i.e., text
|
|
79
|
-
* keys. */
|
|
80
|
-
"sonarjs/no-duplicate-string": "off",
|
|
81
|
-
|
|
82
|
-
/* Lower some errors to warnings, these are allowed on local builds (to
|
|
83
|
-
* not prevent builds during development where code is unfinished and
|
|
84
|
-
* might contain debugging code) but is disallowed when building from
|
|
85
|
-
* Jenkins (via `--max-warnings 0`) */
|
|
86
|
-
"no-console": "warn",
|
|
87
|
-
"no-debugger": "warn",
|
|
88
|
-
"prettier/prettier": "warn",
|
|
89
|
-
|
|
90
|
-
"import/default": "off",
|
|
91
|
-
"import/extensions": [
|
|
92
|
-
"error",
|
|
93
|
-
"never",
|
|
94
|
-
{
|
|
95
|
-
css: "always",
|
|
96
|
-
json: "always",
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
"import/newline-after-import": "error",
|
|
100
|
-
"import/no-absolute-path": "error",
|
|
101
|
-
"import/no-deprecated": "error",
|
|
102
|
-
"import/no-duplicates": "error",
|
|
103
|
-
"import/no-dynamic-require": "error",
|
|
104
|
-
"import/no-extraneous-dependencies": "error",
|
|
105
|
-
"import/no-mutable-exports": "error",
|
|
106
|
-
"import/no-named-as-default": "error",
|
|
107
|
-
"import/no-named-as-default-member": "error",
|
|
108
|
-
"import/no-named-default": "error",
|
|
109
|
-
"import/no-unresolved": [
|
|
110
|
-
"error",
|
|
111
|
-
{
|
|
112
|
-
/* neither of the resolvers will handle @ alias */
|
|
113
|
-
ignore: ["^@"],
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
"import/no-useless-path-segments": "error",
|
|
117
|
-
"import/order": [
|
|
118
|
-
"error",
|
|
119
|
-
{
|
|
120
|
-
pathGroups: [
|
|
121
|
-
{
|
|
122
|
-
pattern: "@/**",
|
|
123
|
-
group: "parent",
|
|
124
|
-
position: "before",
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
},
|
|
130
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require("@rushstack/eslint-patch/modern-module-resolution");
|
|
File without changes
|