Skip to content

Commit

Permalink
fix(lint-staged): disable prettier on auto generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
ModyQyW committed Feb 20, 2024
1 parent 398318f commit 6beb452
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lint-staged/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
};
Expand Down

0 comments on commit 6beb452

Please sign in to comment.