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'] };