Skip to content

Commit

Permalink
Add lint-staged to run pre-commit on staged files (except for mypy)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimtunc committed Aug 7, 2023
1 parent d97edef commit 73f7d8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm run lintUi
pnpm run formatUi
npx lint-staged
pnpm run lintPython
pnpm run formatPython
6 changes: 6 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line no-undef
module.exports = {
"**/*.{js,jsx,ts,tsx}": ["npx prettier --write", "npx eslint --fix"],
"**/*.{ts,tsx}": [() => "tsc --skipLibCheck --noEmit"],
"**/*.py": ["black", "isort --profile=black"],
};

0 comments on commit 73f7d8c

Please sign in to comment.