Skip to content

Commit

Permalink
chore(DevX): Add lint-staged to launch Prettier when commiting (#2629)
Browse files Browse the repository at this point in the history
  • Loading branch information
grafakus authored Nov 3, 2023
1 parent 80c9dc9 commit 99e32c8
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 13 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
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
"format": "prettier --check .",
"format:fix": "prettier --write .",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
"build-storybook": "build-storybook",
"prepare": "husky install"
},
"lint-staged": {
"*.{ts,tsx,scss}": "yarn format:fix"
},
"devDependencies": {
"@babel/core": "^7.22.9",
Expand Down Expand Up @@ -92,11 +96,13 @@
"eslint-plugin-unused-imports": "^2.0.0",
"expose-loader": "^4.1.0",
"html-webpack-plugin": "^5.5.0",
"husky": "^8.0.3",
"jest": "^27.5.1",
"jest-canvas-mock": "^2.3.1",
"jest-css-modules-transform": "^4.4.2",
"jest-environment-jsdom": "^27.5.1",
"jest-fetch-mock": "^3.0.3",
"lint-staged": "^15.0.2",
"mini-css-extract-plugin": "^2.7.5",
"msw": "^0.36.3",
"optimize-css-assets-webpack-plugin": "^6.0.1",
Expand Down
Loading

0 comments on commit 99e32c8

Please sign in to comment.