From 53af477331622cf34059578459b2243dcffabbd9 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke Date: Thu, 18 Jul 2024 06:48:53 +0200 Subject: [PATCH] refactor: prettify all files adapted out of GH typicode/husky/releases/tag/v9.1.0#:~:text=to%20the%20docs.-,Lint%20staged%20files --- .husky/pre-commit | 2 ++ .lintstagedrc.js | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index abdc28bca3f..8ad80db40d0 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,6 @@ validate-branch-name node scripts/check-commit-mail.js lint-staged --config ./.lintstagedrc.js +prettier $(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') --write --ignore-unknown +git update-index --again npm run lint:jscpd diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 5485af6c2e0..667e8e750dc 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,6 +1,5 @@ export default { '*.md': 'markdownlint -c .markdown-lint.yml', '*.{css,scss}': 'stylelint --fix --allow-empty-input', - '*.{js,ts,tsx,jsx,mjs,cjs}': ['prettier --write', 'xo --fix'], - '!*.{js,ts,tsx,jsx,mjs,cjs}': 'prettier --write --ignore-unknown' + '*.{js,ts,tsx,jsx,mjs,cjs}': ['xo --fix'] };