SCAL-238049 add pre-commit type/lint gate, fix tsc exit-code bug - #682
Merged
Merged
Conversation
Add husky + lint-staged: pre-commit lints staged files and type-checks the full project. Lint-staged config lives in .lintstagedrc.json to match the convention used in spotter-code's pre-commit setup. Fix tsc script exit code: ';' between the two compiles reported only the second command's status, so a failing ESM compile could still pass CI. Changed to '&&'. Add tsc:check (--noEmit) so the hook checks types without writing to lib/ and cjs/. Fix comment-length lint warnings across affected files (line wrapping only, no logic changes). Set eslint-plugin-react version to 'detect' to silence a config warning on every lint run.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces Husky and lint-staged to run linting and type checks on pre-commit, updates ESLint configurations, and reformats comment wrapping across multiple files. The review feedback suggests adding a shebang line to the pre-commit hook script for better portability and offers suggestions to improve the readability of several wrapped comments.
commit: |
yinstardev
previously approved these changes
Sep 23, 2026
Drop .lintstagedrc.json and move its one rule under a 'lint-staged' key in package.json instead, so the pre-commit setup only touches eslint.config.mjs and .husky/pre-commit rather than a third file. No behavior change.
jitendra-bhati-ts
dismissed stale reviews from shivam-kumar-ts and yinstardev
via
September 23, 2026 10:45
7e2a8b6
Add #!/bin/sh at the top of .husky/pre-commit and mark it executable, so the script runs with the correct interpreter regardless of how it is invoked.
sastaachar
approved these changes
Sep 23, 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.
Add husky + lint-staged: pre-commit lints staged files and type-checks the full project. Lint-staged config lives in .lintstagedrc.json to match the convention.
Fix tsc script exit code: ';' between the two compiles reported only the second command's status, so a failing ESM compile could still pass CI. Changed to '&&'.
Add tsc:check (--noEmit) so the hook checks types without writing to lib/ and cjs/.
Fix comment-length lint warnings across affected files (line wrapping only, no logic changes).
Set eslint-plugin-react version to 'detect' to silence a config warning on every lint run.