Skip to content

Commit

Permalink
fix: only lint and format staged changes
Browse files Browse the repository at this point in the history
This commit adds the package lint-staged. I think when lint-staged
is calling pnpm run lint it passes some file arguments. Since pnpm
run lint calls turbo run lint this argument is getting passed directly
resulting in an error as extra arguments get added to the tubro command.
to prevent this we add '--' to signigy not to pass on further arguments.

:wq
:wq
:wq
wq
qw
:qw
  • Loading branch information
AlexVascon committed May 1, 2024
1 parent 3d5bcac commit 34ac617
Show file tree
Hide file tree
Showing 3 changed files with 8,264 additions and 6,333 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint && pnpm format && pnpm test:api
npx lint-staged && pnpm test:api
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,21 @@
"prepare": "husky install",
"sourcemaps:api": "turbo run sourcemaps --filter=api"
},
"lint-staged": {
"*.{js,ts,tsx}": [
"pnpm run lint --",
"pnpm run format"
],
"*.json": [
"pnpm run format"
]
},
"packageManager": "pnpm@9.0.5",
"devDependencies": {
"@sentry/cli": "^2.28.6",
"@sentry/webpack-plugin": "^2.14.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.0.0",
"prettier-plugin-tailwindcss": "^0.5.11",
"prisma": "5.12.1",
Expand Down
Loading

0 comments on commit 34ac617

Please sign in to comment.