From 6beb452f816aa498ce4add58655f25f971c7c261 Mon Sep 17 00:00:00 2001 From: ModyQyW Date: Tue, 20 Feb 2024 15:45:00 +0800 Subject: [PATCH] fix(lint-staged): disable prettier on auto generated files --- src/lint-staged/factory.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lint-staged/factory.ts b/src/lint-staged/factory.ts index cc581ee0..8dd7dda4 100644 --- a/src/lint-staged/factory.ts +++ b/src/lint-staged/factory.ts @@ -52,13 +52,17 @@ export function lintStaged( if (enablePrettier) { config['*'] = (filenames) => { - console.log('filenames', filenames); return filenames .filter( (f) => f.endsWith('package-lock.json') || f.endsWith('yarn.lock') || - f.endsWith('pnpm-lock.yaml'), + f.endsWith('pnpm-lock.yaml') || + f.endsWith('auto-import.d.ts') || + f.endsWith('auto-imports.d.ts') || + f.endsWith('components.d.ts') || + f.endsWith('typed-router.d.ts') || + f.endsWith('uni-pages.d.ts'), ) .map((f) => `prettier --ignore-unknown --write --cache ${f}`); };