Skip to content

Commit 3af334c

Browse files
committed
chore: add husky and lint-staged configuration for pre-commit hooks
1 parent c929b3d commit 3af334c

File tree

4 files changed

+876
-87
lines changed

4 files changed

+876
-87
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged --concurrent false --relative

lint-staged.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
'packages/**/*.{ts,tsx}': (files) => {
3+
return `nx affected -t typecheck --base HEAD~1 --files=${files.join(',')}`;
4+
},
5+
'packages/**/*.{js,ts,jsx,tsx,json}': (files) => {
6+
return `npx nx affected -t lint --base HEAD~1 --files=${files.join(',')}`;
7+
},
8+
'**/*.{js,ts,jsx,tsx,json}': [
9+
(files) => `npx nx format:write --files=${files.join(',')}`,
10+
],
11+
};

0 commit comments

Comments
 (0)