@tofrankie/eslint 0.0.15 → 0.0.16
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 +6 -0
- package/README.md +3 -1
- package/dist/index.cjs +34 -3
- package/dist/index.mjs +34 -3
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## eslint@0.0.16 (2026-03-24)
|
|
4
|
+
|
|
5
|
+
- Add `unicorn/number-literal-case` rule
|
|
6
|
+
- Update `style/operator-linebreak` rule
|
|
7
|
+
- Disable `e18e/ban-dependencies`、`e18e/prefer-array-to-sorted`、`e18e/prefer-static-regex` rules
|
|
8
|
+
|
|
3
9
|
## eslint@0.0.15 (2026-03-17)
|
|
4
10
|
|
|
5
11
|
- Require Node.js 20.x (`engines: ^20.0.0 || ^22.0.0 || ^24.0.0`)
|
package/README.md
CHANGED
|
@@ -21,12 +21,14 @@ import { defineConfig } from '@tofrankie/eslint'
|
|
|
21
21
|
export default defineConfig()
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
更多自定义
|
|
25
|
+
|
|
24
26
|
```js
|
|
25
27
|
import { defineConfig } from '@tofrankie/eslint'
|
|
26
28
|
|
|
27
29
|
export default defineConfig(
|
|
28
30
|
{
|
|
29
|
-
// antfu options...
|
|
31
|
+
// antfu options... see: https://github.com/antfu/eslint-config#customization
|
|
30
32
|
ignores: ['node_modules', 'dist'],
|
|
31
33
|
typescript: true,
|
|
32
34
|
react: true,
|
package/dist/index.cjs
CHANGED
|
@@ -119,6 +119,18 @@ const BASE_PRESET_RULES = {
|
|
|
119
119
|
}]
|
|
120
120
|
};
|
|
121
121
|
//#endregion
|
|
122
|
+
//#region src/preset-rules/e8e.ts
|
|
123
|
+
/**
|
|
124
|
+
* - rule: `e8e/*`
|
|
125
|
+
* - plugin: `@e18e/eslint-plugin`
|
|
126
|
+
* @see https://github.com/e18e/eslint-plugin
|
|
127
|
+
*/
|
|
128
|
+
const E8E_PRESET_RULES = {
|
|
129
|
+
"e18e/ban-dependencies": "off",
|
|
130
|
+
"e18e/prefer-array-to-sorted": "off",
|
|
131
|
+
"e18e/prefer-static-regex": "off"
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
122
134
|
//#region src/preset-rules/eslint-comments.ts
|
|
123
135
|
/**
|
|
124
136
|
* - rule: `eslint-comments/*`
|
|
@@ -189,7 +201,12 @@ const STYLE_PRESET_RULES = {
|
|
|
189
201
|
"=": "after",
|
|
190
202
|
"+": "after",
|
|
191
203
|
"-": "after",
|
|
192
|
-
"
|
|
204
|
+
"*": "after",
|
|
205
|
+
"&": "after",
|
|
206
|
+
"<": "after",
|
|
207
|
+
"<=": "after",
|
|
208
|
+
">": "after",
|
|
209
|
+
">=": "after"
|
|
193
210
|
} }
|
|
194
211
|
],
|
|
195
212
|
"style/member-delimiter-style": ["error", {
|
|
@@ -227,6 +244,14 @@ const STYLE_PRESET_RULES = {
|
|
|
227
244
|
*/
|
|
228
245
|
const TEST_PRESET_RULES = { "test/prefer-lowercase-title": "off" };
|
|
229
246
|
//#endregion
|
|
247
|
+
//#region src/preset-rules/unicorn.ts
|
|
248
|
+
/**
|
|
249
|
+
* - rule: `unicorn/*`
|
|
250
|
+
* - plugin: `eslint-plugin-unicorn`
|
|
251
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
252
|
+
*/
|
|
253
|
+
const UNICORN_PRESET_RULES = { "unicorn/number-literal-case": ["error", { hexadecimalValue: "lowercase" }] };
|
|
254
|
+
//#endregion
|
|
230
255
|
//#region src/preset-rules/vue.ts
|
|
231
256
|
/**
|
|
232
257
|
* - rule: `vue/*`
|
|
@@ -250,11 +275,15 @@ const VUE_PRESET_RULES = {
|
|
|
250
275
|
({
|
|
251
276
|
...ANTFU_PRESET_RULES,
|
|
252
277
|
...BASE_PRESET_RULES,
|
|
278
|
+
...E8E_PRESET_RULES,
|
|
253
279
|
...ESLINT_COMMENTS_PRESET_RULES,
|
|
254
280
|
...NODE_PRESET_RULES,
|
|
255
281
|
...PNPM_PRESET_RULES,
|
|
282
|
+
...REACT_PRESET_RULES,
|
|
256
283
|
...STYLE_PRESET_RULES,
|
|
257
|
-
...TEST_PRESET_RULES
|
|
284
|
+
...TEST_PRESET_RULES,
|
|
285
|
+
...UNICORN_PRESET_RULES,
|
|
286
|
+
...VUE_PRESET_RULES
|
|
258
287
|
});
|
|
259
288
|
const PRESET_PREDICATES = [
|
|
260
289
|
{ rules: BASE_PRESET_RULES },
|
|
@@ -286,7 +315,9 @@ const PRESET_PREDICATES = [
|
|
|
286
315
|
{
|
|
287
316
|
rules: REACT_PRESET_RULES,
|
|
288
317
|
predicate: (options) => options.react === true
|
|
289
|
-
}
|
|
318
|
+
},
|
|
319
|
+
{ rules: E8E_PRESET_RULES },
|
|
320
|
+
{ rules: UNICORN_PRESET_RULES }
|
|
290
321
|
];
|
|
291
322
|
function buildPresetRules(resolvedOptions) {
|
|
292
323
|
return PRESET_PREDICATES.reduce((acc, { rules, predicate }) => {
|
package/dist/index.mjs
CHANGED
|
@@ -95,6 +95,18 @@ const BASE_PRESET_RULES = {
|
|
|
95
95
|
}]
|
|
96
96
|
};
|
|
97
97
|
//#endregion
|
|
98
|
+
//#region src/preset-rules/e8e.ts
|
|
99
|
+
/**
|
|
100
|
+
* - rule: `e8e/*`
|
|
101
|
+
* - plugin: `@e18e/eslint-plugin`
|
|
102
|
+
* @see https://github.com/e18e/eslint-plugin
|
|
103
|
+
*/
|
|
104
|
+
const E8E_PRESET_RULES = {
|
|
105
|
+
"e18e/ban-dependencies": "off",
|
|
106
|
+
"e18e/prefer-array-to-sorted": "off",
|
|
107
|
+
"e18e/prefer-static-regex": "off"
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
98
110
|
//#region src/preset-rules/eslint-comments.ts
|
|
99
111
|
/**
|
|
100
112
|
* - rule: `eslint-comments/*`
|
|
@@ -165,7 +177,12 @@ const STYLE_PRESET_RULES = {
|
|
|
165
177
|
"=": "after",
|
|
166
178
|
"+": "after",
|
|
167
179
|
"-": "after",
|
|
168
|
-
"
|
|
180
|
+
"*": "after",
|
|
181
|
+
"&": "after",
|
|
182
|
+
"<": "after",
|
|
183
|
+
"<=": "after",
|
|
184
|
+
">": "after",
|
|
185
|
+
">=": "after"
|
|
169
186
|
} }
|
|
170
187
|
],
|
|
171
188
|
"style/member-delimiter-style": ["error", {
|
|
@@ -203,6 +220,14 @@ const STYLE_PRESET_RULES = {
|
|
|
203
220
|
*/
|
|
204
221
|
const TEST_PRESET_RULES = { "test/prefer-lowercase-title": "off" };
|
|
205
222
|
//#endregion
|
|
223
|
+
//#region src/preset-rules/unicorn.ts
|
|
224
|
+
/**
|
|
225
|
+
* - rule: `unicorn/*`
|
|
226
|
+
* - plugin: `eslint-plugin-unicorn`
|
|
227
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
228
|
+
*/
|
|
229
|
+
const UNICORN_PRESET_RULES = { "unicorn/number-literal-case": ["error", { hexadecimalValue: "lowercase" }] };
|
|
230
|
+
//#endregion
|
|
206
231
|
//#region src/preset-rules/vue.ts
|
|
207
232
|
/**
|
|
208
233
|
* - rule: `vue/*`
|
|
@@ -226,11 +251,15 @@ const VUE_PRESET_RULES = {
|
|
|
226
251
|
({
|
|
227
252
|
...ANTFU_PRESET_RULES,
|
|
228
253
|
...BASE_PRESET_RULES,
|
|
254
|
+
...E8E_PRESET_RULES,
|
|
229
255
|
...ESLINT_COMMENTS_PRESET_RULES,
|
|
230
256
|
...NODE_PRESET_RULES,
|
|
231
257
|
...PNPM_PRESET_RULES,
|
|
258
|
+
...REACT_PRESET_RULES,
|
|
232
259
|
...STYLE_PRESET_RULES,
|
|
233
|
-
...TEST_PRESET_RULES
|
|
260
|
+
...TEST_PRESET_RULES,
|
|
261
|
+
...UNICORN_PRESET_RULES,
|
|
262
|
+
...VUE_PRESET_RULES
|
|
234
263
|
});
|
|
235
264
|
const PRESET_PREDICATES = [
|
|
236
265
|
{ rules: BASE_PRESET_RULES },
|
|
@@ -262,7 +291,9 @@ const PRESET_PREDICATES = [
|
|
|
262
291
|
{
|
|
263
292
|
rules: REACT_PRESET_RULES,
|
|
264
293
|
predicate: (options) => options.react === true
|
|
265
|
-
}
|
|
294
|
+
},
|
|
295
|
+
{ rules: E8E_PRESET_RULES },
|
|
296
|
+
{ rules: UNICORN_PRESET_RULES }
|
|
266
297
|
];
|
|
267
298
|
function buildPresetRules(resolvedOptions) {
|
|
268
299
|
return PRESET_PREDICATES.reduce((acc, { rules, predicate }) => {
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tofrankie/eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.16",
|
|
5
5
|
"description": "Shared ESLint configuration",
|
|
6
6
|
"author": "Frankie <1426203851@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/tofrankie/config/tree/main/packages/eslint",
|
|
9
|
-
"repository":
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/tofrankie/config.git",
|
|
12
|
+
"directory": "packages/eslint"
|
|
13
|
+
},
|
|
10
14
|
"bugs": "https://github.com/tofrankie/config/issues",
|
|
11
15
|
"keywords": [
|
|
12
16
|
"eslint",
|
|
@@ -57,6 +61,7 @@
|
|
|
57
61
|
"eslint": "^9.39.4"
|
|
58
62
|
},
|
|
59
63
|
"scripts": {
|
|
64
|
+
"dev": "tsdown --watch",
|
|
60
65
|
"build": "tsdown",
|
|
61
66
|
"publint": "publint"
|
|
62
67
|
}
|