@tofrankie/eslint 0.0.14 → 0.0.15
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 +5 -0
- package/README.md +20 -0
- package/dist/index.cjs +13 -36
- package/dist/index.mjs +6 -24
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## eslint@0.0.15 (2026-03-17)
|
|
4
|
+
|
|
5
|
+
- Require Node.js 20.x (`engines: ^20.0.0 || ^22.0.0 || ^24.0.0`)
|
|
6
|
+
- Update `@antfu/eslint-config` to `v7.7.3`
|
|
7
|
+
|
|
3
8
|
## eslint@0.0.14 (2026-03-14)
|
|
4
9
|
|
|
5
10
|
- Move `@antfu/eslint-config` from `peerDependencies` to `dependencies`
|
package/README.md
CHANGED
|
@@ -21,6 +21,26 @@ import { defineConfig } from '@tofrankie/eslint'
|
|
|
21
21
|
export default defineConfig()
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
```js
|
|
25
|
+
import { defineConfig } from '@tofrankie/eslint'
|
|
26
|
+
|
|
27
|
+
export default defineConfig(
|
|
28
|
+
{
|
|
29
|
+
// antfu options...
|
|
30
|
+
ignores: ['node_modules', 'dist'],
|
|
31
|
+
typescript: true,
|
|
32
|
+
react: true,
|
|
33
|
+
rules: {
|
|
34
|
+
// user's custom rules...
|
|
35
|
+
'no-console': 'off',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
// user's eslint flat configs...
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
```
|
|
43
|
+
|
|
24
44
|
## Configuration Examples
|
|
25
45
|
|
|
26
46
|
### Miniapp
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -7,16 +7,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
20
16
|
}
|
|
21
17
|
return to;
|
|
22
18
|
};
|
|
@@ -24,13 +20,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
20
|
value: mod,
|
|
25
21
|
enumerable: true
|
|
26
22
|
}) : target, mod));
|
|
27
|
-
|
|
28
23
|
//#endregion
|
|
29
24
|
let _antfu_eslint_config = require("@antfu/eslint-config");
|
|
30
25
|
let lodash_merge = require("lodash.merge");
|
|
31
26
|
lodash_merge = __toESM(lodash_merge);
|
|
32
27
|
let eslint_plugin_jsdoc = require("eslint-plugin-jsdoc");
|
|
33
|
-
|
|
34
28
|
//#region src/preset-configs/jsdoc.ts
|
|
35
29
|
const SHARED_RULES = {
|
|
36
30
|
"jsdoc/check-syntax": "error",
|
|
@@ -49,7 +43,7 @@ const SHARED_SETTINGS = { tagNamePreference: {
|
|
|
49
43
|
property: "prop",
|
|
50
44
|
returns: "return"
|
|
51
45
|
} };
|
|
52
|
-
const
|
|
46
|
+
const JSDOC_PRESET_CONFIG = [(0, eslint_plugin_jsdoc.jsdoc)({
|
|
53
47
|
config: "flat/recommended-typescript-flavor-error",
|
|
54
48
|
files: [
|
|
55
49
|
"**/*.js",
|
|
@@ -62,8 +56,7 @@ const JSDOC_JS_CONFIG = (0, eslint_plugin_jsdoc.jsdoc)({
|
|
|
62
56
|
"jsdoc/require-param-type": "warn"
|
|
63
57
|
},
|
|
64
58
|
settings: SHARED_SETTINGS
|
|
65
|
-
})
|
|
66
|
-
const JSDOC_TS_CONFIG = (0, eslint_plugin_jsdoc.jsdoc)({
|
|
59
|
+
}), (0, eslint_plugin_jsdoc.jsdoc)({
|
|
67
60
|
config: "flat/recommended-typescript-error",
|
|
68
61
|
files: [
|
|
69
62
|
"**/*.ts",
|
|
@@ -76,9 +69,7 @@ const JSDOC_TS_CONFIG = (0, eslint_plugin_jsdoc.jsdoc)({
|
|
|
76
69
|
"jsdoc/require-param-type": "off"
|
|
77
70
|
},
|
|
78
71
|
settings: SHARED_SETTINGS
|
|
79
|
-
});
|
|
80
|
-
const JSDOC_PRESET_CONFIG = [JSDOC_JS_CONFIG, JSDOC_TS_CONFIG];
|
|
81
|
-
|
|
72
|
+
})];
|
|
82
73
|
//#endregion
|
|
83
74
|
//#region src/preset-configs/typescript.ts
|
|
84
75
|
const TYPESCRIPT_PRESET_CONFIG = {
|
|
@@ -96,7 +87,6 @@ const TYPESCRIPT_PRESET_CONFIG = {
|
|
|
96
87
|
}]
|
|
97
88
|
}
|
|
98
89
|
};
|
|
99
|
-
|
|
100
90
|
//#endregion
|
|
101
91
|
//#region src/preset-rules/antfu.ts
|
|
102
92
|
/**
|
|
@@ -109,7 +99,6 @@ const ANTFU_PRESET_RULES = {
|
|
|
109
99
|
"antfu/if-newline": "off",
|
|
110
100
|
"antfu/consistent-list-newline": "off"
|
|
111
101
|
};
|
|
112
|
-
|
|
113
102
|
//#endregion
|
|
114
103
|
//#region src/preset-rules/base.ts
|
|
115
104
|
/**
|
|
@@ -129,7 +118,6 @@ const BASE_PRESET_RULES = {
|
|
|
129
118
|
ignoreRestSiblings: true
|
|
130
119
|
}]
|
|
131
120
|
};
|
|
132
|
-
|
|
133
121
|
//#endregion
|
|
134
122
|
//#region src/preset-rules/eslint-comments.ts
|
|
135
123
|
/**
|
|
@@ -139,7 +127,6 @@ const BASE_PRESET_RULES = {
|
|
|
139
127
|
* @see https://github.com/eslint-community/eslint-plugin-eslint-comments
|
|
140
128
|
*/
|
|
141
129
|
const ESLINT_COMMENTS_PRESET_RULES = { "eslint-comments/no-unlimited-disable": "off" };
|
|
142
|
-
|
|
143
130
|
//#endregion
|
|
144
131
|
//#region src/preset-rules/node.ts
|
|
145
132
|
/**
|
|
@@ -150,7 +137,6 @@ const ESLINT_COMMENTS_PRESET_RULES = { "eslint-comments/no-unlimited-disable": "
|
|
|
150
137
|
* @see https://github.com/eslint-community/eslint-plugin-n
|
|
151
138
|
*/
|
|
152
139
|
const NODE_PRESET_RULES = { "node/prefer-global/process": "off" };
|
|
153
|
-
|
|
154
140
|
//#endregion
|
|
155
141
|
//#region src/preset-rules/pnpm.ts
|
|
156
142
|
/**
|
|
@@ -160,7 +146,6 @@ const NODE_PRESET_RULES = { "node/prefer-global/process": "off" };
|
|
|
160
146
|
* @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm
|
|
161
147
|
*/
|
|
162
148
|
const PNPM_PRESET_RULES = { "pnpm/yaml-enforce-settings": "off" };
|
|
163
|
-
|
|
164
149
|
//#endregion
|
|
165
150
|
//#region src/preset-rules/react.ts
|
|
166
151
|
/**
|
|
@@ -169,7 +154,6 @@ const PNPM_PRESET_RULES = { "pnpm/yaml-enforce-settings": "off" };
|
|
|
169
154
|
* @see https://www.npmjs.com/package/eslint-plugin-react-hooks-extra
|
|
170
155
|
*/
|
|
171
156
|
const REACT_PRESET_RULES = { "react-hooks-extra/no-direct-set-state-in-use-effect": "off" };
|
|
172
|
-
|
|
173
157
|
//#endregion
|
|
174
158
|
//#region src/preset-rules/style.ts
|
|
175
159
|
/**
|
|
@@ -231,7 +215,6 @@ const STYLE_PRESET_RULES = {
|
|
|
231
215
|
"style/jsx-curly-newline": "off",
|
|
232
216
|
"style/jsx-one-expression-per-line": "off"
|
|
233
217
|
};
|
|
234
|
-
|
|
235
218
|
//#endregion
|
|
236
219
|
//#region src/preset-rules/test.ts
|
|
237
220
|
/**
|
|
@@ -243,7 +226,6 @@ const STYLE_PRESET_RULES = {
|
|
|
243
226
|
* @see https://github.com/levibuzolic/eslint-plugin-no-only-tests
|
|
244
227
|
*/
|
|
245
228
|
const TEST_PRESET_RULES = { "test/prefer-lowercase-title": "off" };
|
|
246
|
-
|
|
247
229
|
//#endregion
|
|
248
230
|
//#region src/preset-rules/vue.ts
|
|
249
231
|
/**
|
|
@@ -265,10 +247,7 @@ const VUE_PRESET_RULES = {
|
|
|
265
247
|
math: "always"
|
|
266
248
|
}]
|
|
267
249
|
};
|
|
268
|
-
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region src/preset-rules/index.ts
|
|
271
|
-
const ALL_PRESET_RULES = {
|
|
250
|
+
({
|
|
272
251
|
...ANTFU_PRESET_RULES,
|
|
273
252
|
...BASE_PRESET_RULES,
|
|
274
253
|
...ESLINT_COMMENTS_PRESET_RULES,
|
|
@@ -276,7 +255,7 @@ const ALL_PRESET_RULES = {
|
|
|
276
255
|
...PNPM_PRESET_RULES,
|
|
277
256
|
...STYLE_PRESET_RULES,
|
|
278
257
|
...TEST_PRESET_RULES
|
|
279
|
-
};
|
|
258
|
+
});
|
|
280
259
|
const PRESET_PREDICATES = [
|
|
281
260
|
{ rules: BASE_PRESET_RULES },
|
|
282
261
|
{ rules: ESLINT_COMMENTS_PRESET_RULES },
|
|
@@ -324,7 +303,6 @@ function buildPresetRules(resolvedOptions) {
|
|
|
324
303
|
function notFalse(key) {
|
|
325
304
|
return (options) => options[key] !== false;
|
|
326
305
|
}
|
|
327
|
-
|
|
328
306
|
//#endregion
|
|
329
307
|
//#region src/config.ts
|
|
330
308
|
/**
|
|
@@ -350,6 +328,5 @@ function defineConfig(antfuOptions, ...userFlatConfigs) {
|
|
|
350
328
|
if (mergedOptions.jsdoc !== false) presetConfigs.push(...JSDOC_PRESET_CONFIG);
|
|
351
329
|
return (0, _antfu_eslint_config.antfu)(resolvedOptions, ...presetConfigs, ...userFlatConfigs);
|
|
352
330
|
}
|
|
353
|
-
|
|
354
331
|
//#endregion
|
|
355
|
-
exports.defineConfig = defineConfig;
|
|
332
|
+
exports.defineConfig = defineConfig;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { antfu } from "@antfu/eslint-config";
|
|
2
2
|
import merge from "lodash.merge";
|
|
3
3
|
import { jsdoc } from "eslint-plugin-jsdoc";
|
|
4
|
-
|
|
5
4
|
//#region src/preset-configs/jsdoc.ts
|
|
6
5
|
const SHARED_RULES = {
|
|
7
6
|
"jsdoc/check-syntax": "error",
|
|
@@ -20,7 +19,7 @@ const SHARED_SETTINGS = { tagNamePreference: {
|
|
|
20
19
|
property: "prop",
|
|
21
20
|
returns: "return"
|
|
22
21
|
} };
|
|
23
|
-
const
|
|
22
|
+
const JSDOC_PRESET_CONFIG = [jsdoc({
|
|
24
23
|
config: "flat/recommended-typescript-flavor-error",
|
|
25
24
|
files: [
|
|
26
25
|
"**/*.js",
|
|
@@ -33,8 +32,7 @@ const JSDOC_JS_CONFIG = jsdoc({
|
|
|
33
32
|
"jsdoc/require-param-type": "warn"
|
|
34
33
|
},
|
|
35
34
|
settings: SHARED_SETTINGS
|
|
36
|
-
})
|
|
37
|
-
const JSDOC_TS_CONFIG = jsdoc({
|
|
35
|
+
}), jsdoc({
|
|
38
36
|
config: "flat/recommended-typescript-error",
|
|
39
37
|
files: [
|
|
40
38
|
"**/*.ts",
|
|
@@ -47,9 +45,7 @@ const JSDOC_TS_CONFIG = jsdoc({
|
|
|
47
45
|
"jsdoc/require-param-type": "off"
|
|
48
46
|
},
|
|
49
47
|
settings: SHARED_SETTINGS
|
|
50
|
-
});
|
|
51
|
-
const JSDOC_PRESET_CONFIG = [JSDOC_JS_CONFIG, JSDOC_TS_CONFIG];
|
|
52
|
-
|
|
48
|
+
})];
|
|
53
49
|
//#endregion
|
|
54
50
|
//#region src/preset-configs/typescript.ts
|
|
55
51
|
const TYPESCRIPT_PRESET_CONFIG = {
|
|
@@ -67,7 +63,6 @@ const TYPESCRIPT_PRESET_CONFIG = {
|
|
|
67
63
|
}]
|
|
68
64
|
}
|
|
69
65
|
};
|
|
70
|
-
|
|
71
66
|
//#endregion
|
|
72
67
|
//#region src/preset-rules/antfu.ts
|
|
73
68
|
/**
|
|
@@ -80,7 +75,6 @@ const ANTFU_PRESET_RULES = {
|
|
|
80
75
|
"antfu/if-newline": "off",
|
|
81
76
|
"antfu/consistent-list-newline": "off"
|
|
82
77
|
};
|
|
83
|
-
|
|
84
78
|
//#endregion
|
|
85
79
|
//#region src/preset-rules/base.ts
|
|
86
80
|
/**
|
|
@@ -100,7 +94,6 @@ const BASE_PRESET_RULES = {
|
|
|
100
94
|
ignoreRestSiblings: true
|
|
101
95
|
}]
|
|
102
96
|
};
|
|
103
|
-
|
|
104
97
|
//#endregion
|
|
105
98
|
//#region src/preset-rules/eslint-comments.ts
|
|
106
99
|
/**
|
|
@@ -110,7 +103,6 @@ const BASE_PRESET_RULES = {
|
|
|
110
103
|
* @see https://github.com/eslint-community/eslint-plugin-eslint-comments
|
|
111
104
|
*/
|
|
112
105
|
const ESLINT_COMMENTS_PRESET_RULES = { "eslint-comments/no-unlimited-disable": "off" };
|
|
113
|
-
|
|
114
106
|
//#endregion
|
|
115
107
|
//#region src/preset-rules/node.ts
|
|
116
108
|
/**
|
|
@@ -121,7 +113,6 @@ const ESLINT_COMMENTS_PRESET_RULES = { "eslint-comments/no-unlimited-disable": "
|
|
|
121
113
|
* @see https://github.com/eslint-community/eslint-plugin-n
|
|
122
114
|
*/
|
|
123
115
|
const NODE_PRESET_RULES = { "node/prefer-global/process": "off" };
|
|
124
|
-
|
|
125
116
|
//#endregion
|
|
126
117
|
//#region src/preset-rules/pnpm.ts
|
|
127
118
|
/**
|
|
@@ -131,7 +122,6 @@ const NODE_PRESET_RULES = { "node/prefer-global/process": "off" };
|
|
|
131
122
|
* @see https://github.com/antfu/pnpm-workspace-utils/tree/main/packages/eslint-plugin-pnpm
|
|
132
123
|
*/
|
|
133
124
|
const PNPM_PRESET_RULES = { "pnpm/yaml-enforce-settings": "off" };
|
|
134
|
-
|
|
135
125
|
//#endregion
|
|
136
126
|
//#region src/preset-rules/react.ts
|
|
137
127
|
/**
|
|
@@ -140,7 +130,6 @@ const PNPM_PRESET_RULES = { "pnpm/yaml-enforce-settings": "off" };
|
|
|
140
130
|
* @see https://www.npmjs.com/package/eslint-plugin-react-hooks-extra
|
|
141
131
|
*/
|
|
142
132
|
const REACT_PRESET_RULES = { "react-hooks-extra/no-direct-set-state-in-use-effect": "off" };
|
|
143
|
-
|
|
144
133
|
//#endregion
|
|
145
134
|
//#region src/preset-rules/style.ts
|
|
146
135
|
/**
|
|
@@ -202,7 +191,6 @@ const STYLE_PRESET_RULES = {
|
|
|
202
191
|
"style/jsx-curly-newline": "off",
|
|
203
192
|
"style/jsx-one-expression-per-line": "off"
|
|
204
193
|
};
|
|
205
|
-
|
|
206
194
|
//#endregion
|
|
207
195
|
//#region src/preset-rules/test.ts
|
|
208
196
|
/**
|
|
@@ -214,7 +202,6 @@ const STYLE_PRESET_RULES = {
|
|
|
214
202
|
* @see https://github.com/levibuzolic/eslint-plugin-no-only-tests
|
|
215
203
|
*/
|
|
216
204
|
const TEST_PRESET_RULES = { "test/prefer-lowercase-title": "off" };
|
|
217
|
-
|
|
218
205
|
//#endregion
|
|
219
206
|
//#region src/preset-rules/vue.ts
|
|
220
207
|
/**
|
|
@@ -236,10 +223,7 @@ const VUE_PRESET_RULES = {
|
|
|
236
223
|
math: "always"
|
|
237
224
|
}]
|
|
238
225
|
};
|
|
239
|
-
|
|
240
|
-
//#endregion
|
|
241
|
-
//#region src/preset-rules/index.ts
|
|
242
|
-
const ALL_PRESET_RULES = {
|
|
226
|
+
({
|
|
243
227
|
...ANTFU_PRESET_RULES,
|
|
244
228
|
...BASE_PRESET_RULES,
|
|
245
229
|
...ESLINT_COMMENTS_PRESET_RULES,
|
|
@@ -247,7 +231,7 @@ const ALL_PRESET_RULES = {
|
|
|
247
231
|
...PNPM_PRESET_RULES,
|
|
248
232
|
...STYLE_PRESET_RULES,
|
|
249
233
|
...TEST_PRESET_RULES
|
|
250
|
-
};
|
|
234
|
+
});
|
|
251
235
|
const PRESET_PREDICATES = [
|
|
252
236
|
{ rules: BASE_PRESET_RULES },
|
|
253
237
|
{ rules: ESLINT_COMMENTS_PRESET_RULES },
|
|
@@ -295,7 +279,6 @@ function buildPresetRules(resolvedOptions) {
|
|
|
295
279
|
function notFalse(key) {
|
|
296
280
|
return (options) => options[key] !== false;
|
|
297
281
|
}
|
|
298
|
-
|
|
299
282
|
//#endregion
|
|
300
283
|
//#region src/config.ts
|
|
301
284
|
/**
|
|
@@ -321,6 +304,5 @@ function defineConfig(antfuOptions, ...userFlatConfigs) {
|
|
|
321
304
|
if (mergedOptions.jsdoc !== false) presetConfigs.push(...JSDOC_PRESET_CONFIG);
|
|
322
305
|
return antfu(resolvedOptions, ...presetConfigs, ...userFlatConfigs);
|
|
323
306
|
}
|
|
324
|
-
|
|
325
307
|
//#endregion
|
|
326
|
-
export { defineConfig };
|
|
308
|
+
export { defineConfig };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tofrankie/eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.15",
|
|
5
5
|
"description": "Shared ESLint configuration",
|
|
6
6
|
"author": "Frankie <1426203851@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": "
|
|
41
|
+
"node": "^20.0.0 || ^22.0.0 || ^24.0.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"eslint": "^9.10.0 || ^10.0.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@antfu/eslint-config": "^7.7.
|
|
47
|
+
"@antfu/eslint-config": "^7.7.3",
|
|
48
48
|
"@eslint-react/eslint-plugin": "^2.13.0",
|
|
49
49
|
"eslint-plugin-format": "^2.0.1",
|
|
50
50
|
"eslint-plugin-jsdoc": "^62.8.0",
|