Skip to content

Commit 25abd8a

Browse files
committed
chore(husky): Update husky and lint-staged scripts to improve errors that are caught
1 parent 76d272f commit 25abd8a

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

.husky/post-rewrite

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm lint-staged
5+
pnpm run tsc
6+
7+
if git rev-parse --abbrev-ref HEAD | grep -q "master"; then
8+
if grep "link:.." pnpm-lock.yaml; then
9+
echo "The above package links were found. Run either\
10+
`pnpm i` with link-workspace-packages=false prefer-frozen-lockfile=false set in `.npmrc`\
11+
OR if inside the monorepo run `pnpm i:remote` in the root of the monorepo"
12+
exit 1
13+
else
14+
echo "No package links found"
15+
fi
16+
fi

.husky/pre-commit

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ pnpm run tsc
66

77
if git rev-parse --abbrev-ref HEAD | grep -q "master"; then
88
if grep "link:.." pnpm-lock.yaml; then
9-
echo "The above package links were found. Run pnpm i:remote in the root of the monorepo"
9+
echo "The above package links were found. Run either\
10+
`pnpm i` with link-workspace-packages=false prefer-frozen-lockfile=false set in `.npmrc`\
11+
OR if inside the monorepo run `pnpm i:remote` in the root of the monorepo"
1012
exit 1
1113
else
1214
echo "No package links found"

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"build": "next build",
1212
"start": "next start",
1313
"tsc": "tsc --pretty --noEmit",
14-
"lint": "next lint",
15-
"format": "eslint --fix .",
14+
"lint": "eslint lint --max-warnings=0",
15+
"format": "eslint --fix --max-warnings=0",
16+
"format:all": "eslint --fix .",
1617
"test": "export $(cat .env.test.local | xargs) && playwright test",
1718
"test:debug": "PWDEBUG=1 pnpm t -- --headed",
1819
"test:ci": "playwright test"

0 commit comments

Comments
 (0)