Skip to content

Commit 67754ec

Browse files
committed
Add pre-commit, lintstaged
1 parent 90bd7c6 commit 67754ec

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm lint-staged

.lintstagedrc.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
'**/*.{js,jsx,ts,tsx,mjs,md,mdx,json,json5,jsonc}': (files) => {
3+
return [
4+
`npx eslint --config eslint.config.mjs --fix ${files.join(' ')}`,
5+
`git add ${files.join(' ')}`,
6+
]
7+
},
8+
}

0 commit comments

Comments
 (0)