Skip to content

Commit

Permalink
feat: pre-commit prettier (#27)
Browse files Browse the repository at this point in the history
Added `husky` pre-commit processing for `prettier` and `eslint`. Removed the GH Action because it was breaking CI by pushing unchecked commits.
  • Loading branch information
mjaquiery authored Oct 8, 2024
1 parent 6c75e9d commit 8fff2c4
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 838 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.pnpm-store
docker-compose.override.yaml
25 changes: 0 additions & 25 deletions .github/workflows/prettier.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ src/client_templates/.generated/

*storybook.log
storybook-static/

docker-compose.override.yaml
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
18 changes: 14 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"@mui/lab": "^5.0.0-alpha.172",
"@mui/material": "^5.16.4",
"@mui/system": "^5.16.4",
"@react-buddy/ide-toolbox": "^2.4.0",
"@react-buddy/palette-mui": "^5.0.1",
"@tanstack/react-query": "^5",
"apache-arrow": "^17.0.0",
"array-move": "^4.0.0",
Expand All @@ -36,9 +38,7 @@
"tss-react": "^4.9.10",
"use-immer": "^0.10.0",
"usehooks-ts": "^3.1.0",
"web-vitals": "^4.2.2",
"@react-buddy/ide-toolbox": "^2.4.0",
"@react-buddy/palette-mui": "^5.0.1"
"web-vitals": "^4.2.2"
},
"devDependencies": {
"@chromatic-com/storybook": "1.6.1",
Expand Down Expand Up @@ -77,9 +77,11 @@
"eslint-plugin-react-refresh": "^0.4.9",
"eslint-plugin-storybook": "^0.8.0",
"globals": "^15.8.0",
"husky": "^9.1.6",
"jsdom": "^24.1.1",
"msw": "^2.3.2",
"msw-storybook-addon": "2.0.3",
"prettier": "^3.3.3",
"start-server-and-test": "^2.0.4",
"storybook": "^8.2.6",
"storybook-addon-remix-react-router": "3.0.0",
Expand All @@ -103,7 +105,8 @@
"cypress:run": "cypress run",
"cypress:e2e": "start-server-and-test 'pnpm start --port 8002' http://localhost 'pnpm cypress:run'",
"storybook": "storybook dev -p 6006 --no-open",
"build-storybook": "storybook build"
"build-storybook": "storybook build",
"prepare": "husky install"
},
"eslintConfig": {
"extends": [
Expand All @@ -114,5 +117,12 @@
"workerDirectory": [
"public"
]
},
"lint-staged": {
"*.{ts,tsx}": [
"eslint --cache --fix",
"prettier --write"
],
"*.{js,jsx,md,html,css}": "prettier --write"
}
}
12 changes: 12 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 0 additions & 49 deletions src/stories/default/Button.stories.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/stories/default/Button.tsx

This file was deleted.

Loading

0 comments on commit 8fff2c4

Please sign in to comment.