Skip to content

Commit 65d7978

Browse files
committed
fix: improve tsc typecheck
Signed-off-by: Josef Andersson <josef.andersson@digg.se>
1 parent 67ea1f2 commit 65d7978

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

linters/node/types.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ main() {
3333
npm run typecheck
3434
elif [[ -f "package.json" ]] && grep -q '"type-check"' package.json 2>/dev/null; then
3535
npm run type-check
36+
elif [[ -x "node_modules/.bin/tsc" ]]; then
37+
# Use locally installed tsc
38+
node_modules/.bin/tsc --noEmit
3639
else
37-
# Fallback to direct tsc command
38-
npx tsc --noEmit
40+
# Fallback: use npx with explicit typescript package
41+
# Note: 'npx tsc' alone would install wrong package (deprecated 'tsc' not 'typescript')
42+
npx -p typescript tsc --noEmit
3943
fi
4044

4145
if [[ $? -eq 0 ]]; then

0 commit comments

Comments
 (0)