@zjutjh/eslint-config 0.7.2 → 0.7.4
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/README.md +27 -4
- package/dist/index.d.ts +33 -31
- package/dist/index.js +433 -509
- package/package.json +38 -38
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ zjutjh 的 ESLint 配置,适用于 JS, TS, Vue3 等项目。
|
|
|
5
5
|
## 使用方式
|
|
6
6
|
|
|
7
7
|
> [!IMPORTANT]
|
|
8
|
-
> ESLint 版本需要 ^9.9.0 以上,Node 版本需要 ^
|
|
8
|
+
> ESLint 版本需要 ^9.9.0 以上,Node 版本需要 ^20.19.0 以上
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
11
|
# 确保你已经安装了 eslint
|
|
@@ -24,12 +24,16 @@ import zjutjh from "@zjutjh/eslint-config";
|
|
|
24
24
|
export default zjutjh();
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
### 命令行配置
|
|
28
|
+
|
|
29
|
+
本地的 git hooks 以及 CI 环境需要用命令来执行 lint。
|
|
30
|
+
|
|
27
31
|
在 `package.json` 中添加如下命令。
|
|
28
32
|
|
|
29
33
|
```json
|
|
30
34
|
{
|
|
31
35
|
"scripts": {
|
|
32
|
-
"lint": "eslint
|
|
36
|
+
"lint": "eslint"
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
```
|
|
@@ -41,10 +45,30 @@ $ npm run lint
|
|
|
41
45
|
```
|
|
42
46
|
|
|
43
47
|
> [!NOTE]
|
|
44
|
-
> 项目第一次接入时运行 `eslint
|
|
48
|
+
> 项目第一次接入时运行 `eslint` 可能会有安装依赖的交互式命令,按照提示完成依赖安装即可。
|
|
45
49
|
>
|
|
46
50
|
> 在每次修改依赖配置后,最好也运行一遍 lint 命令,部分配置项可能需要安装额外的依赖。
|
|
47
51
|
|
|
52
|
+
### 编辑器配置
|
|
53
|
+
|
|
54
|
+
> [!IMPORTANT]
|
|
55
|
+
> 配置编辑器插件之前,请先行一遍 lint 命令,安装所需的依赖。
|
|
56
|
+
|
|
57
|
+
常见的 IDE 有 VSCode 或者类似的套壳 IDE(如 Cursor, Trae 等),除了要安装 [eslint 插件](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 之外,为了 lint JavaScript 以外的文件,还需要在项目里面给插件配置 lint 范围。
|
|
58
|
+
|
|
59
|
+
```jsonc
|
|
60
|
+
// 可以参考仓库下的 .vscode/settings.json
|
|
61
|
+
// @filename .vscode/settings.json
|
|
62
|
+
{
|
|
63
|
+
"eslint.validate": [
|
|
64
|
+
"vue",
|
|
65
|
+
"typescript"
|
|
66
|
+
// JSX 项目要配置
|
|
67
|
+
// "typescriptreact"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
48
72
|
大部分场景到这里就能使用了,不需要额外的配置。如果你想自定义一些配置,请往下看。
|
|
49
73
|
|
|
50
74
|
### 自定义配置
|
|
@@ -138,7 +162,6 @@ stylistic 只对 js(x) 和 ts(x) 进行格式化,而 prettier 还对其他文
|
|
|
138
162
|
如果你要**在编辑器中**自动格式化这些文件,需要配置编辑器来允许 eslint 校验这些类型的文件。
|
|
139
163
|
|
|
140
164
|
```jsonc
|
|
141
|
-
// 可以参考仓库下的 .vscode/settings.json 给 vscode 配置
|
|
142
165
|
// @filename .vscode/settings.json
|
|
143
166
|
{
|
|
144
167
|
"prettier.enable": false, // 如果安装了 prettier 插件,需要在项目中关闭
|
package/dist/index.d.ts
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Options } from
|
|
1
|
+
import { ParserOptions } from "@typescript-eslint/parser";
|
|
2
|
+
import { Linter } from "eslint";
|
|
3
|
+
import { Options } from "prettier";
|
|
4
4
|
|
|
5
|
+
//#region src/types.d.ts
|
|
5
6
|
interface OverridesConfigs {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
vue?: Linter.RulesRecord;
|
|
8
|
+
ts?: Linter.RulesRecord;
|
|
9
|
+
stylistic?: Linter.RulesRecord;
|
|
10
|
+
react?: Linter.RulesRecord;
|
|
10
11
|
}
|
|
11
12
|
interface OptionsConfig extends OptionsComponentExts {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
vue?: boolean;
|
|
14
|
+
ts?: boolean | OptionsTypeScriptParserOptions;
|
|
15
|
+
taro?: boolean;
|
|
16
|
+
jsx?: boolean;
|
|
17
|
+
react?: boolean;
|
|
18
|
+
prettier?: boolean | OptionsPrettier;
|
|
19
|
+
ignores?: string[];
|
|
20
|
+
overrides?: OverridesConfigs;
|
|
20
21
|
}
|
|
21
22
|
interface OptionsComponentExts {
|
|
22
|
-
|
|
23
|
+
componentExts?: string[];
|
|
23
24
|
}
|
|
24
25
|
interface OptionsTypeScriptParserOptions {
|
|
25
|
-
|
|
26
|
+
parserOptions?: Partial<ParserOptions>;
|
|
26
27
|
}
|
|
27
28
|
interface OptionsPrettier {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
prettierSelfOptions?: Options;
|
|
30
|
+
/** 对哪些文件启用 prettier,默认全部启用 */
|
|
31
|
+
lang?: {
|
|
32
|
+
/** js, ts, vue 文件 */
|
|
33
|
+
es: boolean;
|
|
34
|
+
/** css, less, scss 文件 */
|
|
35
|
+
css: boolean;
|
|
36
|
+
html: boolean;
|
|
37
|
+
/** json, json5, jsonc 文件 */
|
|
38
|
+
json: boolean;
|
|
39
|
+
};
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/factory.d.ts
|
|
41
43
|
declare function zjutjh(options?: OptionsConfig, ...userConfigs: Awaited<Linter.Config[]>): Promise<Linter.Config<Linter.RulesRecord>[]>;
|
|
42
|
-
|
|
43
|
-
export { zjutjh as default };
|
|
44
|
+
//#endregion
|
|
45
|
+
export { zjutjh as default };
|
package/dist/index.js
CHANGED
|
@@ -1,552 +1,476 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import { isPackageExists } from "local-pkg";
|
|
2
|
+
import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
|
|
3
|
+
import eslintJS from "@eslint/js";
|
|
4
|
+
import globals from "globals";
|
|
5
|
+
import pluginStylistic from "@stylistic/eslint-plugin";
|
|
3
6
|
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
7
|
+
//#region src/globs.ts
|
|
8
|
+
const GLOB_VUE = "**/*.vue";
|
|
9
|
+
const GLOB_JS = "**/*.?([cm])js";
|
|
10
|
+
const GLOB_TS = "**/*.?([cm])ts";
|
|
11
|
+
const GLOB_JSX = "**/*.?([cm])jsx";
|
|
12
|
+
const GLOB_TSX = "**/*.?([cm])tsx";
|
|
13
|
+
const GLOB_CSS = "**/*.css";
|
|
14
|
+
const GLOB_SCSS = "**/*.scss";
|
|
15
|
+
const GLOB_LESS = "**/*.less";
|
|
16
|
+
const GLOB_HTML = "**/*.html";
|
|
17
|
+
const GLOB_JSON = "**/*.json";
|
|
18
|
+
const GLOB_JSON5 = "**/*.json5";
|
|
19
|
+
const GLOB_JSONC = "**/*.jsonc";
|
|
20
|
+
/**
|
|
21
|
+
* @see https://github.com/antfu/eslint-config/blob/04ae86dd43e86d8b925555d85adf080494efeab3/src/globs.ts#L56
|
|
22
|
+
*/
|
|
23
|
+
const GLOBS_EXCLUDES = [
|
|
24
|
+
"**/node_modules",
|
|
25
|
+
"**/dist",
|
|
26
|
+
"**/package-lock.json",
|
|
27
|
+
"**/yarn.lock",
|
|
28
|
+
"**/pnpm-lock.yaml",
|
|
29
|
+
"**/bun.lockb",
|
|
30
|
+
"**/output",
|
|
31
|
+
"**/coverage",
|
|
32
|
+
"**/temp",
|
|
33
|
+
"**/.temp",
|
|
34
|
+
"**/tmp",
|
|
35
|
+
"**/.tmp",
|
|
36
|
+
"**/.history",
|
|
37
|
+
"**/.vitepress/cache",
|
|
38
|
+
"**/.nuxt",
|
|
39
|
+
"**/.next",
|
|
40
|
+
"**/.svelte-kit",
|
|
41
|
+
"**/.vercel",
|
|
42
|
+
"**/.changeset",
|
|
43
|
+
"**/.idea",
|
|
44
|
+
"**/.cache",
|
|
45
|
+
"**/.output",
|
|
46
|
+
"**/.vite-inspect",
|
|
47
|
+
"**/.yarn",
|
|
48
|
+
"**/vite.config.*.timestamp-*",
|
|
49
|
+
"**/CHANGELOG*.md",
|
|
50
|
+
"**/*.min.*",
|
|
51
|
+
"**/LICENSE*",
|
|
52
|
+
"**/__snapshots__",
|
|
53
|
+
"**/auto-import?(s).d.ts",
|
|
54
|
+
"**/components.d.ts"
|
|
49
55
|
];
|
|
50
56
|
|
|
51
|
-
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/configs/ignores.ts
|
|
52
59
|
function ignores(options) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
...GLOBS_EXCLUDES,
|
|
58
|
-
...options?.userIgnores ?? []
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
];
|
|
60
|
+
return [{
|
|
61
|
+
name: "zjutjh/ignores",
|
|
62
|
+
ignores: [...GLOBS_EXCLUDES, ...options?.userIgnores ?? []]
|
|
63
|
+
}];
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/configs/imports.ts
|
|
66
68
|
function imports() {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"simple-import-sort/imports": "error",
|
|
78
|
-
"simple-import-sort/exports": "error"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
];
|
|
69
|
+
return [{
|
|
70
|
+
name: "zjutjh/imports/setup",
|
|
71
|
+
plugins: { "simple-import-sort": simpleImportSortPlugin }
|
|
72
|
+
}, {
|
|
73
|
+
name: "zjutjh/imports/rules",
|
|
74
|
+
rules: {
|
|
75
|
+
"simple-import-sort/imports": "error",
|
|
76
|
+
"simple-import-sort/exports": "error"
|
|
77
|
+
}
|
|
78
|
+
}];
|
|
82
79
|
}
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
import globals from "globals";
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/configs/javascript.ts
|
|
87
83
|
function javascript() {
|
|
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
|
-
];
|
|
84
|
+
return [{
|
|
85
|
+
name: "zjutjh/javascript/setup",
|
|
86
|
+
languageOptions: {
|
|
87
|
+
ecmaVersion: 2022,
|
|
88
|
+
globals: {
|
|
89
|
+
...globals.browser,
|
|
90
|
+
...globals.es2021,
|
|
91
|
+
...globals.node,
|
|
92
|
+
document: "readonly",
|
|
93
|
+
navigator: "readonly",
|
|
94
|
+
window: "readonly"
|
|
95
|
+
},
|
|
96
|
+
parserOptions: {
|
|
97
|
+
ecmaFeatures: { jsx: true },
|
|
98
|
+
ecmaVersion: 2022,
|
|
99
|
+
sourceType: "module"
|
|
100
|
+
},
|
|
101
|
+
sourceType: "module"
|
|
102
|
+
},
|
|
103
|
+
linterOptions: { reportUnusedDisableDirectives: true }
|
|
104
|
+
}, {
|
|
105
|
+
name: "zjutjh/javascript/rules",
|
|
106
|
+
rules: {
|
|
107
|
+
...eslintJS.configs.recommended.rules,
|
|
108
|
+
"camelcase": "warn",
|
|
109
|
+
"no-warning-comments": "warn",
|
|
110
|
+
"no-console": ["warn", { allow: [
|
|
111
|
+
"warn",
|
|
112
|
+
"error",
|
|
113
|
+
"info"
|
|
114
|
+
] }],
|
|
115
|
+
"no-var": "error",
|
|
116
|
+
"no-undef": "off",
|
|
117
|
+
"prefer-const": "warn",
|
|
118
|
+
"arrow-body-style": "error",
|
|
119
|
+
"no-nested-ternary": "error",
|
|
120
|
+
"curly": "error",
|
|
121
|
+
"no-else-return": "error",
|
|
122
|
+
"no-implicit-coercion": "error"
|
|
123
|
+
}
|
|
124
|
+
}];
|
|
132
125
|
}
|
|
133
126
|
|
|
134
|
-
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/configs/jsx.ts
|
|
135
129
|
function jsx() {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
parserOptions: {
|
|
142
|
-
ecmaFeatures: {
|
|
143
|
-
jsx: true
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
];
|
|
130
|
+
return [{
|
|
131
|
+
name: "zjutjh/jsx/setup",
|
|
132
|
+
files: [GLOB_TSX, GLOB_JSX],
|
|
133
|
+
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }
|
|
134
|
+
}];
|
|
149
135
|
}
|
|
150
136
|
|
|
151
|
-
|
|
152
|
-
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/utils.ts
|
|
153
139
|
async function interopDefault(m) {
|
|
154
|
-
|
|
155
|
-
|
|
140
|
+
const resolved = await m;
|
|
141
|
+
return resolved.default || resolved;
|
|
156
142
|
}
|
|
157
143
|
async function ensurePackages(packages) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
165
|
-
});
|
|
166
|
-
if (confirmed) {
|
|
167
|
-
const { installPackage } = await import("@antfu/install-pkg");
|
|
168
|
-
await installPackage(nonExistingPackages, { dev: true });
|
|
169
|
-
}
|
|
144
|
+
const nonExistingPackages = packages.filter((i) => i && !isPackageExists(i));
|
|
145
|
+
if (nonExistingPackages.length === 0) return;
|
|
146
|
+
if (await (await import("@clack/prompts")).confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` })) {
|
|
147
|
+
const { installPackage } = await import("@antfu/install-pkg");
|
|
148
|
+
await installPackage(nonExistingPackages, { dev: true });
|
|
149
|
+
}
|
|
170
150
|
}
|
|
171
151
|
function resolveSubOptions(options, key) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
return options[key] || {};
|
|
152
|
+
if (typeof options[key] === "boolean") return {};
|
|
153
|
+
return options[key] || {};
|
|
176
154
|
}
|
|
177
155
|
function getOverrides(options, key) {
|
|
178
|
-
|
|
179
|
-
...options.overrides?.[key]
|
|
180
|
-
};
|
|
156
|
+
return { ...options.overrides?.[key] };
|
|
181
157
|
}
|
|
182
158
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/configs/prettier.ts
|
|
161
|
+
/**
|
|
162
|
+
* @see https://prettier.io/docs/options
|
|
163
|
+
*/
|
|
164
|
+
const prettierOptions = {
|
|
165
|
+
printWidth: 100,
|
|
166
|
+
tabWidth: 2,
|
|
167
|
+
useTabs: false,
|
|
168
|
+
semi: true,
|
|
169
|
+
singleQuote: false,
|
|
170
|
+
quoteProps: "as-needed",
|
|
171
|
+
jsxSingleQuote: false,
|
|
172
|
+
trailingComma: "none",
|
|
173
|
+
bracketSpacing: true,
|
|
174
|
+
bracketSameLine: false,
|
|
175
|
+
arrowParens: "always",
|
|
176
|
+
requirePragma: false,
|
|
177
|
+
insertPragma: false,
|
|
178
|
+
proseWrap: "preserve",
|
|
179
|
+
htmlWhitespaceSensitivity: "css",
|
|
180
|
+
vueIndentScriptAndStyle: false,
|
|
181
|
+
endOfLine: "lf",
|
|
182
|
+
embeddedLanguageFormatting: "auto",
|
|
183
|
+
singleAttributePerLine: false
|
|
204
184
|
};
|
|
205
185
|
async function prettier(options) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
186
|
+
await ensurePackages([
|
|
187
|
+
"eslint-plugin-format",
|
|
188
|
+
"eslint-plugin-prettier",
|
|
189
|
+
"eslint-config-prettier",
|
|
190
|
+
"prettier"
|
|
191
|
+
]);
|
|
192
|
+
const [configPrettier, pluginFormat] = await Promise.all([interopDefault(import("eslint-plugin-prettier/recommended")), interopDefault(import("eslint-plugin-format"))]);
|
|
193
|
+
const { es: enableESFormat = true, html: enableHTMLFormat = true, css: enableCSSFormat = true, json: enableJSONFormat = true } = options?.lang ?? {};
|
|
194
|
+
const mergedPrettierOptions = {
|
|
195
|
+
...prettierOptions,
|
|
196
|
+
...options?.prettierSelfOptions
|
|
197
|
+
};
|
|
198
|
+
return [
|
|
199
|
+
enableESFormat ? {
|
|
200
|
+
name: "zjutjh/prettier/setup",
|
|
201
|
+
files: [
|
|
202
|
+
GLOB_VUE,
|
|
203
|
+
GLOB_TS,
|
|
204
|
+
GLOB_JS,
|
|
205
|
+
GLOB_TSX,
|
|
206
|
+
GLOB_JSX
|
|
207
|
+
],
|
|
208
|
+
...configPrettier
|
|
209
|
+
} : {},
|
|
210
|
+
enableESFormat ? {
|
|
211
|
+
name: "zjutjh/prettier/es",
|
|
212
|
+
files: [
|
|
213
|
+
GLOB_VUE,
|
|
214
|
+
GLOB_TS,
|
|
215
|
+
GLOB_JS,
|
|
216
|
+
GLOB_TSX,
|
|
217
|
+
GLOB_JSX
|
|
218
|
+
],
|
|
219
|
+
rules: { "prettier/prettier": ["error", mergedPrettierOptions] }
|
|
220
|
+
} : {},
|
|
221
|
+
enableCSSFormat ? {
|
|
222
|
+
name: "zjutjh/prettier/css",
|
|
223
|
+
files: [
|
|
224
|
+
GLOB_CSS,
|
|
225
|
+
GLOB_LESS,
|
|
226
|
+
GLOB_SCSS
|
|
227
|
+
],
|
|
228
|
+
languageOptions: { parser: pluginFormat.parserPlain },
|
|
229
|
+
plugins: { format: pluginFormat },
|
|
230
|
+
rules: { "format/prettier": ["error", {
|
|
231
|
+
parser: "css",
|
|
232
|
+
mergedPrettierOptions
|
|
233
|
+
}] }
|
|
234
|
+
} : {},
|
|
235
|
+
enableHTMLFormat ? {
|
|
236
|
+
name: "zjutjh/prettier/html",
|
|
237
|
+
files: [GLOB_HTML],
|
|
238
|
+
languageOptions: { parser: pluginFormat.parserPlain },
|
|
239
|
+
plugins: { format: pluginFormat },
|
|
240
|
+
rules: { "format/prettier": ["error", {
|
|
241
|
+
parser: "html",
|
|
242
|
+
mergedPrettierOptions
|
|
243
|
+
}] }
|
|
244
|
+
} : {},
|
|
245
|
+
enableJSONFormat ? {
|
|
246
|
+
name: "zjutjh/prettier/json",
|
|
247
|
+
files: [
|
|
248
|
+
GLOB_JSON,
|
|
249
|
+
GLOB_JSON5,
|
|
250
|
+
GLOB_JSONC
|
|
251
|
+
],
|
|
252
|
+
languageOptions: { parser: pluginFormat.parserPlain },
|
|
253
|
+
plugins: { format: pluginFormat },
|
|
254
|
+
rules: { "format/prettier": ["error", {
|
|
255
|
+
parser: "json",
|
|
256
|
+
mergedPrettierOptions
|
|
257
|
+
}] }
|
|
258
|
+
} : {}
|
|
259
|
+
];
|
|
279
260
|
}
|
|
280
261
|
|
|
281
|
-
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/configs/react.ts
|
|
282
264
|
async function react(options) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
rules: {
|
|
322
|
-
...pluginReact.configs.recommended.rules,
|
|
323
|
-
...pluginReactHooks.configs.recommended.rules,
|
|
324
|
-
"react-refresh/only-export-components": "warn",
|
|
325
|
-
...options.overrides
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
];
|
|
265
|
+
await ensurePackages([
|
|
266
|
+
"@eslint-react/eslint-plugin",
|
|
267
|
+
"eslint-plugin-react-hooks",
|
|
268
|
+
"eslint-plugin-react-refresh"
|
|
269
|
+
]);
|
|
270
|
+
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all([
|
|
271
|
+
interopDefault(import("@eslint-react/eslint-plugin")),
|
|
272
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
273
|
+
interopDefault(import("eslint-plugin-react-refresh"))
|
|
274
|
+
]);
|
|
275
|
+
const plugins = pluginReact.configs.all.plugins;
|
|
276
|
+
return [{
|
|
277
|
+
name: "zjutjh/react/setup",
|
|
278
|
+
plugins: {
|
|
279
|
+
"@eslint-react": plugins["@eslint-react"],
|
|
280
|
+
"@eslint-react/debug": plugins["@eslint-react/debug"],
|
|
281
|
+
"@eslint-react/dom": plugins["@eslint-react/dom"],
|
|
282
|
+
"@eslint-react/hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
283
|
+
"@eslint-react/naming-convention": plugins["@eslint-react/naming-convention"],
|
|
284
|
+
"@eslint-react/web-api": plugins["@eslint-react/web-api"],
|
|
285
|
+
"react-hooks": pluginReactHooks,
|
|
286
|
+
"react-refresh": pluginReactRefresh
|
|
287
|
+
}
|
|
288
|
+
}, {
|
|
289
|
+
name: "zjutjh/react/rules",
|
|
290
|
+
files: [
|
|
291
|
+
GLOB_JSX,
|
|
292
|
+
GLOB_TSX,
|
|
293
|
+
GLOB_JS,
|
|
294
|
+
GLOB_TS
|
|
295
|
+
],
|
|
296
|
+
rules: {
|
|
297
|
+
...pluginReact.configs.recommended.rules,
|
|
298
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
299
|
+
"react-refresh/only-export-components": "warn",
|
|
300
|
+
...options.overrides
|
|
301
|
+
}
|
|
302
|
+
}];
|
|
329
303
|
}
|
|
330
304
|
|
|
331
|
-
|
|
332
|
-
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/configs/stylistic.ts
|
|
333
307
|
function stylistic(options) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
...options.overrides
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
];
|
|
308
|
+
return [{
|
|
309
|
+
name: "zjutjh/stylistic/rules",
|
|
310
|
+
plugins: { "@stylistic": pluginStylistic },
|
|
311
|
+
rules: {
|
|
312
|
+
"@stylistic/indent": ["error", 2],
|
|
313
|
+
"@stylistic/keyword-spacing": "error",
|
|
314
|
+
"@stylistic/key-spacing": "error",
|
|
315
|
+
"@stylistic/no-trailing-spaces": "error",
|
|
316
|
+
"@stylistic/linebreak-style": ["error", "unix"],
|
|
317
|
+
"@stylistic/quotes": ["error", "double"],
|
|
318
|
+
"@stylistic/function-call-spacing": "error",
|
|
319
|
+
"@stylistic/semi": "error",
|
|
320
|
+
"@stylistic/no-multiple-empty-lines": ["warn", { max: 1 }],
|
|
321
|
+
"@stylistic/object-curly-spacing": ["error", "always"],
|
|
322
|
+
"@stylistic/arrow-spacing": "error",
|
|
323
|
+
"@stylistic/block-spacing": "error",
|
|
324
|
+
"@stylistic/brace-style": "error",
|
|
325
|
+
"@stylistic/comma-dangle": "error",
|
|
326
|
+
"@stylistic/no-multi-spaces": "error",
|
|
327
|
+
"@stylistic/comma-spacing": "error",
|
|
328
|
+
"@stylistic/switch-colon-spacing": "error",
|
|
329
|
+
"@stylistic/type-annotation-spacing": "error",
|
|
330
|
+
"@stylistic/space-before-blocks": "error",
|
|
331
|
+
"@stylistic/space-before-function-paren": ["error", {
|
|
332
|
+
"anonymous": "never",
|
|
333
|
+
"named": "never",
|
|
334
|
+
"asyncArrow": "always"
|
|
335
|
+
}],
|
|
336
|
+
"@stylistic/space-in-parens": "error",
|
|
337
|
+
"@stylistic/space-infix-ops": "error",
|
|
338
|
+
"@stylistic/spaced-comment": "error",
|
|
339
|
+
...options.overrides
|
|
340
|
+
}
|
|
341
|
+
}];
|
|
372
342
|
}
|
|
373
343
|
|
|
374
|
-
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/configs/typescript.ts
|
|
375
346
|
async function typescript(options) {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
"@typescript-eslint/no-empty-function": "error",
|
|
427
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
428
|
-
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
429
|
-
"@typescript-eslint/no-unused-expressions": ["error", {
|
|
430
|
-
allowShortCircuit: true,
|
|
431
|
-
allowTaggedTemplates: true,
|
|
432
|
-
allowTernary: true
|
|
433
|
-
}],
|
|
434
|
-
...overrides
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
];
|
|
347
|
+
const { componentExts = [], overrides, parserOptions } = options;
|
|
348
|
+
const files = [
|
|
349
|
+
GLOB_TS,
|
|
350
|
+
GLOB_TSX,
|
|
351
|
+
...componentExts.map((ext) => `**/*.${ext}`)
|
|
352
|
+
];
|
|
353
|
+
await ensurePackages(["@typescript-eslint/eslint-plugin", "@typescript-eslint/parser"]);
|
|
354
|
+
const [pluginTs, parserTs] = await Promise.all([await interopDefault(import("@typescript-eslint/eslint-plugin")), await interopDefault(import("@typescript-eslint/parser"))]);
|
|
355
|
+
return [
|
|
356
|
+
{
|
|
357
|
+
name: "zjutjh/typescript/setup",
|
|
358
|
+
plugins: { "@typescript-eslint": pluginTs }
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: "zjutjh/typescript/parser",
|
|
362
|
+
files,
|
|
363
|
+
languageOptions: {
|
|
364
|
+
parser: parserTs,
|
|
365
|
+
parserOptions: {
|
|
366
|
+
ecmaVersion: 2022,
|
|
367
|
+
sourceType: "module",
|
|
368
|
+
projectService: {
|
|
369
|
+
allowDefaultProject: ["./*.js"],
|
|
370
|
+
defaultProject: "./tsconfig.json"
|
|
371
|
+
},
|
|
372
|
+
tsconfigRootDir: process.cwd(),
|
|
373
|
+
...parserOptions
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: "zjutjh/typescript/rules",
|
|
379
|
+
files,
|
|
380
|
+
rules: {
|
|
381
|
+
...pluginTs.configs.strict.rules,
|
|
382
|
+
"@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
|
|
383
|
+
"@typescript-eslint/no-shadow": "error",
|
|
384
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
385
|
+
"@typescript-eslint/no-empty-function": "error",
|
|
386
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
387
|
+
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
388
|
+
"@typescript-eslint/no-unused-expressions": ["error", {
|
|
389
|
+
allowShortCircuit: true,
|
|
390
|
+
allowTaggedTemplates: true,
|
|
391
|
+
allowTernary: true
|
|
392
|
+
}],
|
|
393
|
+
...overrides
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
];
|
|
438
397
|
}
|
|
439
398
|
|
|
440
|
-
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/configs/vue.ts
|
|
441
401
|
async function vue(options) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
];
|
|
402
|
+
await ensurePackages(["eslint-plugin-vue", "vue-eslint-parser"]);
|
|
403
|
+
const [pluginVue, parserVue] = await Promise.all([interopDefault(import("eslint-plugin-vue")), interopDefault(import("vue-eslint-parser"))]);
|
|
404
|
+
return [{
|
|
405
|
+
name: "zjutjh/vue/setup",
|
|
406
|
+
plugins: { vue: pluginVue }
|
|
407
|
+
}, {
|
|
408
|
+
name: "zjutjh/vue/rules",
|
|
409
|
+
files: [GLOB_VUE],
|
|
410
|
+
languageOptions: {
|
|
411
|
+
parser: parserVue,
|
|
412
|
+
parserOptions: {
|
|
413
|
+
ecmaFeatures: { jsx: true },
|
|
414
|
+
extraFileExtensions: [".vue"],
|
|
415
|
+
parser: options?.ts ? await interopDefault(import("@typescript-eslint/parser")) : null,
|
|
416
|
+
sourceType: "module"
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
processor: pluginVue.processors[".vue"],
|
|
420
|
+
rules: {
|
|
421
|
+
...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((prev, curr) => ({
|
|
422
|
+
...prev,
|
|
423
|
+
...curr
|
|
424
|
+
}), {}),
|
|
425
|
+
...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((prev, curr) => ({
|
|
426
|
+
...prev,
|
|
427
|
+
...curr
|
|
428
|
+
}), {}),
|
|
429
|
+
...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((prev, curr) => ({
|
|
430
|
+
...prev,
|
|
431
|
+
...curr
|
|
432
|
+
}), {}),
|
|
433
|
+
"vue/multi-word-component-names": ["warn", { ignores: ["index"] }],
|
|
434
|
+
"vue/component-name-in-template-casing": [
|
|
435
|
+
"error",
|
|
436
|
+
"kebab-case",
|
|
437
|
+
{ "registeredComponentsOnly": true }
|
|
438
|
+
],
|
|
439
|
+
"vue/max-attributes-per-line": ["error", { "singleline": { "max": 3 } }],
|
|
440
|
+
"vue/prefer-true-attribute-shorthand": ["warn", options?.taro ? "never" : "always"],
|
|
441
|
+
...options?.overrides
|
|
442
|
+
}
|
|
443
|
+
}];
|
|
487
444
|
}
|
|
488
445
|
|
|
489
|
-
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/factory.ts
|
|
490
448
|
async function zjutjh(options = {}, ...userConfigs) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
componentExts.push("vue");
|
|
512
|
-
}
|
|
513
|
-
const typescriptOptions = resolveSubOptions(options, "ts");
|
|
514
|
-
if (enableTs) {
|
|
515
|
-
configs.push(
|
|
516
|
-
await typescript({
|
|
517
|
-
...typescriptOptions,
|
|
518
|
-
overrides: getOverrides(options, "ts")
|
|
519
|
-
})
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
if (enableVue) {
|
|
523
|
-
configs.push(
|
|
524
|
-
await vue({
|
|
525
|
-
ts: Boolean(enableTs),
|
|
526
|
-
taro: enableTaro,
|
|
527
|
-
overrides: getOverrides(options, "vue")
|
|
528
|
-
})
|
|
529
|
-
);
|
|
530
|
-
}
|
|
531
|
-
if (enableJSX) {
|
|
532
|
-
configs.push(jsx());
|
|
533
|
-
}
|
|
534
|
-
if (enableReact) {
|
|
535
|
-
configs.push(
|
|
536
|
-
await react({
|
|
537
|
-
overrides: getOverrides(options, "react")
|
|
538
|
-
})
|
|
539
|
-
);
|
|
540
|
-
}
|
|
541
|
-
const codeStyleOptions = resolveSubOptions(options, "prettier");
|
|
542
|
-
if (enablePrettier) {
|
|
543
|
-
configs.push(await prettier(codeStyleOptions));
|
|
544
|
-
}
|
|
545
|
-
return configs.flat(1).concat(userConfigs);
|
|
449
|
+
const { componentExts = [], vue: enableVue = isPackageExists("vue"), ts: enableTs = isPackageExists("typescript"), taro: enableTaro = isPackageExists("@tarojs/taro"), jsx: enableJSX = isPackageExists("react"), react: enableReact = isPackageExists("react"), ignores: userIgnores, prettier: enablePrettier = false } = options;
|
|
450
|
+
const configs = [];
|
|
451
|
+
configs.push(ignores({ userIgnores }), javascript(), imports(), stylistic({ overrides: getOverrides(options, "stylistic") }));
|
|
452
|
+
if (enableVue) componentExts.push("vue");
|
|
453
|
+
const typescriptOptions = resolveSubOptions(options, "ts");
|
|
454
|
+
if (enableTs) configs.push(await typescript({
|
|
455
|
+
...typescriptOptions,
|
|
456
|
+
componentExts,
|
|
457
|
+
overrides: getOverrides(options, "ts")
|
|
458
|
+
}));
|
|
459
|
+
if (enableVue) configs.push(await vue({
|
|
460
|
+
ts: Boolean(enableTs),
|
|
461
|
+
taro: enableTaro,
|
|
462
|
+
overrides: getOverrides(options, "vue")
|
|
463
|
+
}));
|
|
464
|
+
if (enableJSX) configs.push(jsx());
|
|
465
|
+
if (enableReact) configs.push(await react({ overrides: getOverrides(options, "react") }));
|
|
466
|
+
const codeStyleOptions = resolveSubOptions(options, "prettier");
|
|
467
|
+
if (enablePrettier) configs.push(await prettier(codeStyleOptions));
|
|
468
|
+
return configs.flat(1).concat(userConfigs);
|
|
546
469
|
}
|
|
547
470
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/index.ts
|
|
473
|
+
var src_default = zjutjh;
|
|
474
|
+
|
|
475
|
+
//#endregion
|
|
476
|
+
export { src_default as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zjutjh/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.4",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "zjutjh",
|
|
7
7
|
"description": "Eslint config used by zjutjh",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"engines": {
|
|
18
|
-
"node": ">=
|
|
18
|
+
"node": ">=20.19.0"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
"pre-commit": "pnpx lint-staged"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@eslint-react/eslint-plugin": "^
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
33
|
-
"@typescript-eslint/parser": "^8.
|
|
34
|
-
"eslint": "^9.
|
|
35
|
-
"eslint-config-prettier": "^10.1.
|
|
36
|
-
"eslint-plugin-format": "^1.0.
|
|
37
|
-
"eslint-plugin-prettier": "^5.
|
|
31
|
+
"@eslint-react/eslint-plugin": "^2.0.0",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
33
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
34
|
+
"eslint": "^9.36.0",
|
|
35
|
+
"eslint-config-prettier": "^10.1.8",
|
|
36
|
+
"eslint-plugin-format": "^1.0.2",
|
|
37
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
38
38
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
39
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
40
|
-
"eslint-plugin-vue": "^10.
|
|
41
|
-
"prettier": "^3.
|
|
42
|
-
"vue-eslint-parser": "^10.
|
|
39
|
+
"eslint-plugin-react-refresh": "^0.4.22",
|
|
40
|
+
"eslint-plugin-vue": "^10.5.0",
|
|
41
|
+
"prettier": "^3.6.2",
|
|
42
|
+
"vue-eslint-parser": "^10.2.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@eslint-react/eslint-plugin": {
|
|
@@ -77,37 +77,37 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@antfu/install-pkg": "^1.
|
|
81
|
-
"@clack/prompts": "^0.
|
|
82
|
-
"@eslint/js": "^9.
|
|
83
|
-
"@stylistic/eslint-plugin": "^4.
|
|
80
|
+
"@antfu/install-pkg": "^1.1.0",
|
|
81
|
+
"@clack/prompts": "^0.11.0",
|
|
82
|
+
"@eslint/js": "^9.36.0",
|
|
83
|
+
"@stylistic/eslint-plugin": "^5.4.0",
|
|
84
84
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
85
|
-
"globals": "^16.
|
|
86
|
-
"local-pkg": "^1.1.
|
|
85
|
+
"globals": "^16.4.0",
|
|
86
|
+
"local-pkg": "^1.1.2"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@eslint-react/eslint-plugin": "^
|
|
90
|
-
"@eslint/config-inspector": "^1.0
|
|
91
|
-
"@types/node": "^22.
|
|
92
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
93
|
-
"@typescript-eslint/parser": "^8.
|
|
94
|
-
"bumpp": "^10.
|
|
95
|
-
"eslint": "^9.
|
|
96
|
-
"eslint-config-prettier": "^10.1.
|
|
97
|
-
"eslint-plugin-format": "^1.0.
|
|
98
|
-
"eslint-plugin-prettier": "^5.
|
|
89
|
+
"@eslint-react/eslint-plugin": "^2.0.0",
|
|
90
|
+
"@eslint/config-inspector": "^1.3.0",
|
|
91
|
+
"@types/node": "^22.18.6",
|
|
92
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
93
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
94
|
+
"bumpp": "^10.2.3",
|
|
95
|
+
"eslint": "^9.36.0",
|
|
96
|
+
"eslint-config-prettier": "^10.1.8",
|
|
97
|
+
"eslint-plugin-format": "^1.0.2",
|
|
98
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
99
99
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
100
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
101
|
-
"eslint-plugin-vue": "^10.
|
|
102
|
-
"jiti": "^2.
|
|
103
|
-
"prettier": "^3.
|
|
104
|
-
"simple-git-hooks": "^2.13.
|
|
105
|
-
"
|
|
106
|
-
"typescript": "^5.
|
|
107
|
-
"vue-eslint-parser": "^10.
|
|
100
|
+
"eslint-plugin-react-refresh": "^0.4.22",
|
|
101
|
+
"eslint-plugin-vue": "^10.5.0",
|
|
102
|
+
"jiti": "^2.6.0",
|
|
103
|
+
"prettier": "^3.6.2",
|
|
104
|
+
"simple-git-hooks": "^2.13.1",
|
|
105
|
+
"tsdown": "^0.15.4",
|
|
106
|
+
"typescript": "^5.9.2",
|
|
107
|
+
"vue-eslint-parser": "^10.2.0"
|
|
108
108
|
},
|
|
109
109
|
"scripts": {
|
|
110
|
-
"build": "
|
|
110
|
+
"build": "tsdown",
|
|
111
111
|
"lint": "eslint .",
|
|
112
112
|
"typecheck": "tsc --noEmit",
|
|
113
113
|
"dev": "config-inspector",
|