-
Notifications
You must be signed in to change notification settings - Fork 22
Vasty improve linting performance #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5222542
179e717
1f8e82b
a68639b
617e72d
5e554e3
0169a43
347eb31
46a17f5
88c9bab
bef03ac
89cf3df
4b4ec18
828d333
7d9d164
0292004
555f870
2e8b5ca
0c4089f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,4 +33,6 @@ bun.lock | |
| */build/* | ||
|
|
||
| # IntelliJ | ||
| .idea | ||
| .idea | ||
| .eslintcache | ||
| tsconfig.tsbuildinfo | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,15 @@ | ||
| pnpm typecheck --minimumFailingSeverity warning | ||
| if git diff --cached --name-only | grep -q '\.astro$'; then | ||
| echo "Running full astro check" | ||
| astro check --minimumFailingSeverity warning | ||
| else | ||
| if [ -n "${DEBUG}" ]; then | ||
| echo "Using TypeScript version: $(tsc --version) at $(which tsc)" | ||
| start=$(date +%s%N) | ||
| tsc --noEmit | ||
| end=$(date +%s%N) | ||
| echo "TypeScript time (approx): $(((end - start)/1000000))ms" | ||
| else | ||
| echo "Running TypeScript check" | ||
| tsc --noEmit | ||
| fi | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |
| "prebuild": "tsx scripts/generate-glossary.ts", | ||
| "predev": "tsx scripts/generate-glossary.ts", | ||
| "lint": "pnpm lint:eslint && pnpm lint:md && pnpm lint:regions && pnpm lint:glossary && pnpm typecheck && pnpm vale", | ||
| "lint:eslint": "eslint .", | ||
| "lint:eslint": "eslint \"src/**/*.{ts,astro,js,mjs,css}\" \"*.mjs\" --cache", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should lint |
||
| "lint:md": "remark src/content/docs --ext mdx --frail", | ||
| "lint:regions": "tsx scripts/validate-regions.ts", | ||
| "vale": "pnpm vale:setup && vale sync && vale src/content", | ||
|
|
@@ -40,12 +40,13 @@ | |
| "@eslint/js": "^10.0.1", | ||
| "@types/estree": "^1.0.9", | ||
| "@types/mdast": "^4.0.4", | ||
| "@types/node": "^26.1.2", | ||
| "astro-eslint-parser": "^1.4.0", | ||
| "eslint": "^10.5.0", | ||
| "eslint-plugin-astro": "^1.7.0", | ||
| "mdast-util-mdx": "^3.0.0", | ||
| "husky": "^9.1.7", | ||
| "lint-staged": "^17.0.8", | ||
| "mdast-util-mdx": "^3.0.0", | ||
| "mdast-util-mdx-jsx": "^3.2.0", | ||
| "mdx2vast": "^0.3.1", | ||
| "prettier": "^3.8.4", | ||
|
|
@@ -61,6 +62,7 @@ | |
| "tsx": "^4.22.4", | ||
| "typescript": "^6.0.3", | ||
| "typescript-eslint": "^8.61.1", | ||
| "vfile": "^6.0.3" | ||
| "vfile": "^6.0.3", | ||
| "typescript-7": "npm:typescript@^7.0.2" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remind me why ts 7 is being added?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. speed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when we don't need to typecheck astro files, ts7 is ~6x faster (on my machine)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Works on my machine, maybe PATH issues? If you have a global |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git diff --cachedwon't actually do anything, that checks differences between staged and latest commit, but for a pre-push hook everything will have already been committed