@schoero/configs 1.5.32 → 1.5.34
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 +3 -4
- package/eslint/javascript.js +1 -1
- package/eslint/json.js +1 -3
- package/eslint/jsx.js +18 -13
- package/eslint/markdown.js +1 -1
- package/eslint/stylistic.js +1 -1
- package/eslint/typescript.js +21 -5
- package/eslint/vitest.js +1 -1
- package/oxlint/eslint/better-tailwindcss.ts +31 -0
- package/oxlint/eslint/jsx.ts +17 -0
- package/oxlint/eslint/perfectionist.ts +171 -0
- package/oxlint/eslint/stylistic.ts +71 -0
- package/oxlint/globals.ts +14 -0
- package/oxlint/{ignore.json → ignore.ts} +7 -5
- package/oxlint/imports.ts +32 -0
- package/oxlint/{javascript.json → javascript.ts} +28 -26
- package/oxlint/jsx.ts +12 -0
- package/oxlint/sorting.ts +10 -0
- package/oxlint/tailwind.ts +8 -0
- package/oxlint/{typescript.json → typescript.ts} +10 -9
- package/oxlint/vitest.ts +36 -0
- package/package.json +27 -30
- package/oxlint/eslint/better-tailwindcss.json +0 -21
- package/oxlint/globals.json +0 -793
- package/oxlint/index.json +0 -8
- package/oxlint/tailwind.json +0 -5
package/eslint/imports.js
CHANGED
|
@@ -34,12 +34,11 @@ export const imports = [
|
|
|
34
34
|
"external",
|
|
35
35
|
"internal",
|
|
36
36
|
["parent", "sibling", "index"],
|
|
37
|
-
"object",
|
|
38
37
|
"style",
|
|
39
38
|
|
|
40
|
-
"external
|
|
41
|
-
"internal
|
|
42
|
-
["parent
|
|
39
|
+
"type-external",
|
|
40
|
+
"type-internal",
|
|
41
|
+
["type-parent", "type-sibling", "type-index"],
|
|
43
42
|
|
|
44
43
|
"side-effect-style",
|
|
45
44
|
|
package/eslint/javascript.js
CHANGED
package/eslint/json.js
CHANGED
package/eslint/jsx.js
CHANGED
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
import eslintPluginStylistic from "@stylistic/eslint-plugin";
|
|
2
2
|
import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin";
|
|
3
3
|
import eslintParserTypeScript from "@typescript-eslint/parser";
|
|
4
|
+
import eslintPluginPerfectionist from "eslint-plugin-perfectionist";
|
|
4
5
|
|
|
5
6
|
import { eslintPluginJsx } from "./plugins/jsx/index.js";
|
|
6
7
|
|
|
7
|
-
|
|
8
8
|
/** @type {import("eslint").Linter.Config[]} */
|
|
9
9
|
export const jsx = [
|
|
10
10
|
{
|
|
11
11
|
files: ["**/*.{jsx,tsx}"],
|
|
12
12
|
plugins: {
|
|
13
13
|
"eslint-plugin-stylistic": eslintPluginStylistic,
|
|
14
|
-
"eslint-plugin-jsx": eslintPluginJsx
|
|
14
|
+
"eslint-plugin-jsx": eslintPluginJsx,
|
|
15
|
+
"eslint-plugin-perfectionist": eslintPluginPerfectionist
|
|
15
16
|
},
|
|
16
17
|
rules: {
|
|
18
|
+
"eslint-plugin-stylistic/indent": ["warn", 2],
|
|
17
19
|
"eslint-plugin-stylistic/no-extra-parens": "off",
|
|
20
|
+
|
|
18
21
|
"eslint-plugin-jsx/jsx-wrap-text": ["warn", { printWidth: 119 }],
|
|
19
|
-
"eslint-plugin-jsx/jsx-no-literals": "warn"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
files: ["**/*.{js,jsx,cjs,mjs,ts,tsx}"],
|
|
24
|
-
plugins: {
|
|
25
|
-
"eslint-plugin-stylistic": eslintPluginStylistic
|
|
26
|
-
},
|
|
27
|
-
rules: {
|
|
28
|
-
"eslint-plugin-stylistic/indent": ["warn", 2],
|
|
22
|
+
"eslint-plugin-jsx/jsx-no-literals": "warn",
|
|
29
23
|
|
|
30
24
|
"eslint-plugin-stylistic/jsx-curly-brace-presence": ["warn", { children: "never", propElementValues: "always", props: "never" }],
|
|
31
25
|
"eslint-plugin-stylistic/jsx-child-element-spacing": "warn",
|
|
@@ -41,7 +35,6 @@ export const jsx = [
|
|
|
41
35
|
"eslint-plugin-stylistic/jsx-max-props-per-line": ["warn", { maximum: 1, when: "multiline" }],
|
|
42
36
|
"eslint-plugin-stylistic/jsx-one-expression-per-line": ["warn", { allow: "single-line" }],
|
|
43
37
|
"eslint-plugin-stylistic/jsx-self-closing-comp": "warn",
|
|
44
|
-
"eslint-plugin-stylistic/jsx-sort-props": ["warn", { ignoreCase: true, callbacksLast: true, shorthandFirst: true, multiline: "last" }],
|
|
45
38
|
"eslint-plugin-stylistic/jsx-tag-spacing": ["warn", { beforeClosing: "never", beforeSelfClosing: "always" }],
|
|
46
39
|
"eslint-plugin-stylistic/jsx-wrap-multilines": ["warn", {
|
|
47
40
|
declaration: "parens-new-line",
|
|
@@ -52,6 +45,18 @@ export const jsx = [
|
|
|
52
45
|
condition: "parens-new-line",
|
|
53
46
|
logical: "parens-new-line",
|
|
54
47
|
prop: "parens-new-line"
|
|
48
|
+
}],
|
|
49
|
+
"eslint-plugin-perfectionist/sort-jsx-props": ["warn", {
|
|
50
|
+
ignoreCase: true,
|
|
51
|
+
groups: [
|
|
52
|
+
"shorthand-prop",
|
|
53
|
+
"multiline-prop",
|
|
54
|
+
"callback"
|
|
55
|
+
],
|
|
56
|
+
customGroups: [{
|
|
57
|
+
groupName: "callback",
|
|
58
|
+
elementNamePattern: "^on.+"
|
|
59
|
+
}]
|
|
55
60
|
}]
|
|
56
61
|
}
|
|
57
62
|
},
|
package/eslint/markdown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import eslintPluginMarkdown from "@eslint/markdown";
|
|
1
2
|
import eslintPluginImportX from "eslint-plugin-import-x";
|
|
2
3
|
import eslintPluginJsonc from "eslint-plugin-jsonc";
|
|
3
|
-
import eslintPluginMarkdown from "eslint-plugin-markdown";
|
|
4
4
|
import eslintPluginUnusedImports from "eslint-plugin-unused-imports";
|
|
5
5
|
|
|
6
6
|
/** @type { import("eslint").Linter.Config[] } */
|
package/eslint/stylistic.js
CHANGED
|
@@ -86,7 +86,7 @@ export const stylistic = [
|
|
|
86
86
|
"eslint-plugin-stylistic/space-unary-ops": ["warn", { nonwords: false, words: true }],
|
|
87
87
|
"eslint-plugin-stylistic/spaced-comment": ["warn", "always", { exceptions: ["-", "+"], markers: ["--"] }],
|
|
88
88
|
"eslint-plugin-stylistic/switch-colon-spacing": "warn",
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
// disabled due to false positives
|
|
91
91
|
"eslint-plugin-stylistic/indent-binary-ops": "off",
|
|
92
92
|
|
package/eslint/typescript.js
CHANGED
|
@@ -67,7 +67,16 @@ export const typescript = [
|
|
|
67
67
|
order: "asc",
|
|
68
68
|
ignoreCase: true,
|
|
69
69
|
partitionByNewLine: true,
|
|
70
|
-
|
|
70
|
+
groups: [
|
|
71
|
+
"required-index-signature",
|
|
72
|
+
"required-property",
|
|
73
|
+
"required-member",
|
|
74
|
+
"required-method",
|
|
75
|
+
"optional-index-signature",
|
|
76
|
+
"optional-property",
|
|
77
|
+
"optional-member",
|
|
78
|
+
"optional-method"
|
|
79
|
+
]
|
|
71
80
|
}
|
|
72
81
|
],
|
|
73
82
|
"eslint-plugin-perfectionist/sort-interfaces": [
|
|
@@ -77,7 +86,16 @@ export const typescript = [
|
|
|
77
86
|
order: "asc",
|
|
78
87
|
ignoreCase: true,
|
|
79
88
|
partitionByNewLine: false,
|
|
80
|
-
|
|
89
|
+
groups: [
|
|
90
|
+
"required-index-signature",
|
|
91
|
+
"required-property",
|
|
92
|
+
"required-member",
|
|
93
|
+
"required-method",
|
|
94
|
+
"optional-index-signature",
|
|
95
|
+
"optional-property",
|
|
96
|
+
"optional-member",
|
|
97
|
+
"optional-method"
|
|
98
|
+
]
|
|
81
99
|
}
|
|
82
100
|
],
|
|
83
101
|
"eslint-plugin-perfectionist/sort-union-types": [
|
|
@@ -125,9 +143,7 @@ export const typescript = [
|
|
|
125
143
|
{
|
|
126
144
|
type: "alphabetical",
|
|
127
145
|
order: "asc",
|
|
128
|
-
ignoreCase: true
|
|
129
|
-
partitionByComment: false,
|
|
130
|
-
sortByValue: false
|
|
146
|
+
ignoreCase: true
|
|
131
147
|
}
|
|
132
148
|
],
|
|
133
149
|
|
package/eslint/vitest.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
2
|
+
import { defineConfig } from "oxlint";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export const betterTailwindcss = defineConfig({
|
|
6
|
+
overrides: [
|
|
7
|
+
{
|
|
8
|
+
files: ["**/*.{js,ts,jsx,cjs,mjs,tsx}"],
|
|
9
|
+
jsPlugins: ["eslint-plugin-better-tailwindcss"],
|
|
10
|
+
rules: {
|
|
11
|
+
...eslintPluginBetterTailwindcss.configs["recommended-warn"].rules,
|
|
12
|
+
"better-tailwindcss/enforce-consistent-class-order": ["warn", { order: "strict" }],
|
|
13
|
+
"better-tailwindcss/enforce-consistent-important-position": "warn",
|
|
14
|
+
"better-tailwindcss/enforce-consistent-line-wrapping": [
|
|
15
|
+
"warn",
|
|
16
|
+
{
|
|
17
|
+
indent: 4,
|
|
18
|
+
printWidth: 100,
|
|
19
|
+
strictness: "loose"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"better-tailwindcss/no-unknown-classes": [
|
|
23
|
+
"warn",
|
|
24
|
+
{
|
|
25
|
+
ignore: ["^dark$", "^toaster$"]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const jsx = defineConfig({
|
|
5
|
+
overrides: [
|
|
6
|
+
{
|
|
7
|
+
files: ["**/*.{jsx,tsx}"],
|
|
8
|
+
jsPlugins: [
|
|
9
|
+
"eslint-plugin-jsx"
|
|
10
|
+
],
|
|
11
|
+
rules: {
|
|
12
|
+
"eslint-plugin-jsx/jsx-no-literals": "warn",
|
|
13
|
+
"eslint-plugin-jsx/jsx-wrap-text": ["warn", { printWidth: 119 }]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
});
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const perfectionist = defineConfig({
|
|
5
|
+
overrides: [
|
|
6
|
+
{
|
|
7
|
+
files: ["**/*.{js,ts,jsx,cjs,mjs,tsx}"],
|
|
8
|
+
jsPlugins: ["eslint-plugin-perfectionist"],
|
|
9
|
+
rules: {
|
|
10
|
+
"perfectionist/sort-jsx-props": ["warn", {
|
|
11
|
+
customGroups: [{
|
|
12
|
+
elementNamePattern: "^on.+",
|
|
13
|
+
groupName: "callback"
|
|
14
|
+
}],
|
|
15
|
+
groups: [
|
|
16
|
+
"shorthand-prop",
|
|
17
|
+
"multiline-prop",
|
|
18
|
+
"callback"
|
|
19
|
+
],
|
|
20
|
+
ignoreCase: true
|
|
21
|
+
}]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
files: ["**/*.{js,ts,jsx,cjs,mjs,tsx}"],
|
|
26
|
+
jsPlugins: ["eslint-plugin-perfectionist"],
|
|
27
|
+
rules: {
|
|
28
|
+
"perfectionist/sort-imports": [
|
|
29
|
+
"warn",
|
|
30
|
+
{
|
|
31
|
+
groups: [
|
|
32
|
+
"side_effect",
|
|
33
|
+
"builtin",
|
|
34
|
+
"external",
|
|
35
|
+
"internal",
|
|
36
|
+
["parent", "sibling", "index"],
|
|
37
|
+
"style",
|
|
38
|
+
|
|
39
|
+
"type-external",
|
|
40
|
+
"type-internal",
|
|
41
|
+
["type-parent", "type-sibling", "type-index"],
|
|
42
|
+
|
|
43
|
+
"side_effect-style",
|
|
44
|
+
|
|
45
|
+
"unknown"
|
|
46
|
+
],
|
|
47
|
+
internalPattern: [
|
|
48
|
+
"^(?!node:).*:.*$",
|
|
49
|
+
"^(?!node:).*:.*\\/.*$",
|
|
50
|
+
"^(?!node:).*:.*(?:\\/.*)*$",
|
|
51
|
+
"^#.*$"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"perfectionist/sort-named-imports": [
|
|
56
|
+
"warn",
|
|
57
|
+
{
|
|
58
|
+
ignoreCase: true,
|
|
59
|
+
order: "asc",
|
|
60
|
+
type: "alphabetical"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
|
|
64
|
+
// exports
|
|
65
|
+
"perfectionist/sort-exports": [
|
|
66
|
+
"warn",
|
|
67
|
+
{
|
|
68
|
+
ignoreCase: true,
|
|
69
|
+
order: "asc",
|
|
70
|
+
type: "alphabetical"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"perfectionist/sort-named-exports": [
|
|
74
|
+
"warn",
|
|
75
|
+
{
|
|
76
|
+
ignoreCase: true,
|
|
77
|
+
order: "asc",
|
|
78
|
+
type: "alphabetical"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
|
|
82
|
+
"perfectionist/sort-enums": [
|
|
83
|
+
"warn",
|
|
84
|
+
{
|
|
85
|
+
ignoreCase: true,
|
|
86
|
+
order: "asc",
|
|
87
|
+
type: "alphabetical"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"perfectionist/sort-interfaces": [
|
|
91
|
+
"warn",
|
|
92
|
+
{
|
|
93
|
+
groups: [
|
|
94
|
+
"required-index-signature",
|
|
95
|
+
"required-property",
|
|
96
|
+
"required-member",
|
|
97
|
+
"required-method",
|
|
98
|
+
"optional-index-signature",
|
|
99
|
+
"optional-property",
|
|
100
|
+
"optional-member",
|
|
101
|
+
"optional-method"
|
|
102
|
+
],
|
|
103
|
+
ignoreCase: true,
|
|
104
|
+
order: "asc",
|
|
105
|
+
partitionByNewLine: false,
|
|
106
|
+
type: "alphabetical"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"perfectionist/sort-intersection-types": [
|
|
110
|
+
"warn",
|
|
111
|
+
{
|
|
112
|
+
groups: [
|
|
113
|
+
"union",
|
|
114
|
+
"conditional",
|
|
115
|
+
"function",
|
|
116
|
+
"intersection",
|
|
117
|
+
"literal",
|
|
118
|
+
"operator",
|
|
119
|
+
"named",
|
|
120
|
+
"keyword",
|
|
121
|
+
"nullish",
|
|
122
|
+
"object"
|
|
123
|
+
],
|
|
124
|
+
ignoreCase: true,
|
|
125
|
+
order: "asc",
|
|
126
|
+
type: "alphabetical"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"perfectionist/sort-object-types": [
|
|
130
|
+
"warn",
|
|
131
|
+
{
|
|
132
|
+
groups: [
|
|
133
|
+
"required-index-signature",
|
|
134
|
+
"required-property",
|
|
135
|
+
"required-member",
|
|
136
|
+
"required-method",
|
|
137
|
+
"optional-index-signature",
|
|
138
|
+
"optional-property",
|
|
139
|
+
"optional-member",
|
|
140
|
+
"optional-method"
|
|
141
|
+
],
|
|
142
|
+
ignoreCase: true,
|
|
143
|
+
order: "asc",
|
|
144
|
+
partitionByNewLine: true,
|
|
145
|
+
type: "alphabetical"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"perfectionist/sort-union-types": [
|
|
149
|
+
"warn",
|
|
150
|
+
{
|
|
151
|
+
groups: [
|
|
152
|
+
"union",
|
|
153
|
+
"conditional",
|
|
154
|
+
"function",
|
|
155
|
+
"intersection",
|
|
156
|
+
"literal",
|
|
157
|
+
"operator",
|
|
158
|
+
"named",
|
|
159
|
+
"keyword",
|
|
160
|
+
"nullish",
|
|
161
|
+
"object"
|
|
162
|
+
],
|
|
163
|
+
ignoreCase: true,
|
|
164
|
+
order: "asc",
|
|
165
|
+
type: "alphabetical"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const stylistic = defineConfig({
|
|
5
|
+
overrides: [
|
|
6
|
+
{
|
|
7
|
+
files: ["**/*.{jsx,tsx}"],
|
|
8
|
+
jsPlugins: [
|
|
9
|
+
"eslint-plugin-stylistic"
|
|
10
|
+
],
|
|
11
|
+
rules: {
|
|
12
|
+
"eslint-plugin-stylistic/indent": ["warn", 2],
|
|
13
|
+
"eslint-plugin-stylistic/no-extra-parens": "off",
|
|
14
|
+
|
|
15
|
+
"eslint-plugin-stylistic/jsx-child-element-spacing": "warn",
|
|
16
|
+
"eslint-plugin-stylistic/jsx-closing-bracket-location": ["warn", "line-aligned"],
|
|
17
|
+
"eslint-plugin-stylistic/jsx-closing-tag-location": "warn",
|
|
18
|
+
"eslint-plugin-stylistic/jsx-curly-brace-presence": ["warn", { children: "never", propElementValues: "always", props: "never" }],
|
|
19
|
+
"eslint-plugin-stylistic/jsx-curly-newline": ["warn", "consistent"],
|
|
20
|
+
"eslint-plugin-stylistic/jsx-curly-spacing": ["warn", "never"],
|
|
21
|
+
"eslint-plugin-stylistic/jsx-equals-spacing": ["warn", "never"],
|
|
22
|
+
"eslint-plugin-stylistic/jsx-first-prop-new-line": ["warn", "multiline-multiprop"],
|
|
23
|
+
"eslint-plugin-stylistic/jsx-function-call-newline": ["warn", "multiline"],
|
|
24
|
+
"eslint-plugin-stylistic/jsx-indent-props": ["warn", 2],
|
|
25
|
+
"eslint-plugin-stylistic/jsx-max-props-per-line": ["warn", { maximum: 1, when: "multiline" }],
|
|
26
|
+
"eslint-plugin-stylistic/jsx-one-expression-per-line": ["warn", { allow: "single-line" }],
|
|
27
|
+
"eslint-plugin-stylistic/jsx-pascal-case": ["warn", { allowAllCaps: true }],
|
|
28
|
+
"eslint-plugin-stylistic/jsx-self-closing-comp": "warn",
|
|
29
|
+
"eslint-plugin-stylistic/jsx-tag-spacing": ["warn", { beforeClosing: "never", beforeSelfClosing: "always" }],
|
|
30
|
+
"eslint-plugin-stylistic/jsx-wrap-multilines": ["warn", {
|
|
31
|
+
arrow: "parens-new-line",
|
|
32
|
+
assignment: "parens-new-line",
|
|
33
|
+
condition: "parens-new-line",
|
|
34
|
+
declaration: "parens-new-line",
|
|
35
|
+
logical: "parens-new-line",
|
|
36
|
+
prop: "parens-new-line",
|
|
37
|
+
propertyValue: "parens-new-line",
|
|
38
|
+
return: "parens-new-line"
|
|
39
|
+
}]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
files: ["**/*.{tsx,ctsx,mtsx}"],
|
|
44
|
+
jsPlugins: [
|
|
45
|
+
"eslint-plugin-stylistic"
|
|
46
|
+
],
|
|
47
|
+
plugins: [
|
|
48
|
+
"typescript"
|
|
49
|
+
],
|
|
50
|
+
rules: {
|
|
51
|
+
// naming conventions
|
|
52
|
+
"typescript/naming-convention": [
|
|
53
|
+
"warn",
|
|
54
|
+
{
|
|
55
|
+
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
56
|
+
leadingUnderscore: "allow",
|
|
57
|
+
selector: "variable"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
format: ["camelCase", "PascalCase"],
|
|
61
|
+
selector: "function"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
|
|
65
|
+
// spacings
|
|
66
|
+
"eslint-plugin-stylistic/type-generic-spacing": "warn",
|
|
67
|
+
"eslint-plugin-stylistic/type-named-tuple-spacing": "warn"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const ignores = defineConfig({
|
|
5
|
+
ignorePatterns: [
|
|
4
6
|
"**/.git/**",
|
|
5
7
|
"**/node_modules/**",
|
|
6
8
|
"**/dist/**",
|
|
@@ -13,6 +15,6 @@
|
|
|
13
15
|
"**/package-lock.json",
|
|
14
16
|
"**/yarn.lock",
|
|
15
17
|
"**/pnpm-lock.yaml",
|
|
16
|
-
"**/bun.lockb"
|
|
18
|
+
"**/bun.lockb"
|
|
17
19
|
]
|
|
18
|
-
}
|
|
20
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
|
|
3
|
+
import { perfectionist } from "./eslint/perfectionist.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const imports = defineConfig({
|
|
7
|
+
extends: [
|
|
8
|
+
perfectionist
|
|
9
|
+
],
|
|
10
|
+
plugins: ["import", "unicorn"],
|
|
11
|
+
rules: {
|
|
12
|
+
// unused imports https://github.com/oxc-project/oxc/issues/18301#issuecomment-4322546558
|
|
13
|
+
"no-unused-vars": [
|
|
14
|
+
"warn",
|
|
15
|
+
{
|
|
16
|
+
fix: {
|
|
17
|
+
imports: "safe-fix",
|
|
18
|
+
variables: "off"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
|
|
23
|
+
// type imports
|
|
24
|
+
"import/consistent-type-specifier-style": ["warn", "prefer-top-level"],
|
|
25
|
+
|
|
26
|
+
"import/first": "warn",
|
|
27
|
+
"import/no-duplicates": "error",
|
|
28
|
+
"import/no-self-import": "error",
|
|
29
|
+
|
|
30
|
+
"unicorn/prefer-node-protocol": "warn"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { defineConfig } from "oxlint";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const javascript = defineConfig({
|
|
5
|
+
categories: {
|
|
6
|
+
correctness: "warn",
|
|
7
|
+
perf: "warn",
|
|
8
|
+
style: "warn",
|
|
9
|
+
suspicious: "warn"
|
|
8
10
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"rules": {
|
|
11
|
+
overrides: [{
|
|
12
|
+
files: ["**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts}"],
|
|
13
|
+
rules: {
|
|
13
14
|
"arrow-body-style": "off",
|
|
14
15
|
"curly": ["warn", "all"],
|
|
15
|
-
"eqeqeq": ["warn","always"],
|
|
16
|
-
"func-style": ["warn", "declaration", {
|
|
16
|
+
"eqeqeq": ["warn", "always"],
|
|
17
|
+
"func-style": ["warn", "declaration", { allowArrowFunctions: true }],
|
|
17
18
|
"no-constant-binary-expression": "warn",
|
|
18
19
|
"no-dupe-class-members": "error",
|
|
19
|
-
"no-empty": ["warn", {
|
|
20
|
+
"no-empty": ["warn", { allowEmptyCatch: true }],
|
|
20
21
|
"no-empty-static-block": "warn",
|
|
21
22
|
"no-extra-bind": "warn",
|
|
22
23
|
"no-loss-of-precision": "warn",
|
|
@@ -24,9 +25,9 @@
|
|
|
24
25
|
"no-unexpected-multiline": "warn",
|
|
25
26
|
"no-unneeded-ternary": "warn",
|
|
26
27
|
"no-unused-expressions": ["warn", {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
allowShortCircuit: true,
|
|
29
|
+
allowTaggedTemplates: true,
|
|
30
|
+
allowTernary: true
|
|
30
31
|
}],
|
|
31
32
|
"no-unused-labels": "warn",
|
|
32
33
|
"no-unused-vars": "off",
|
|
@@ -46,9 +47,9 @@
|
|
|
46
47
|
|
|
47
48
|
// disable recommended rules
|
|
48
49
|
"id-length": "off",
|
|
49
|
-
"sort-imports": "off",
|
|
50
50
|
"no-magic-numbers": "off",
|
|
51
|
-
|
|
51
|
+
"sort-imports": "off",
|
|
52
|
+
|
|
52
53
|
// unicorn
|
|
53
54
|
"unicorn/better-regex": "warn",
|
|
54
55
|
"unicorn/consistent-destructuring": "warn",
|
|
@@ -61,16 +62,17 @@
|
|
|
61
62
|
"unicorn/no-unreadable-array-destructuring": "warn",
|
|
62
63
|
"unicorn/no-useless-length-check": "warn",
|
|
63
64
|
"unicorn/no-useless-spread": "warn",
|
|
64
|
-
"unicorn/no-useless-undefined": ["warn", {
|
|
65
|
+
"unicorn/no-useless-undefined": ["warn", { checkArguments: false }],
|
|
65
66
|
"unicorn/number-literal-case": "warn",
|
|
66
|
-
"unicorn/numeric-separators-style": ["warn", {
|
|
67
|
+
"unicorn/numeric-separators-style": ["warn", { onlyIfContainsSeparator: false }],
|
|
67
68
|
"unicorn/prefer-date-now": "warn",
|
|
68
|
-
"unicorn/prefer-export-from": ["warn", {
|
|
69
|
+
"unicorn/prefer-export-from": ["warn", { ignoreUsedVariables: true }],
|
|
69
70
|
"unicorn/prefer-negative-index": "warn",
|
|
70
71
|
"unicorn/prefer-node-protocol": "warn",
|
|
71
|
-
"unicorn/template-indent": ["warn", {
|
|
72
|
+
"unicorn/template-indent": ["warn", { tags: ["ts"] }],
|
|
72
73
|
"unicorn/throw-new-error": "warn",
|
|
73
|
-
"yoda": "warn"
|
|
74
|
+
"yoda": "warn"
|
|
74
75
|
}
|
|
75
|
-
}]
|
|
76
|
-
|
|
76
|
+
}],
|
|
77
|
+
plugins: ["unicorn"]
|
|
78
|
+
});
|
package/oxlint/jsx.ts
ADDED