@forsakringskassan/eslint-config 11.9.13 → 12.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/flat.mjs +43 -0
- package/package.json +12 -7
- /package/{index.js → index.cjs} +0 -0
package/flat.mjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
4
|
+
import js from "@eslint/js";
|
|
5
|
+
import legacyConfig from "./index.cjs";
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const compat = new FlatCompat({
|
|
11
|
+
baseDirectory: __dirname,
|
|
12
|
+
resolvePluginsRelativeTo: __dirname,
|
|
13
|
+
recommendedConfig: js.configs.recommended,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const migrated = compat.config(legacyConfig);
|
|
17
|
+
|
|
18
|
+
for (const ruleset of migrated) {
|
|
19
|
+
if (
|
|
20
|
+
ruleset.languageOptions &&
|
|
21
|
+
typeof ruleset.languageOptions.ecmaVersion === "string"
|
|
22
|
+
) {
|
|
23
|
+
ruleset.languageOptions.ecmaVersion = parseInt(
|
|
24
|
+
ruleset.languageOptions.ecmaVersion,
|
|
25
|
+
10,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default [
|
|
31
|
+
...migrated,
|
|
32
|
+
{
|
|
33
|
+
/* ensure cjs and mjs files are linted too */
|
|
34
|
+
files: ["*.cjs", "*.mjs"],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
/* mjs requires file extension */
|
|
38
|
+
files: ["*.mjs"],
|
|
39
|
+
rules: {
|
|
40
|
+
"import/extensions": ["error", "always"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Försäkringskassans eslint shareable config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint"
|
|
@@ -14,30 +14,35 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"author": "Försäkringskassan",
|
|
17
|
+
"main": "index.cjs",
|
|
17
18
|
"bin": {
|
|
18
19
|
"eslint": "eslint.js"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"patch",
|
|
22
23
|
"eslint.js",
|
|
23
|
-
"
|
|
24
|
+
"flat.mjs",
|
|
25
|
+
"index.cjs"
|
|
24
26
|
],
|
|
25
27
|
"dependencies": {
|
|
26
|
-
"@
|
|
28
|
+
"@eslint/eslintrc": "3.3.1",
|
|
29
|
+
"@eslint/js": "9.30.1",
|
|
30
|
+
"@rushstack/eslint-patch": "1.12.0",
|
|
31
|
+
"deepmerge": "4.3.1",
|
|
27
32
|
"eslint": "8.57.1",
|
|
28
33
|
"eslint-config-prettier": "10.1.5",
|
|
29
34
|
"eslint-import-resolver-node": "0.3.9",
|
|
30
|
-
"eslint-import-resolver-typescript": "4.4.
|
|
35
|
+
"eslint-import-resolver-typescript": "4.4.4",
|
|
31
36
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
32
37
|
"eslint-plugin-import": "2.32.0",
|
|
33
|
-
"eslint-plugin-prettier": "5.5.
|
|
38
|
+
"eslint-plugin-prettier": "5.5.1",
|
|
34
39
|
"eslint-plugin-sonarjs": "1.0.4"
|
|
35
40
|
},
|
|
36
41
|
"peerDependencies": {
|
|
37
42
|
"prettier": "^2.0.0 || ^3.0.0"
|
|
38
43
|
},
|
|
39
44
|
"engines": {
|
|
40
|
-
"node": ">=
|
|
45
|
+
"node": ">= 20.19"
|
|
41
46
|
},
|
|
42
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "0c0dd283a6dfcbf61e3c91f70e4f78191aeaeffd"
|
|
43
48
|
}
|
/package/{index.js → index.cjs}
RENAMED
|
File without changes
|