Skip to content

Commit 039b38e

Browse files
author
微信公众号:储凡
authored
Merge pull request #141 from 142vip/fix/eslint-config
fix(@142vip/eslint-config): 修复`lint`命令执行过慢问题,删除`eslint-plugin-format`插件格式化配置
2 parents 4fe9d9e + 7c05fe2 commit 039b38e

File tree

3 files changed

+29
-27
lines changed

3 files changed

+29
-27
lines changed

packages/eslint-config/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
},
3535
"dependencies": {
3636
"@antfu/eslint-config": "^2.27.3",
37-
"eslint": "8.55.0",
38-
"eslint-plugin-format": "^0.1.2"
37+
"eslint": "8.55.0"
3938
},
4039
"publishConfig": {
4140
"access": "public",

packages/eslint-config/src/eslint.config.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ import { antfu } from '@antfu/eslint-config'
77
/**
88
* 默认的Eslint配置
99
*/
10-
export const defaultEslintConfig = {
10+
export const defaultEslintConfig: EslintConfigOptions = {
1111
gitignore: true,
1212
typescript: true,
1313
vue: true,
1414
jsonc: true,
1515
yaml: true,
16-
formatters: {
17-
css: true,
18-
html: true,
19-
markdown: 'prettier',
20-
},
16+
// formatters: {
17+
// css: true,
18+
// html: true,
19+
// markdown: 'prettier',
20+
// },
21+
markdown: true,
2122
}
2223

2324
/**
@@ -38,18 +39,14 @@ type EslintConfigOptions = OptionsConfig & TypedFlatConfigItem
3839
* 参考:https://github.com/antfu/eslint-config
3940
* @param options
4041
*/
41-
export function defineVipEslintConfig(
42+
export async function defineVipEslintConfig(
4243
options: EslintConfigOptions = {},
43-
): any {
44-
return antfu({
44+
): Promise<any> {
45+
return antfu(defaultEslintConfig, {
4546
...options,
46-
...defaultEslintConfig,
47-
ignores: [
48-
...options.ignores ?? [],
49-
],
5047
rules: {
5148
...baseEslintRules,
52-
...options.rules ?? {},
53-
},
54-
} as EslintConfigOptions)
49+
...(options.rules ?? {}),
50+
} as any,
51+
})
5552
}

pnpm-lock.yaml

Lines changed: 15 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)