@siberiacancode/eslint 2.15.1 → 2.15.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/dist/cjs/index.cjs +201 -193
- package/dist/cjs/index.d.cts +12 -0
- package/dist/esm/index.d.mts +12 -0
- package/dist/esm/index.mjs +167 -190
- package/package.json +18 -16
- package/dist/types/index.d.ts +0 -10
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,195 +1,203 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
let _antfu_eslint_config = require("@antfu/eslint-config");
|
|
30
|
+
_antfu_eslint_config = __toESM(_antfu_eslint_config);
|
|
31
|
+
let eslint_plugin_jsx_a11y = require("eslint-plugin-jsx-a11y");
|
|
32
|
+
eslint_plugin_jsx_a11y = __toESM(eslint_plugin_jsx_a11y);
|
|
33
|
+
let eslint_plugin_react = require("eslint-plugin-react");
|
|
34
|
+
eslint_plugin_react = __toESM(eslint_plugin_react);
|
|
35
|
+
|
|
36
|
+
//#region src/index.ts
|
|
7
37
|
const eslint = (inputOptions = {}, ...configs) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
{
|
|
171
|
-
groups: [
|
|
172
|
-
"conditional",
|
|
173
|
-
"function",
|
|
174
|
-
"import",
|
|
175
|
-
"intersection",
|
|
176
|
-
"keyword",
|
|
177
|
-
"literal",
|
|
178
|
-
"named",
|
|
179
|
-
"object",
|
|
180
|
-
"operator",
|
|
181
|
-
"tuple",
|
|
182
|
-
"union",
|
|
183
|
-
"nullish"
|
|
184
|
-
],
|
|
185
|
-
order: "asc",
|
|
186
|
-
specialCharacters: "keep",
|
|
187
|
-
type: "alphabetical"
|
|
188
|
-
}
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
...configs
|
|
193
|
-
);
|
|
38
|
+
const { jsxA11y = false, ...options } = inputOptions;
|
|
39
|
+
const stylistic = options?.stylistic ?? false;
|
|
40
|
+
if (jsxA11y) {
|
|
41
|
+
const jsxA11yRules = eslint_plugin_jsx_a11y.default.flatConfigs.recommended.rules;
|
|
42
|
+
configs.unshift({
|
|
43
|
+
name: "siberiacancode/jsx-a11y",
|
|
44
|
+
plugins: { "siberiacancode-jsx-a11y": eslint_plugin_jsx_a11y.default },
|
|
45
|
+
rules: { ...Object.entries(jsxA11yRules).reduce((acc, [key, value]) => {
|
|
46
|
+
acc[key.replace("jsx-a11y", "siberiacancode-jsx-a11y")] = value;
|
|
47
|
+
return acc;
|
|
48
|
+
}, {}) }
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (options.react) configs.unshift({
|
|
52
|
+
name: "siberiacancode/react",
|
|
53
|
+
plugins: { "siberiacancode-react": eslint_plugin_react.default },
|
|
54
|
+
rules: {
|
|
55
|
+
...Object.entries(eslint_plugin_react.default.configs.recommended.rules).reduce((acc, [key, value]) => {
|
|
56
|
+
acc[key.replace("react", "siberiacancode-react")] = value;
|
|
57
|
+
return acc;
|
|
58
|
+
}, {}),
|
|
59
|
+
"siberiacancode-react/function-component-definition": ["error", {
|
|
60
|
+
namedComponents: ["arrow-function"],
|
|
61
|
+
unnamedComponents: "arrow-function"
|
|
62
|
+
}],
|
|
63
|
+
"siberiacancode-react/prop-types": "off",
|
|
64
|
+
"siberiacancode-react/react-in-jsx-scope": "off"
|
|
65
|
+
},
|
|
66
|
+
settings: { react: { version: "detect" } }
|
|
67
|
+
});
|
|
68
|
+
if (stylistic) configs.unshift({
|
|
69
|
+
name: "siberiacancode/formatter",
|
|
70
|
+
rules: {
|
|
71
|
+
"style/arrow-parens": ["error", "always"],
|
|
72
|
+
"style/brace-style": "off",
|
|
73
|
+
"style/comma-dangle": ["error", "never"],
|
|
74
|
+
"style/indent": [
|
|
75
|
+
"error",
|
|
76
|
+
2,
|
|
77
|
+
{ SwitchCase: 1 }
|
|
78
|
+
],
|
|
79
|
+
"style/jsx-curly-newline": "off",
|
|
80
|
+
"style/jsx-one-expression-per-line": "off",
|
|
81
|
+
"style/jsx-quotes": ["error", "prefer-single"],
|
|
82
|
+
"style/linebreak-style": ["error", "unix"],
|
|
83
|
+
"style/max-len": [
|
|
84
|
+
"error",
|
|
85
|
+
100,
|
|
86
|
+
2,
|
|
87
|
+
{
|
|
88
|
+
ignoreComments: true,
|
|
89
|
+
ignoreStrings: true,
|
|
90
|
+
ignoreTemplateLiterals: true
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"style/member-delimiter-style": "off",
|
|
94
|
+
"style/multiline-ternary": "off",
|
|
95
|
+
"style/no-tabs": "error",
|
|
96
|
+
"style/operator-linebreak": "off",
|
|
97
|
+
"style/quote-props": "off",
|
|
98
|
+
"style/quotes": [
|
|
99
|
+
"error",
|
|
100
|
+
"single",
|
|
101
|
+
{ allowTemplateLiterals: true }
|
|
102
|
+
],
|
|
103
|
+
"style/semi": ["error", "always"]
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return (0, _antfu_eslint_config.default)({
|
|
107
|
+
...options,
|
|
108
|
+
stylistic
|
|
109
|
+
}, {
|
|
110
|
+
name: "siberiacancode/rewrite",
|
|
111
|
+
rules: {
|
|
112
|
+
"antfu/curly": "off",
|
|
113
|
+
"antfu/if-newline": "off",
|
|
114
|
+
"antfu/top-level-function": "off",
|
|
115
|
+
"no-console": "warn",
|
|
116
|
+
"react-hooks/exhaustive-deps": "off",
|
|
117
|
+
"test/prefer-lowercase-title": "off"
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
name: "siberiacancode/sort",
|
|
121
|
+
rules: {
|
|
122
|
+
"perfectionist/sort-array-includes": ["error", {
|
|
123
|
+
order: "asc",
|
|
124
|
+
type: "alphabetical"
|
|
125
|
+
}],
|
|
126
|
+
"perfectionist/sort-imports": ["error", {
|
|
127
|
+
groups: [
|
|
128
|
+
"type-import",
|
|
129
|
+
["value-builtin", "value-external"],
|
|
130
|
+
"type-internal",
|
|
131
|
+
"value-internal",
|
|
132
|
+
[
|
|
133
|
+
"type-parent",
|
|
134
|
+
"type-sibling",
|
|
135
|
+
"type-index"
|
|
136
|
+
],
|
|
137
|
+
[
|
|
138
|
+
"value-parent",
|
|
139
|
+
"value-sibling",
|
|
140
|
+
"value-index"
|
|
141
|
+
],
|
|
142
|
+
"side-effect",
|
|
143
|
+
"side-effect-style",
|
|
144
|
+
"unknown"
|
|
145
|
+
],
|
|
146
|
+
internalPattern: ["^~/.*", "^@/.*"],
|
|
147
|
+
newlinesBetween: 1,
|
|
148
|
+
order: "asc",
|
|
149
|
+
type: "natural"
|
|
150
|
+
}],
|
|
151
|
+
"perfectionist/sort-interfaces": ["error", {
|
|
152
|
+
groups: [
|
|
153
|
+
"property",
|
|
154
|
+
"member",
|
|
155
|
+
"method",
|
|
156
|
+
"index-signature"
|
|
157
|
+
],
|
|
158
|
+
order: "asc",
|
|
159
|
+
type: "alphabetical"
|
|
160
|
+
}],
|
|
161
|
+
"perfectionist/sort-jsx-props": ["error", {
|
|
162
|
+
customGroups: [{
|
|
163
|
+
groupName: "reserved",
|
|
164
|
+
elementNamePattern: "^(key|ref)$"
|
|
165
|
+
}, {
|
|
166
|
+
groupName: "callback",
|
|
167
|
+
elementNamePattern: "^on[A-Z].*"
|
|
168
|
+
}],
|
|
169
|
+
groups: [
|
|
170
|
+
"shorthand-prop",
|
|
171
|
+
"reserved",
|
|
172
|
+
"multiline-prop",
|
|
173
|
+
"unknown",
|
|
174
|
+
"callback"
|
|
175
|
+
],
|
|
176
|
+
order: "asc",
|
|
177
|
+
type: "alphabetical"
|
|
178
|
+
}],
|
|
179
|
+
"perfectionist/sort-union-types": ["error", {
|
|
180
|
+
groups: [
|
|
181
|
+
"conditional",
|
|
182
|
+
"function",
|
|
183
|
+
"import",
|
|
184
|
+
"intersection",
|
|
185
|
+
"keyword",
|
|
186
|
+
"literal",
|
|
187
|
+
"named",
|
|
188
|
+
"object",
|
|
189
|
+
"operator",
|
|
190
|
+
"tuple",
|
|
191
|
+
"union",
|
|
192
|
+
"nullish"
|
|
193
|
+
],
|
|
194
|
+
order: "asc",
|
|
195
|
+
specialCharacters: "keep",
|
|
196
|
+
type: "alphabetical"
|
|
197
|
+
}]
|
|
198
|
+
}
|
|
199
|
+
}, ...configs);
|
|
194
200
|
};
|
|
195
|
-
|
|
201
|
+
|
|
202
|
+
//#endregion
|
|
203
|
+
exports.eslint = eslint;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Awaitable, ConfigNames, OptionsConfig, TypedFlatConfigItem } from "@antfu/eslint-config";
|
|
2
|
+
import { Linter } from "eslint";
|
|
3
|
+
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
type EslintOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
7
|
+
jsxA11y?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type Eslint = (options?: EslintOptions, ...userConfigs: Awaitable<FlatConfigComposer<any, any> | Linter.Config[] | TypedFlatConfigItem | TypedFlatConfigItem[]>[]) => FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
10
|
+
declare const eslint: Eslint;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Eslint, eslint };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Awaitable, ConfigNames, OptionsConfig, TypedFlatConfigItem } from "@antfu/eslint-config";
|
|
2
|
+
import { Linter } from "eslint";
|
|
3
|
+
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
type EslintOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
7
|
+
jsxA11y?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type Eslint = (options?: EslintOptions, ...userConfigs: Awaitable<FlatConfigComposer<any, any> | Linter.Config[] | TypedFlatConfigItem | TypedFlatConfigItem[]>[]) => FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
10
|
+
declare const eslint: Eslint;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Eslint, eslint };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,195 +1,172 @@
|
|
|
1
1
|
import antfu from "@antfu/eslint-config";
|
|
2
|
-
import pluginNext from "@next/eslint-plugin-next";
|
|
3
2
|
import pluginJsxA11y from "eslint-plugin-jsx-a11y";
|
|
4
3
|
import pluginReact from "eslint-plugin-react";
|
|
4
|
+
|
|
5
|
+
//#region src/index.ts
|
|
5
6
|
const eslint = (inputOptions = {}, ...configs) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
{
|
|
169
|
-
groups: [
|
|
170
|
-
"conditional",
|
|
171
|
-
"function",
|
|
172
|
-
"import",
|
|
173
|
-
"intersection",
|
|
174
|
-
"keyword",
|
|
175
|
-
"literal",
|
|
176
|
-
"named",
|
|
177
|
-
"object",
|
|
178
|
-
"operator",
|
|
179
|
-
"tuple",
|
|
180
|
-
"union",
|
|
181
|
-
"nullish"
|
|
182
|
-
],
|
|
183
|
-
order: "asc",
|
|
184
|
-
specialCharacters: "keep",
|
|
185
|
-
type: "alphabetical"
|
|
186
|
-
}
|
|
187
|
-
]
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
...configs
|
|
191
|
-
);
|
|
192
|
-
};
|
|
193
|
-
export {
|
|
194
|
-
eslint
|
|
7
|
+
const { jsxA11y = false, ...options } = inputOptions;
|
|
8
|
+
const stylistic = options?.stylistic ?? false;
|
|
9
|
+
if (jsxA11y) {
|
|
10
|
+
const jsxA11yRules = pluginJsxA11y.flatConfigs.recommended.rules;
|
|
11
|
+
configs.unshift({
|
|
12
|
+
name: "siberiacancode/jsx-a11y",
|
|
13
|
+
plugins: { "siberiacancode-jsx-a11y": pluginJsxA11y },
|
|
14
|
+
rules: { ...Object.entries(jsxA11yRules).reduce((acc, [key, value]) => {
|
|
15
|
+
acc[key.replace("jsx-a11y", "siberiacancode-jsx-a11y")] = value;
|
|
16
|
+
return acc;
|
|
17
|
+
}, {}) }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (options.react) configs.unshift({
|
|
21
|
+
name: "siberiacancode/react",
|
|
22
|
+
plugins: { "siberiacancode-react": pluginReact },
|
|
23
|
+
rules: {
|
|
24
|
+
...Object.entries(pluginReact.configs.recommended.rules).reduce((acc, [key, value]) => {
|
|
25
|
+
acc[key.replace("react", "siberiacancode-react")] = value;
|
|
26
|
+
return acc;
|
|
27
|
+
}, {}),
|
|
28
|
+
"siberiacancode-react/function-component-definition": ["error", {
|
|
29
|
+
namedComponents: ["arrow-function"],
|
|
30
|
+
unnamedComponents: "arrow-function"
|
|
31
|
+
}],
|
|
32
|
+
"siberiacancode-react/prop-types": "off",
|
|
33
|
+
"siberiacancode-react/react-in-jsx-scope": "off"
|
|
34
|
+
},
|
|
35
|
+
settings: { react: { version: "detect" } }
|
|
36
|
+
});
|
|
37
|
+
if (stylistic) configs.unshift({
|
|
38
|
+
name: "siberiacancode/formatter",
|
|
39
|
+
rules: {
|
|
40
|
+
"style/arrow-parens": ["error", "always"],
|
|
41
|
+
"style/brace-style": "off",
|
|
42
|
+
"style/comma-dangle": ["error", "never"],
|
|
43
|
+
"style/indent": [
|
|
44
|
+
"error",
|
|
45
|
+
2,
|
|
46
|
+
{ SwitchCase: 1 }
|
|
47
|
+
],
|
|
48
|
+
"style/jsx-curly-newline": "off",
|
|
49
|
+
"style/jsx-one-expression-per-line": "off",
|
|
50
|
+
"style/jsx-quotes": ["error", "prefer-single"],
|
|
51
|
+
"style/linebreak-style": ["error", "unix"],
|
|
52
|
+
"style/max-len": [
|
|
53
|
+
"error",
|
|
54
|
+
100,
|
|
55
|
+
2,
|
|
56
|
+
{
|
|
57
|
+
ignoreComments: true,
|
|
58
|
+
ignoreStrings: true,
|
|
59
|
+
ignoreTemplateLiterals: true
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"style/member-delimiter-style": "off",
|
|
63
|
+
"style/multiline-ternary": "off",
|
|
64
|
+
"style/no-tabs": "error",
|
|
65
|
+
"style/operator-linebreak": "off",
|
|
66
|
+
"style/quote-props": "off",
|
|
67
|
+
"style/quotes": [
|
|
68
|
+
"error",
|
|
69
|
+
"single",
|
|
70
|
+
{ allowTemplateLiterals: true }
|
|
71
|
+
],
|
|
72
|
+
"style/semi": ["error", "always"]
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return antfu({
|
|
76
|
+
...options,
|
|
77
|
+
stylistic
|
|
78
|
+
}, {
|
|
79
|
+
name: "siberiacancode/rewrite",
|
|
80
|
+
rules: {
|
|
81
|
+
"antfu/curly": "off",
|
|
82
|
+
"antfu/if-newline": "off",
|
|
83
|
+
"antfu/top-level-function": "off",
|
|
84
|
+
"no-console": "warn",
|
|
85
|
+
"react-hooks/exhaustive-deps": "off",
|
|
86
|
+
"test/prefer-lowercase-title": "off"
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
name: "siberiacancode/sort",
|
|
90
|
+
rules: {
|
|
91
|
+
"perfectionist/sort-array-includes": ["error", {
|
|
92
|
+
order: "asc",
|
|
93
|
+
type: "alphabetical"
|
|
94
|
+
}],
|
|
95
|
+
"perfectionist/sort-imports": ["error", {
|
|
96
|
+
groups: [
|
|
97
|
+
"type-import",
|
|
98
|
+
["value-builtin", "value-external"],
|
|
99
|
+
"type-internal",
|
|
100
|
+
"value-internal",
|
|
101
|
+
[
|
|
102
|
+
"type-parent",
|
|
103
|
+
"type-sibling",
|
|
104
|
+
"type-index"
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"value-parent",
|
|
108
|
+
"value-sibling",
|
|
109
|
+
"value-index"
|
|
110
|
+
],
|
|
111
|
+
"side-effect",
|
|
112
|
+
"side-effect-style",
|
|
113
|
+
"unknown"
|
|
114
|
+
],
|
|
115
|
+
internalPattern: ["^~/.*", "^@/.*"],
|
|
116
|
+
newlinesBetween: 1,
|
|
117
|
+
order: "asc",
|
|
118
|
+
type: "natural"
|
|
119
|
+
}],
|
|
120
|
+
"perfectionist/sort-interfaces": ["error", {
|
|
121
|
+
groups: [
|
|
122
|
+
"property",
|
|
123
|
+
"member",
|
|
124
|
+
"method",
|
|
125
|
+
"index-signature"
|
|
126
|
+
],
|
|
127
|
+
order: "asc",
|
|
128
|
+
type: "alphabetical"
|
|
129
|
+
}],
|
|
130
|
+
"perfectionist/sort-jsx-props": ["error", {
|
|
131
|
+
customGroups: [{
|
|
132
|
+
groupName: "reserved",
|
|
133
|
+
elementNamePattern: "^(key|ref)$"
|
|
134
|
+
}, {
|
|
135
|
+
groupName: "callback",
|
|
136
|
+
elementNamePattern: "^on[A-Z].*"
|
|
137
|
+
}],
|
|
138
|
+
groups: [
|
|
139
|
+
"shorthand-prop",
|
|
140
|
+
"reserved",
|
|
141
|
+
"multiline-prop",
|
|
142
|
+
"unknown",
|
|
143
|
+
"callback"
|
|
144
|
+
],
|
|
145
|
+
order: "asc",
|
|
146
|
+
type: "alphabetical"
|
|
147
|
+
}],
|
|
148
|
+
"perfectionist/sort-union-types": ["error", {
|
|
149
|
+
groups: [
|
|
150
|
+
"conditional",
|
|
151
|
+
"function",
|
|
152
|
+
"import",
|
|
153
|
+
"intersection",
|
|
154
|
+
"keyword",
|
|
155
|
+
"literal",
|
|
156
|
+
"named",
|
|
157
|
+
"object",
|
|
158
|
+
"operator",
|
|
159
|
+
"tuple",
|
|
160
|
+
"union",
|
|
161
|
+
"nullish"
|
|
162
|
+
],
|
|
163
|
+
order: "asc",
|
|
164
|
+
specialCharacters: "keep",
|
|
165
|
+
type: "alphabetical"
|
|
166
|
+
}]
|
|
167
|
+
}
|
|
168
|
+
}, ...configs);
|
|
195
169
|
};
|
|
170
|
+
|
|
171
|
+
//#endregion
|
|
172
|
+
export { eslint };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siberiacancode/eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.15.
|
|
4
|
+
"version": "2.15.3",
|
|
5
5
|
"description": "eslint configs",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SIBERIA CAN CODE 🧊",
|
|
@@ -28,21 +28,25 @@
|
|
|
28
28
|
},
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/esm/index.d.mts",
|
|
33
|
+
"default": "./dist/esm/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/cjs/index.d.cts",
|
|
37
|
+
"default": "./dist/cjs/index.cjs"
|
|
38
|
+
}
|
|
35
39
|
}
|
|
36
40
|
},
|
|
37
41
|
"main": "dist/cjs/index.cjs",
|
|
38
42
|
"module": "dist/esm/index.mjs",
|
|
39
|
-
"types": "dist/
|
|
43
|
+
"types": "dist/esm/index.d.mts",
|
|
40
44
|
"files": [
|
|
41
|
-
"dist
|
|
45
|
+
"dist"
|
|
42
46
|
],
|
|
43
47
|
"scripts": {
|
|
44
48
|
"prepublishOnly": "yarn type && yarn build",
|
|
45
|
-
"build": "
|
|
49
|
+
"build": "tsdown",
|
|
46
50
|
"lint": "eslint . --fix",
|
|
47
51
|
"lint-inspector": "npx @eslint/config-inspector",
|
|
48
52
|
"type": "tsc --noEmit",
|
|
@@ -50,22 +54,20 @@
|
|
|
50
54
|
"pretty": "yarn type && yarn lint && yarn format"
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {
|
|
53
|
-
"@antfu/eslint-config": "7.
|
|
54
|
-
"@eslint-react/eslint-plugin": "2.
|
|
57
|
+
"@antfu/eslint-config": "7.6.1",
|
|
58
|
+
"@eslint-react/eslint-plugin": "2.13.0",
|
|
55
59
|
"@next/eslint-plugin-next": "16.1.6",
|
|
56
60
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
57
|
-
"@vue/compiler-sfc": "3.5.
|
|
58
|
-
"eslint": "10.0.
|
|
61
|
+
"@vue/compiler-sfc": "3.5.29",
|
|
62
|
+
"eslint": "10.0.2",
|
|
59
63
|
"eslint-flat-config-utils": "^3.0.1",
|
|
60
64
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
61
65
|
"eslint-plugin-react": "7.37.5",
|
|
62
66
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
63
|
-
"eslint-plugin-react-refresh": "0.5.
|
|
67
|
+
"eslint-plugin-react-refresh": "0.5.2"
|
|
64
68
|
},
|
|
65
69
|
"devDependencies": {
|
|
66
|
-
"@siberiacancode/prettier": "*"
|
|
67
|
-
"vite": "^7.3.1",
|
|
68
|
-
"vite-plugin-dts": "^4.5.4"
|
|
70
|
+
"@siberiacancode/prettier": "*"
|
|
69
71
|
},
|
|
70
72
|
"lint-staged": {
|
|
71
73
|
"*.{js,ts}": [
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Awaitable, ConfigNames, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
2
|
-
import { Linter } from 'eslint';
|
|
3
|
-
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
4
|
-
type EslintOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
5
|
-
jsxA11y?: boolean;
|
|
6
|
-
next?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type Eslint = (options?: EslintOptions, ...userConfigs: Awaitable<FlatConfigComposer<any, any> | Linter.Config[] | TypedFlatConfigItem | TypedFlatConfigItem[]>[]) => FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
9
|
-
export declare const eslint: Eslint;
|
|
10
|
-
export {};
|