Fix pre-commit hook and TypeScript build errors#3117
Merged
Conversation
Change shebang from #!/bin/sh to #!/bin/bash because the script uses herestrings (<<<), which are a bash extension unsupported by POSIX sh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous fix (changing shebang to #!/bin/bash) didn't work because Husky's runner (.husky/_/h) explicitly invokes hooks with `sh -e`. Replace the herestring (<<<) and ANSI-C quoting ($'\n') with POSIX-compatible printf piping, and revert the shebang to #!/bin/sh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The global JSX namespace is no longer available in newer TypeScript versions. Replace JSX.Element return types with React.ReactElement in 4 component files that were failing tsc. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes two categories of development tooling issues: POSIX compatibility of the .husky/pre-commit shell script, and TypeScript type errors in four React component files caused by removal of the global JSX namespace in @types/react v19.
Changes:
- Replace bash-only syntax (
$'\n',<<<here-string) infilter_prettier_ignoredwith POSIX-compatibleprintf '%s\n'and pipe-to-whilepattern - Replace
JSX.Elementreturn type annotation withReact.ReactElementin four component files (NotFoundContent,InteractiveDiagrams,HomepageFeatures,CustomDetails)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.husky/pre-commit |
Rewrites filter_prettier_ignored to use POSIX sh syntax (removes bash-specific $'\n' literal and <<< here-string) |
src/theme/NotFound/Content/index.tsx |
Updates return type from JSX.Element to React.ReactElement |
src/components/InteractiveDiagrams/index.tsx |
Updates return type from JSX.Element to React.ReactElement |
src/components/HomepageFeatures/index.tsx |
Updates return type from JSX.Element to React.ReactElement |
src/components/CustomDetails/index.tsx |
Updates return type from JSX.Element to React.ReactElement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
anegg0
approved these changes
Mar 6, 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.
Summary
shsyntax instead of bash-only constructs ([[ ]],=~, process substitution), since/bin/shon many systems is dash, not bashCannot find namespace 'JSX'TypeScript errors in 4 component files by replacingJSX.ElementwithReact.ReactElement(the globalJSXnamespace was removed in newer TS versions)Test plan
yarn tscpasses with no errorsgit committriggers the pre-commit hook successfully on a system where/bin/shis dash🤖 Generated with Claude Code