Vasty improve linting performance - #146
Conversation
|
🌐 Preview URL: https://pr-146.frcsoftware.pages.dev |
Daniel1464
left a comment
There was a problem hiding this comment.
Great work! Here's another thing that probably should be bundled in this PR:
lint-staged actually passes the changed files as command-line args. Our lint-staged configuration calls pnpm format, which in turn calls prettier --write ., and pnpm lint, which calls eslint . and a bunch of other things. This meant that every time we made a commit, we were running the formatters on the whole repo instead of individual committed files.
To fix this, just change the lint-staged config in package.json to this:
"lint-staged": {
"**/*": [
"prettier --write",
"eslint",
"pnpm typecheck & pnpm lint:md & pnpm lint:regions",
"pnpm vale:setup && vale sync && vale"
],
"examples/**/*.java": "sh -c 'cd examples && ./gradlew spotlessApply'",
"src/data/glossary.ts": [
"pnpm generate:glossary",
"git add src/content/docs/resources/glossary.mdx"
]
}
This allows for prettier, eslint, and vale to run only on your committed files (the other lint scripts seem to fail if you do that.
| const ROOT = fileURLToPath(new URL('..', import.meta.url)); | ||
| const EXAMPLES_DIR = join(ROOT, 'examples'); | ||
| const DOCS_DIR = join(ROOT, 'src', 'content', 'docs'); | ||
| const SKIP_DIRS = new Set(['build', '.gradle', 'node_modules']); |
There was a problem hiding this comment.
Might as well add the gradle directory (not .gradle) while you're at it, even if it doesn't improve perf by that much.
|
See #140 |
Description
Fixed unintended analyzation of non-source files in the validate-regions script and set remark to only check for dead links in a CI environment.
Closes #143 and #87
Meta
Merge checklist: