Skip to content

Commit 73f7d8c

Browse files
committedAug 7, 2023
Add lint-staged to run pre-commit on staged files (except for mypy)
1 parent d97edef commit 73f7d8c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎.husky/pre-commit

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
pnpm run lintUi
5-
pnpm run formatUi
4+
npx lint-staged
65
pnpm run lintPython
7-
pnpm run formatPython

‎lint-staged.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// eslint-disable-next-line no-undef
2+
module.exports = {
3+
"**/*.{js,jsx,ts,tsx}": ["npx prettier --write", "npx eslint --fix"],
4+
"**/*.{ts,tsx}": [() => "tsc --skipLibCheck --noEmit"],
5+
"**/*.py": ["black", "isort --profile=black"],
6+
};

0 commit comments

Comments
 (0)