Skip to content

Commit

Permalink
Add lint pre-commit hook using husky & lint-staged (#1973)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Nov 5, 2024
1 parent 595b7bd commit e268e1a
Show file tree
Hide file tree
Showing 5 changed files with 268 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged --concurrent false
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*": "prettier --write",
"*.(ts|tsx)": ["eslint --fix"]
}
2 changes: 2 additions & 0 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export default {
"@types/yargs",
// Required for `action-validator`
"@action-validator/*",
// Used for git pre-commit hooks
"husky",
],
ignoreBinaries: ["jq", "scripts/in-docker.sh"],
} satisfies KnipConfig;
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@
"eslint-plugin-n": "^17.12.0",
"eslint-plugin-unicorn": "^56.0.0",
"glob": "^11.0.0",
"husky": "^9.1.6",
"knip": "^5.0.0",
"lint-staged": "^15.2.10",
"matrix-web-i18n": "^3.2.1",
"mkdirp": "^3.0.0",
"pacote": "^20.0.0",
Expand Down
Loading

0 comments on commit e268e1a

Please sign in to comment.