Skip to content

Commit 9a44887

Browse files
authored
Merge pull request #65 from jpcmf/feat/lint-staged
feat: Lint Staged with Husky for pre-commit validations
2 parents fea0389 + a930121 commit 9a44887

File tree

3 files changed

+1569
-1667
lines changed

3 files changed

+1569
-1667
lines changed

.husky/pre-commit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
npm run format && npm run lint
1+
# npm run format && npm run lint
2+
npx lint-staged

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@
4040
"eslint": "latest",
4141
"eslint-config-next": "latest",
4242
"husky": "^9.1.6",
43+
"lint-staged": "^15.2.10",
4344
"prettier": "^3.3.3",
4445
"typescript": "latest"
46+
},
47+
"lint-staged": {
48+
"src/**/*.{ts,tsx,js,jsx,md,mdx,css,yaml,yml}": [
49+
"prettier --write"
50+
],
51+
"src/**/*.{ts,tsx,js,jsx}": [
52+
"eslint"
53+
]
4554
}
4655
}

0 commit comments

Comments
 (0)