Add git hooks for lockfile sync and pre-push typecheck, migrate lint-staged to dedicated config - #140
Merged
Merged
Conversation
Modified ESLint and lint-staged configs to better support modular and conditional linting Should save time in creating commits and further reduce risk of outdated node_modules
|
🌐 Preview URL: https://pr-140.frcsoftware.pages.dev |
httphypixelnet
marked this pull request as ready for review
July 27, 2026 20:23
3 tasks
samfreund
reviewed
Jul 29, 2026
samfreund
reviewed
Jul 29, 2026
samfreund
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds additional git hooks and improves the lint-staged configuration to run linters/formatters only on staged files, rather than the entire codebase.
What changed
New git hooks:
.husky/pre-push— runspnpm typecheck --minimumFailingSeverity warningbefore pushes.husky/post-checkout— runsscripts/post-checkout.mjsto auto-detect lockfile changes and re-runpnpm installNew scripts:
scripts/stamp.mjs— utility to hash the lockfile and write/read a checksum stamp innode_modulesscripts/post-checkout.mjs— compares lockfile hash to the stamp; if changed, runspnpm installautomaticallyscripts/postinstall.ts— writes the lockfile hash stamp afterpnpm installscripts/syncLockfile.lint.ts— validates thatpnpm-lock.yamlis in sync withpackage.json, fixing the increasingly common issue of people switching branches without updating their lockfile.New
lint-staged.config.mjs— replaces the inlinelint-stagedconfig inpackage.jsonwith a proper config file. Each file pattern now passes only the matched files to its respective tool (prettier, eslint, remark, spotless, glossary generation, lockfile sync), instead of running globalpnpm format/pnpm linton every staged file. This should hopefully reduce time it takes for commits to be generated.ESLint config updates (
eslint.config.mjs):defineConfigfromeslint/config, enabling type hints for the config file in editorsno-undefis now'error'locally but'off'in CI (sinceastro checkcovers type-checking there)globals.nodeforscripts/*andsrc/plugins/***/*.astro/**/*.tsfilesscripts/from the ignores list (now linted)Meta
Merge checklist:
This PR body has been generated by an LLM for readability, but I've reviewed and corrected it.