@schoero/configs 0.0.0-beta.4 → 0.0.0-beta.5
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/imports.js +57 -76
- package/eslint/json.js +7 -9
- package/eslint/markdown.js +0 -5
- package/eslint/stylistic.js +0 -23
- package/eslint/typescript.js +5 -1
- package/eslint/yaml.js +7 -6
- package/package.json +1 -1
package/eslint/imports.js
CHANGED
|
@@ -3,97 +3,78 @@ import eslintPluginImportNewlines from "eslint-plugin-import-newlines";
|
|
|
3
3
|
import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
|
|
4
4
|
import eslintPluginUnusedImports from "eslint-plugin-unused-imports";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
/** @type { import("eslint").Linter.FlatConfig[] } */
|
|
7
|
+
export const imports = [
|
|
8
|
+
{
|
|
9
|
+
files: ["**/*.{js,jsx,cjs,mjs,ts,tsx}"],
|
|
10
|
+
plugins: {
|
|
11
|
+
"eslint-plugin-unused-imports": eslintPluginUnusedImports,
|
|
12
|
+
"eslint-plugin-import-newlines": eslintPluginImportNewlines,
|
|
13
|
+
"eslint-plugin-import": eslintPluginImport,
|
|
14
|
+
"eslint-plugin-simple-import-sort": eslintPluginSimpleImportSort
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
"eslint-plugin-unused-imports/no-unused-imports": "warn",
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
"eslint-plugin-import/first": "warn",
|
|
20
|
+
"eslint-plugin-import/newline-after-import": ["warn", { count: 2 }],
|
|
21
|
+
"eslint-plugin-import/no-duplicates": "warn",
|
|
22
|
+
"eslint-plugin-import/no-self-import": "warn",
|
|
23
|
+
"eslint-plugin-import/no-useless-path-segments": ["warn", { noUselessIndex: false }],
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
"eslint-plugin-simple-import-sort/imports": ["warn", {
|
|
23
|
-
groups: [
|
|
25
|
+
"eslint-plugin-import-newlines/enforce": ["warn", { "items": 6, "max-len": 119 }],
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
"eslint-plugin-simple-import-sort/exports": "warn",
|
|
28
|
+
"eslint-plugin-simple-import-sort/imports": [
|
|
29
|
+
"warn",
|
|
30
|
+
{
|
|
31
|
+
groups: [
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
// side effect imports
|
|
34
|
+
["^\\u0000"],
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
// node builtins
|
|
37
|
+
["^node:"],
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
["^@schoero"],
|
|
37
|
-
["^(?!node:)(.*):"],
|
|
39
|
+
// external packages
|
|
40
|
+
["^"],
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
// internal packages
|
|
43
|
+
["^@"],
|
|
44
|
+
["^@schoero"],
|
|
45
|
+
["^(?!node:)(.*):"],
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
// parent imports. Put `..` last
|
|
48
|
+
["^\\.\\.(?!/?.*\\u0000$)", "^\\.\\./?(?!.*\\u0000$)"],
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
// other relative imports. Put same-folder imports and `.` last
|
|
51
|
+
["^\\./(?=.*/)(?!/?.*\\u0000$)", "^\\.(?!/?.*\\u0000$)", "^\\./?(?!.*\\u0000$)"],
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
// style imports
|
|
54
|
+
["^.+\\.s?css$"],
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
// json imports
|
|
57
|
+
["^.+\\.jsonc?$"],
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
// type imports
|
|
60
|
+
["^node:(.*)\\u0000$"],
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
["^@schoero(.*)\\u0000$"],
|
|
60
|
-
["^(?!node:)(.*):(.*)\\u0000$"],
|
|
62
|
+
// types from external packages
|
|
63
|
+
["\\u0000$"],
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
// types from internal packages
|
|
66
|
+
["^@(.*)\\u0000$"],
|
|
67
|
+
["^@schoero(.*)\\u0000$"],
|
|
68
|
+
["^(?!node:)(.*):(.*)\\u0000$"],
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
]
|
|
68
|
-
}]
|
|
69
|
-
};
|
|
70
|
+
// types from parent imports. Put `..` last
|
|
71
|
+
["^\\.\\.(?=/?\\u0000$)", "^\\.\\./?\\u0000$"],
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"eslint-plugin-import-newlines": eslintPluginImportNewlines,
|
|
78
|
-
"eslint-plugin-import": eslintPluginImport,
|
|
79
|
-
"eslint-plugin-simple-import-sort": eslintPluginSimpleImportSort
|
|
80
|
-
},
|
|
81
|
-
rules: importRules
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
files: ["**/*.{ts,tsx}"],
|
|
85
|
-
languageOptions: {
|
|
86
|
-
parserOptions: {
|
|
87
|
-
project: "./tsconfig.json"
|
|
88
|
-
},
|
|
89
|
-
parser: eslintParserTypeScript
|
|
90
|
-
},
|
|
91
|
-
plugins: {
|
|
92
|
-
"eslint-plugin-unused-imports": eslintPluginUnusedImports,
|
|
93
|
-
"eslint-plugin-import-newlines": eslintPluginImportNewlines,
|
|
94
|
-
"eslint-plugin-import": eslintPluginImport,
|
|
95
|
-
"eslint-plugin-simple-import-sort": eslintPluginSimpleImportSort
|
|
96
|
-
},
|
|
97
|
-
rules: importRules
|
|
73
|
+
// types from other relative imports. Put same-folder imports and `.` last
|
|
74
|
+
["^\\./(?=.*\\u0000$)", "^\\.(?=/?\\u0000$)", "^\\./?\\u0000$"]
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
98
79
|
}
|
|
99
80
|
];
|
package/eslint/json.js
CHANGED
|
@@ -5,11 +5,15 @@ export const json = [
|
|
|
5
5
|
{
|
|
6
6
|
files: ["**/*.{json,jsonc,json5}"],
|
|
7
7
|
ignores: ["**/package-lock.json", "**/yarn.lock"],
|
|
8
|
-
plugins: {
|
|
9
|
-
"eslint-plugin-jsonc": eslintPluginJsonc
|
|
10
|
-
},
|
|
11
8
|
languageOptions: {
|
|
12
9
|
parser: eslintPluginJsonc
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
files: ["**/*.{json,jsonc,json5}"],
|
|
14
|
+
ignores: ["**/package-lock.json", "**/yarn.lock"],
|
|
15
|
+
plugins: {
|
|
16
|
+
"eslint-plugin-jsonc": eslintPluginJsonc
|
|
13
17
|
},
|
|
14
18
|
rules: {
|
|
15
19
|
"eslint-plugin-jsonc/array-bracket-spacing": ["warn", "never"],
|
|
@@ -37,9 +41,6 @@ export const json = [
|
|
|
37
41
|
plugins: {
|
|
38
42
|
"eslint-plugin-jsonc": eslintPluginJsonc
|
|
39
43
|
},
|
|
40
|
-
languageOptions: {
|
|
41
|
-
parser: eslintPluginJsonc
|
|
42
|
-
},
|
|
43
44
|
rules: {
|
|
44
45
|
"eslint-plugin-jsonc/sort-keys": "off"
|
|
45
46
|
}
|
|
@@ -49,9 +50,6 @@ export const json = [
|
|
|
49
50
|
plugins: {
|
|
50
51
|
"eslint-plugin-jsonc": eslintPluginJsonc
|
|
51
52
|
},
|
|
52
|
-
languageOptions: {
|
|
53
|
-
parser: eslintPluginJsonc
|
|
54
|
-
},
|
|
55
53
|
rules: {
|
|
56
54
|
"eslint-plugin-jsonc/sort-keys": [
|
|
57
55
|
"warn",
|
package/eslint/markdown.js
CHANGED
|
@@ -7,11 +7,7 @@ import eslintPluginUnusedImports from "eslint-plugin-unused-imports";
|
|
|
7
7
|
export const markdown = [
|
|
8
8
|
{
|
|
9
9
|
files: ["**/*.{md,mdx}"],
|
|
10
|
-
plugins: {
|
|
11
|
-
"eslint-plugin-markdown": eslintPluginMarkdown
|
|
12
|
-
},
|
|
13
10
|
processor: eslintPluginMarkdown.processors.markdown
|
|
14
|
-
|
|
15
11
|
},
|
|
16
12
|
{
|
|
17
13
|
files: ["**/*.{md,mdx}/*.{ts,tsx,mjs,cjs,js,jsx}"],
|
|
@@ -20,7 +16,6 @@ export const markdown = [
|
|
|
20
16
|
"eslint-plugin-markdown": eslintPluginMarkdown,
|
|
21
17
|
"eslint-plugin-unused-imports": eslintPluginUnusedImports
|
|
22
18
|
},
|
|
23
|
-
processor: eslintPluginMarkdown.processors.markdown,
|
|
24
19
|
rules: {
|
|
25
20
|
"eslint-plugin-import/newline-after-import": ["warn", { count: 1 }],
|
|
26
21
|
"eslint-plugin-unused-imports/no-unused-imports": "off"
|
package/eslint/stylistic.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import globals from "globals";
|
|
2
|
-
|
|
3
1
|
import eslintPluginStylisticJS from "@stylistic/eslint-plugin-js";
|
|
4
2
|
import eslintPluginStylisticPlus from "@stylistic/eslint-plugin-plus";
|
|
5
3
|
import eslintPluginStylisticTS from "@stylistic/eslint-plugin-ts";
|
|
6
|
-
import eslintParserTypeScript from "@typescript-eslint/parser";
|
|
7
4
|
|
|
8
5
|
/** @type { import("eslint").Linter.FlatConfig[] } */
|
|
9
6
|
export const stylistic = [
|
|
@@ -13,14 +10,6 @@ export const stylistic = [
|
|
|
13
10
|
"eslint-plugin-stylistic-js": eslintPluginStylisticJS,
|
|
14
11
|
"eslint-plugin-stylistic-plus": eslintPluginStylisticPlus
|
|
15
12
|
},
|
|
16
|
-
languageOptions: {
|
|
17
|
-
globals: {
|
|
18
|
-
...globals.browser,
|
|
19
|
-
...globals.node,
|
|
20
|
-
...globals.builtin,
|
|
21
|
-
...globals.worker
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
13
|
rules: {
|
|
25
14
|
|
|
26
15
|
// array
|
|
@@ -155,18 +144,6 @@ export const stylistic = [
|
|
|
155
144
|
"eslint-plugin-stylistic-ts": eslintPluginStylisticTS,
|
|
156
145
|
"eslint-plugin-stylistic-js": eslintPluginStylisticJS
|
|
157
146
|
},
|
|
158
|
-
languageOptions: {
|
|
159
|
-
parser: eslintParserTypeScript,
|
|
160
|
-
parserOptions: {
|
|
161
|
-
project: "./tsconfig.json"
|
|
162
|
-
},
|
|
163
|
-
globals: {
|
|
164
|
-
...globals.browser,
|
|
165
|
-
...globals.node,
|
|
166
|
-
...globals.builtin,
|
|
167
|
-
...globals.worker
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
147
|
rules: {
|
|
171
148
|
|
|
172
149
|
// class
|
package/eslint/typescript.js
CHANGED
|
@@ -17,12 +17,17 @@ export const typescript = [
|
|
|
17
17
|
|
|
18
18
|
// typescript
|
|
19
19
|
{
|
|
20
|
+
|
|
20
21
|
languageOptions: {
|
|
21
22
|
parser: eslintParserTypeScript,
|
|
22
23
|
parserOptions: {
|
|
23
24
|
project: "./tsconfig.json"
|
|
24
25
|
}
|
|
25
26
|
},
|
|
27
|
+
files: ["**/*.{ts,tsx}"]
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
{
|
|
26
31
|
files: ["**/*.{ts,tsx}"],
|
|
27
32
|
plugins: {
|
|
28
33
|
"eslint-plugin-import": eslintPluginImport,
|
|
@@ -301,5 +306,4 @@ export const typescript = [
|
|
|
301
306
|
...eslintPluginTypeScript.configs["disable-type-checked"].rules
|
|
302
307
|
}
|
|
303
308
|
}
|
|
304
|
-
|
|
305
309
|
];
|
package/eslint/yaml.js
CHANGED
|
@@ -6,11 +6,15 @@ export const yaml = [
|
|
|
6
6
|
{
|
|
7
7
|
files: ["**/*.{yaml,yml}"],
|
|
8
8
|
ignores: ["pnpm-lock.yaml"],
|
|
9
|
-
plugins: {
|
|
10
|
-
"eslint-plugin-yml": eslintPluginYml
|
|
11
|
-
},
|
|
12
9
|
languageOptions: {
|
|
13
10
|
parser: eslintParserYaml
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
files: ["**/*.{yaml,yml}"],
|
|
15
|
+
ignores: ["pnpm-lock.yaml"],
|
|
16
|
+
plugins: {
|
|
17
|
+
"eslint-plugin-yml": eslintPluginYml
|
|
14
18
|
},
|
|
15
19
|
rules: {
|
|
16
20
|
"eslint-plugin-yml/quotes": ["warn", { avoidEscape: true, prefer: "double" }],
|
|
@@ -26,9 +30,6 @@ export const yaml = [
|
|
|
26
30
|
plugins: {
|
|
27
31
|
"eslint-plugin-yml": eslintPluginYml
|
|
28
32
|
},
|
|
29
|
-
languageOptions: {
|
|
30
|
-
parser: eslintParserYaml
|
|
31
|
-
},
|
|
32
33
|
rules: {
|
|
33
34
|
"eslint-plugin-yml/sort-keys": [
|
|
34
35
|
"warn",
|
package/package.json
CHANGED