diff --git a/.npmrc b/.npmrc index 356b660d8..6d28fabf4 100644 --- a/.npmrc +++ b/.npmrc @@ -1,7 +1,8 @@ registry=https://registry.npmmirror.com public-hoist-pattern[]=lefthook public-hoist-pattern[]=eslint -public-hoist-pattern[]=prettier +public-hoist-pattern[]=oxfmt +public-hoist-pattern[]=oxlint public-hoist-pattern[]=stylelint public-hoist-pattern[]=*postcss* public-hoist-pattern[]=@commitlint/* diff --git a/package.json b/package.json index 7ce428088..75b574cb2 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,7 @@ "dev:tdesign": "pnpm -F @vben/web-tdesign run dev", "dev:play": "pnpm -F @vben/playground run dev", "format": "vsh lint --format", - "lint": "pnpm run lint:oxc && pnpm run lint:eslint", - "lint:eslint": "vsh lint", - "lint:oxc": "oxlint .", + "lint": "vsh lint", "postinstall": "pnpm -r run stub --if-present", "preinstall": "npx only-allow pnpm", "preview": "turbo-run preview", diff --git a/scripts/vsh/src/lint/index.ts b/scripts/vsh/src/lint/index.ts index 141d2008a..c952622bb 100644 --- a/scripts/vsh/src/lint/index.ts +++ b/scripts/vsh/src/lint/index.ts @@ -28,10 +28,13 @@ async function runLint({ format }: LintCommandOptions) { return; } await Promise.all([ - execaCommand(`eslint . --cache`, { + execaCommand(`oxfmt --check .`, { stdio: 'inherit', }), - execaCommand(`oxfmt --check .`, { + execaCommand(`oxlint . --fix`, { + stdio: 'inherit', + }), + execaCommand(`eslint . --cache`, { stdio: 'inherit', }), execaCommand(`stylelint "**/*.{vue,css,less,scss}" --cache`, { diff --git a/vitest.config.ts b/vitest.config.ts index cdfd2c6dc..67d6c229e 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -22,7 +22,7 @@ export default defineConfig({ '**/.{idea,git,cache,output,temp}/**', '**/node_modules/**', '**/{stylelint,eslint}.config.*', - 'oxfmt.config.ts', + '**/{oxfmt,oxlint}.config.*', ], }, });