Skip to content

Commit

Permalink
Merge pull request #141 from 142vip/fix/eslint-config
Browse files Browse the repository at this point in the history
fix(@142vip/eslint-config): 修复`lint`命令执行过慢问题,删除`eslint-plugin-format`插件格式化配置
  • Loading branch information
微信公众号:储凡 authored Sep 30, 2024
2 parents 4fe9d9e + 7c05fe2 commit 039b38e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
3 changes: 1 addition & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
},
"dependencies": {
"@antfu/eslint-config": "^2.27.3",
"eslint": "8.55.0",
"eslint-plugin-format": "^0.1.2"
"eslint": "8.55.0"
},
"publishConfig": {
"access": "public",
Expand Down
29 changes: 13 additions & 16 deletions packages/eslint-config/src/eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ import { antfu } from '@antfu/eslint-config'
/**
* 默认的Eslint配置
*/
export const defaultEslintConfig = {
export const defaultEslintConfig: EslintConfigOptions = {
gitignore: true,
typescript: true,
vue: true,
jsonc: true,
yaml: true,
formatters: {
css: true,
html: true,
markdown: 'prettier',
},
// formatters: {
// css: true,
// html: true,
// markdown: 'prettier',
// },
markdown: true,
}

/**
Expand All @@ -38,18 +39,14 @@ type EslintConfigOptions = OptionsConfig & TypedFlatConfigItem
* 参考:https://github.com/antfu/eslint-config
* @param options
*/
export function defineVipEslintConfig(
export async function defineVipEslintConfig(
options: EslintConfigOptions = {},
): any {
return antfu({
): Promise<any> {
return antfu(defaultEslintConfig, {
...options,
...defaultEslintConfig,
ignores: [
...options.ignores ?? [],
],
rules: {
...baseEslintRules,
...options.rules ?? {},
},
} as EslintConfigOptions)
...(options.rules ?? {}),
} as any,
})
}
24 changes: 15 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 039b38e

Please sign in to comment.