@tofrankie/eslint 0.2.1 → 0.2.2
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/CHANGELOG.md +4 -0
- package/dist/index.cjs +65 -105
- package/dist/index.mjs +64 -104
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
//#endregion
|
|
24
24
|
let _antfu_eslint_config = require("@antfu/eslint-config");
|
|
25
|
-
_antfu_eslint_config = __toESM(_antfu_eslint_config);
|
|
25
|
+
_antfu_eslint_config = __toESM(_antfu_eslint_config, 1);
|
|
26
26
|
let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
|
|
27
27
|
let defu = require("defu");
|
|
28
28
|
let find_up_simple = require("find-up-simple");
|
|
@@ -125,106 +125,6 @@ const NODE_RULES = { "node/prefer-global/process": "off" };
|
|
|
125
125
|
*/
|
|
126
126
|
const PNPM_RULES = { "pnpm/yaml-enforce-settings": "off" };
|
|
127
127
|
//#endregion
|
|
128
|
-
//#region src/presets/react.ts
|
|
129
|
-
/**
|
|
130
|
-
* - rule: `react/*`
|
|
131
|
-
* - original rule: `react-x/*`
|
|
132
|
-
* - plugin: `@eslint-react/eslint-plugin`
|
|
133
|
-
* @see https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin
|
|
134
|
-
*/
|
|
135
|
-
const REACT_RULES = { "react/set-state-in-effect": "off" };
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region src/presets/stylistic.ts
|
|
138
|
-
/**
|
|
139
|
-
* - rule: `style/*`
|
|
140
|
-
* - original rule: `@stylistic/*`
|
|
141
|
-
* - plugin: `@stylistic/eslint-plugin`
|
|
142
|
-
* @see https://github.com/antfu/eslint-config#stylistic
|
|
143
|
-
* @see https://eslint.style/rules
|
|
144
|
-
*/
|
|
145
|
-
const STYLISTIC_RULES = {
|
|
146
|
-
"style/quotes": [
|
|
147
|
-
"error",
|
|
148
|
-
"single",
|
|
149
|
-
{
|
|
150
|
-
avoidEscape: true,
|
|
151
|
-
allowTemplateLiterals: "avoidEscape"
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
"style/quote-props": ["error", "as-needed"],
|
|
155
|
-
"style/arrow-parens": ["error", "as-needed"],
|
|
156
|
-
"style/brace-style": [
|
|
157
|
-
"error",
|
|
158
|
-
"1tbs",
|
|
159
|
-
{ allowSingleLine: false }
|
|
160
|
-
],
|
|
161
|
-
"style/operator-linebreak": [
|
|
162
|
-
"error",
|
|
163
|
-
"after",
|
|
164
|
-
{ overrides: {
|
|
165
|
-
"?": "before",
|
|
166
|
-
":": "before",
|
|
167
|
-
"|": "before"
|
|
168
|
-
} }
|
|
169
|
-
],
|
|
170
|
-
"style/member-delimiter-style": ["error", {
|
|
171
|
-
multiline: {
|
|
172
|
-
delimiter: "none",
|
|
173
|
-
requireLast: false
|
|
174
|
-
},
|
|
175
|
-
singleline: {
|
|
176
|
-
delimiter: "semi",
|
|
177
|
-
requireLast: false
|
|
178
|
-
},
|
|
179
|
-
multilineDetection: "brackets",
|
|
180
|
-
overrides: { interface: { multiline: {
|
|
181
|
-
delimiter: "none",
|
|
182
|
-
requireLast: false
|
|
183
|
-
} } }
|
|
184
|
-
}],
|
|
185
|
-
"style/comma-dangle": "off",
|
|
186
|
-
"style/indent": "off",
|
|
187
|
-
"style/indent-binary-ops": "off",
|
|
188
|
-
"style/jsx-curly-newline": "off",
|
|
189
|
-
"style/jsx-one-expression-per-line": "off",
|
|
190
|
-
"style/jsx-wrap-multilines": "off",
|
|
191
|
-
"style/multiline-ternary": "off",
|
|
192
|
-
"style/object-curly-spacing": "off"
|
|
193
|
-
};
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region src/presets/test.ts
|
|
196
|
-
/**
|
|
197
|
-
* - rule: `test/*`
|
|
198
|
-
* - original rule: `vitest/*`, `no-only-tests/*`
|
|
199
|
-
* - plugin: `@vitest/eslint-plugin`, `eslint-plugin-no-only-tests`
|
|
200
|
-
* @see https://github.com/antfu/eslint-config#test
|
|
201
|
-
* @see https://github.com/vitest-dev/eslint-plugin-vitest
|
|
202
|
-
* @see https://github.com/levibuzolic/eslint-plugin-no-only-tests
|
|
203
|
-
*/
|
|
204
|
-
const TEST_RULES = { "test/prefer-lowercase-title": "off" };
|
|
205
|
-
//#endregion
|
|
206
|
-
//#region src/presets/typescript.ts
|
|
207
|
-
/**
|
|
208
|
-
* - rule: `ts/*`
|
|
209
|
-
* - original rule: `@typescript-eslint/*`
|
|
210
|
-
* - plugin: `@typescript-eslint/eslint-plugin`
|
|
211
|
-
* @see https://github.com/antfu/eslint-config#typescript
|
|
212
|
-
* @see https://typescript-eslint.io/rules/
|
|
213
|
-
*/
|
|
214
|
-
const TYPESCRIPT_RULES = {
|
|
215
|
-
"no-unused-vars": "off",
|
|
216
|
-
"unused-imports/no-unused-vars": "off",
|
|
217
|
-
"ts/no-unused-vars": ["error", {
|
|
218
|
-
args: "all",
|
|
219
|
-
argsIgnorePattern: "^_",
|
|
220
|
-
caughtErrors: "all",
|
|
221
|
-
caughtErrorsIgnorePattern: "^_",
|
|
222
|
-
destructuredArrayIgnorePattern: "^_",
|
|
223
|
-
varsIgnorePattern: "^_",
|
|
224
|
-
ignoreRestSiblings: true
|
|
225
|
-
}]
|
|
226
|
-
};
|
|
227
|
-
//#endregion
|
|
228
128
|
//#region src/presets/index.ts
|
|
229
129
|
const INTEGRATION_RULE_PRESETS = [
|
|
230
130
|
{
|
|
@@ -244,12 +144,60 @@ const INTEGRATION_RULE_PRESETS = [
|
|
|
244
144
|
{
|
|
245
145
|
key: "react",
|
|
246
146
|
option: "react",
|
|
247
|
-
rules:
|
|
147
|
+
rules: { "react/set-state-in-effect": "off" }
|
|
248
148
|
},
|
|
249
149
|
{
|
|
250
150
|
key: "stylistic",
|
|
251
151
|
option: "stylistic",
|
|
252
|
-
rules:
|
|
152
|
+
rules: {
|
|
153
|
+
"style/quotes": [
|
|
154
|
+
"error",
|
|
155
|
+
"single",
|
|
156
|
+
{
|
|
157
|
+
avoidEscape: true,
|
|
158
|
+
allowTemplateLiterals: "avoidEscape"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"style/quote-props": ["error", "as-needed"],
|
|
162
|
+
"style/arrow-parens": ["error", "as-needed"],
|
|
163
|
+
"style/brace-style": [
|
|
164
|
+
"error",
|
|
165
|
+
"1tbs",
|
|
166
|
+
{ allowSingleLine: false }
|
|
167
|
+
],
|
|
168
|
+
"style/operator-linebreak": [
|
|
169
|
+
"error",
|
|
170
|
+
"after",
|
|
171
|
+
{ overrides: {
|
|
172
|
+
"?": "before",
|
|
173
|
+
":": "before",
|
|
174
|
+
"|": "before"
|
|
175
|
+
} }
|
|
176
|
+
],
|
|
177
|
+
"style/member-delimiter-style": ["error", {
|
|
178
|
+
multiline: {
|
|
179
|
+
delimiter: "none",
|
|
180
|
+
requireLast: false
|
|
181
|
+
},
|
|
182
|
+
singleline: {
|
|
183
|
+
delimiter: "semi",
|
|
184
|
+
requireLast: false
|
|
185
|
+
},
|
|
186
|
+
multilineDetection: "brackets",
|
|
187
|
+
overrides: { interface: { multiline: {
|
|
188
|
+
delimiter: "none",
|
|
189
|
+
requireLast: false
|
|
190
|
+
} } }
|
|
191
|
+
}],
|
|
192
|
+
"style/comma-dangle": "off",
|
|
193
|
+
"style/indent": "off",
|
|
194
|
+
"style/indent-binary-ops": "off",
|
|
195
|
+
"style/jsx-curly-newline": "off",
|
|
196
|
+
"style/jsx-one-expression-per-line": "off",
|
|
197
|
+
"style/jsx-wrap-multilines": "off",
|
|
198
|
+
"style/multiline-ternary": "off",
|
|
199
|
+
"style/object-curly-spacing": "off"
|
|
200
|
+
}
|
|
253
201
|
},
|
|
254
202
|
{
|
|
255
203
|
key: "stylistic",
|
|
@@ -260,12 +208,24 @@ const INTEGRATION_RULE_PRESETS = [
|
|
|
260
208
|
{
|
|
261
209
|
key: "test",
|
|
262
210
|
option: "test",
|
|
263
|
-
rules:
|
|
211
|
+
rules: { "test/prefer-lowercase-title": "off" }
|
|
264
212
|
},
|
|
265
213
|
{
|
|
266
214
|
key: "typescript",
|
|
267
215
|
option: "typescript",
|
|
268
|
-
rules:
|
|
216
|
+
rules: {
|
|
217
|
+
"no-unused-vars": "off",
|
|
218
|
+
"unused-imports/no-unused-vars": "off",
|
|
219
|
+
"ts/no-unused-vars": ["error", {
|
|
220
|
+
args: "all",
|
|
221
|
+
argsIgnorePattern: "^_",
|
|
222
|
+
caughtErrors: "all",
|
|
223
|
+
caughtErrorsIgnorePattern: "^_",
|
|
224
|
+
destructuredArrayIgnorePattern: "^_",
|
|
225
|
+
varsIgnorePattern: "^_",
|
|
226
|
+
ignoreRestSiblings: true
|
|
227
|
+
}]
|
|
228
|
+
}
|
|
269
229
|
},
|
|
270
230
|
{
|
|
271
231
|
key: "vue",
|
package/dist/index.mjs
CHANGED
|
@@ -102,106 +102,6 @@ const NODE_RULES = { "node/prefer-global/process": "off" };
|
|
|
102
102
|
*/
|
|
103
103
|
const PNPM_RULES = { "pnpm/yaml-enforce-settings": "off" };
|
|
104
104
|
//#endregion
|
|
105
|
-
//#region src/presets/react.ts
|
|
106
|
-
/**
|
|
107
|
-
* - rule: `react/*`
|
|
108
|
-
* - original rule: `react-x/*`
|
|
109
|
-
* - plugin: `@eslint-react/eslint-plugin`
|
|
110
|
-
* @see https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin
|
|
111
|
-
*/
|
|
112
|
-
const REACT_RULES = { "react/set-state-in-effect": "off" };
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/presets/stylistic.ts
|
|
115
|
-
/**
|
|
116
|
-
* - rule: `style/*`
|
|
117
|
-
* - original rule: `@stylistic/*`
|
|
118
|
-
* - plugin: `@stylistic/eslint-plugin`
|
|
119
|
-
* @see https://github.com/antfu/eslint-config#stylistic
|
|
120
|
-
* @see https://eslint.style/rules
|
|
121
|
-
*/
|
|
122
|
-
const STYLISTIC_RULES = {
|
|
123
|
-
"style/quotes": [
|
|
124
|
-
"error",
|
|
125
|
-
"single",
|
|
126
|
-
{
|
|
127
|
-
avoidEscape: true,
|
|
128
|
-
allowTemplateLiterals: "avoidEscape"
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
|
-
"style/quote-props": ["error", "as-needed"],
|
|
132
|
-
"style/arrow-parens": ["error", "as-needed"],
|
|
133
|
-
"style/brace-style": [
|
|
134
|
-
"error",
|
|
135
|
-
"1tbs",
|
|
136
|
-
{ allowSingleLine: false }
|
|
137
|
-
],
|
|
138
|
-
"style/operator-linebreak": [
|
|
139
|
-
"error",
|
|
140
|
-
"after",
|
|
141
|
-
{ overrides: {
|
|
142
|
-
"?": "before",
|
|
143
|
-
":": "before",
|
|
144
|
-
"|": "before"
|
|
145
|
-
} }
|
|
146
|
-
],
|
|
147
|
-
"style/member-delimiter-style": ["error", {
|
|
148
|
-
multiline: {
|
|
149
|
-
delimiter: "none",
|
|
150
|
-
requireLast: false
|
|
151
|
-
},
|
|
152
|
-
singleline: {
|
|
153
|
-
delimiter: "semi",
|
|
154
|
-
requireLast: false
|
|
155
|
-
},
|
|
156
|
-
multilineDetection: "brackets",
|
|
157
|
-
overrides: { interface: { multiline: {
|
|
158
|
-
delimiter: "none",
|
|
159
|
-
requireLast: false
|
|
160
|
-
} } }
|
|
161
|
-
}],
|
|
162
|
-
"style/comma-dangle": "off",
|
|
163
|
-
"style/indent": "off",
|
|
164
|
-
"style/indent-binary-ops": "off",
|
|
165
|
-
"style/jsx-curly-newline": "off",
|
|
166
|
-
"style/jsx-one-expression-per-line": "off",
|
|
167
|
-
"style/jsx-wrap-multilines": "off",
|
|
168
|
-
"style/multiline-ternary": "off",
|
|
169
|
-
"style/object-curly-spacing": "off"
|
|
170
|
-
};
|
|
171
|
-
//#endregion
|
|
172
|
-
//#region src/presets/test.ts
|
|
173
|
-
/**
|
|
174
|
-
* - rule: `test/*`
|
|
175
|
-
* - original rule: `vitest/*`, `no-only-tests/*`
|
|
176
|
-
* - plugin: `@vitest/eslint-plugin`, `eslint-plugin-no-only-tests`
|
|
177
|
-
* @see https://github.com/antfu/eslint-config#test
|
|
178
|
-
* @see https://github.com/vitest-dev/eslint-plugin-vitest
|
|
179
|
-
* @see https://github.com/levibuzolic/eslint-plugin-no-only-tests
|
|
180
|
-
*/
|
|
181
|
-
const TEST_RULES = { "test/prefer-lowercase-title": "off" };
|
|
182
|
-
//#endregion
|
|
183
|
-
//#region src/presets/typescript.ts
|
|
184
|
-
/**
|
|
185
|
-
* - rule: `ts/*`
|
|
186
|
-
* - original rule: `@typescript-eslint/*`
|
|
187
|
-
* - plugin: `@typescript-eslint/eslint-plugin`
|
|
188
|
-
* @see https://github.com/antfu/eslint-config#typescript
|
|
189
|
-
* @see https://typescript-eslint.io/rules/
|
|
190
|
-
*/
|
|
191
|
-
const TYPESCRIPT_RULES = {
|
|
192
|
-
"no-unused-vars": "off",
|
|
193
|
-
"unused-imports/no-unused-vars": "off",
|
|
194
|
-
"ts/no-unused-vars": ["error", {
|
|
195
|
-
args: "all",
|
|
196
|
-
argsIgnorePattern: "^_",
|
|
197
|
-
caughtErrors: "all",
|
|
198
|
-
caughtErrorsIgnorePattern: "^_",
|
|
199
|
-
destructuredArrayIgnorePattern: "^_",
|
|
200
|
-
varsIgnorePattern: "^_",
|
|
201
|
-
ignoreRestSiblings: true
|
|
202
|
-
}]
|
|
203
|
-
};
|
|
204
|
-
//#endregion
|
|
205
105
|
//#region src/presets/index.ts
|
|
206
106
|
const INTEGRATION_RULE_PRESETS = [
|
|
207
107
|
{
|
|
@@ -221,12 +121,60 @@ const INTEGRATION_RULE_PRESETS = [
|
|
|
221
121
|
{
|
|
222
122
|
key: "react",
|
|
223
123
|
option: "react",
|
|
224
|
-
rules:
|
|
124
|
+
rules: { "react/set-state-in-effect": "off" }
|
|
225
125
|
},
|
|
226
126
|
{
|
|
227
127
|
key: "stylistic",
|
|
228
128
|
option: "stylistic",
|
|
229
|
-
rules:
|
|
129
|
+
rules: {
|
|
130
|
+
"style/quotes": [
|
|
131
|
+
"error",
|
|
132
|
+
"single",
|
|
133
|
+
{
|
|
134
|
+
avoidEscape: true,
|
|
135
|
+
allowTemplateLiterals: "avoidEscape"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"style/quote-props": ["error", "as-needed"],
|
|
139
|
+
"style/arrow-parens": ["error", "as-needed"],
|
|
140
|
+
"style/brace-style": [
|
|
141
|
+
"error",
|
|
142
|
+
"1tbs",
|
|
143
|
+
{ allowSingleLine: false }
|
|
144
|
+
],
|
|
145
|
+
"style/operator-linebreak": [
|
|
146
|
+
"error",
|
|
147
|
+
"after",
|
|
148
|
+
{ overrides: {
|
|
149
|
+
"?": "before",
|
|
150
|
+
":": "before",
|
|
151
|
+
"|": "before"
|
|
152
|
+
} }
|
|
153
|
+
],
|
|
154
|
+
"style/member-delimiter-style": ["error", {
|
|
155
|
+
multiline: {
|
|
156
|
+
delimiter: "none",
|
|
157
|
+
requireLast: false
|
|
158
|
+
},
|
|
159
|
+
singleline: {
|
|
160
|
+
delimiter: "semi",
|
|
161
|
+
requireLast: false
|
|
162
|
+
},
|
|
163
|
+
multilineDetection: "brackets",
|
|
164
|
+
overrides: { interface: { multiline: {
|
|
165
|
+
delimiter: "none",
|
|
166
|
+
requireLast: false
|
|
167
|
+
} } }
|
|
168
|
+
}],
|
|
169
|
+
"style/comma-dangle": "off",
|
|
170
|
+
"style/indent": "off",
|
|
171
|
+
"style/indent-binary-ops": "off",
|
|
172
|
+
"style/jsx-curly-newline": "off",
|
|
173
|
+
"style/jsx-one-expression-per-line": "off",
|
|
174
|
+
"style/jsx-wrap-multilines": "off",
|
|
175
|
+
"style/multiline-ternary": "off",
|
|
176
|
+
"style/object-curly-spacing": "off"
|
|
177
|
+
}
|
|
230
178
|
},
|
|
231
179
|
{
|
|
232
180
|
key: "stylistic",
|
|
@@ -237,12 +185,24 @@ const INTEGRATION_RULE_PRESETS = [
|
|
|
237
185
|
{
|
|
238
186
|
key: "test",
|
|
239
187
|
option: "test",
|
|
240
|
-
rules:
|
|
188
|
+
rules: { "test/prefer-lowercase-title": "off" }
|
|
241
189
|
},
|
|
242
190
|
{
|
|
243
191
|
key: "typescript",
|
|
244
192
|
option: "typescript",
|
|
245
|
-
rules:
|
|
193
|
+
rules: {
|
|
194
|
+
"no-unused-vars": "off",
|
|
195
|
+
"unused-imports/no-unused-vars": "off",
|
|
196
|
+
"ts/no-unused-vars": ["error", {
|
|
197
|
+
args: "all",
|
|
198
|
+
argsIgnorePattern: "^_",
|
|
199
|
+
caughtErrors: "all",
|
|
200
|
+
caughtErrorsIgnorePattern: "^_",
|
|
201
|
+
destructuredArrayIgnorePattern: "^_",
|
|
202
|
+
varsIgnorePattern: "^_",
|
|
203
|
+
ignoreRestSiblings: true
|
|
204
|
+
}]
|
|
205
|
+
}
|
|
246
206
|
},
|
|
247
207
|
{
|
|
248
208
|
key: "vue",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tofrankie/eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"description": "Shared ESLint configuration",
|
|
6
6
|
"author": "Frankie <1426203851@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"@angular-eslint/eslint-plugin": "^21.3.1",
|
|
56
56
|
"@angular-eslint/eslint-plugin-template": "^21.3.1",
|
|
57
57
|
"@angular-eslint/template-parser": "^21.3.1",
|
|
58
|
-
"@antfu/eslint-config": "^8.
|
|
58
|
+
"@antfu/eslint-config": "^8.3.0",
|
|
59
59
|
"@eslint-react/eslint-plugin": "^3.0.0",
|
|
60
|
-
"@next/eslint-plugin-next": "^16.2.
|
|
60
|
+
"@next/eslint-plugin-next": "^16.2.6",
|
|
61
61
|
"@prettier/plugin-xml": "^3.4.2",
|
|
62
62
|
"@unocss/eslint-plugin": "^66.6.8",
|
|
63
63
|
"defu": "^6.1.7",
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
68
68
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
69
69
|
"eslint-plugin-solid": "^0.14.5",
|
|
70
|
-
"eslint-plugin-svelte": "^3.17.
|
|
70
|
+
"eslint-plugin-svelte": "^3.17.1",
|
|
71
71
|
"find-up-simple": "^1.0.1",
|
|
72
72
|
"local-pkg": "^1.1.2",
|
|
73
73
|
"prettier-plugin-astro": "^0.14.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"eslint": "^10.
|
|
76
|
+
"eslint": "^10.3.0",
|
|
77
77
|
"@tofrankie/tsconfig": "0.0.5"
|
|
78
78
|
},
|
|
79
79
|
"scripts": {
|