Skip to content

Commit

Permalink
chore(repo): run linter fix against staged files in pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
HuiSF committed May 8, 2024
1 parent 2ce82f9 commit 7d281fa
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Run `eslint --fix` against staged files
yarn lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
"*.{ts,tsx}": "eslint --fix"
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"publish:v5-stable": "lerna publish --conventional-commits --yes --dist-tag=stable-5 --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:verdaccio": "lerna publish --canary --force-publish --no-push --dist-tag=unstable --preid=unstable --yes",
"ts-coverage": "lerna run ts-coverage",
"prepare": "./scripts/set-preid-versions.sh"
"prepare": "husky && ./scripts/set-preid-versions.sh"
},
"workspaces": {
"packages": [
Expand Down Expand Up @@ -103,11 +103,13 @@
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unused-imports": "^3.0.0",
"glob": "^10.3.10",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"json-loader": "^0.5.7",
"lerna": "^7.4.2",
"license-check-and-add": "^4.0.5",
"lint-staged": "^15.2.2",
"mkdirp": "^3.0.1",
"prettier": "^3.2.5",
"rimraf": "^2.6.2",
Expand Down
Loading

0 comments on commit 7d281fa

Please sign in to comment.