Skip to content

Fix pre-commit hook and TypeScript build errors#3117

Merged
anegg0 merged 5 commits intomasterfrom
hk/fix-precommit-and-ts
Mar 6, 2026
Merged

Fix pre-commit hook and TypeScript build errors#3117
anegg0 merged 5 commits intomasterfrom
hk/fix-precommit-and-ts

Conversation

@hkalodner
Copy link
Copy Markdown
Contributor

Summary

  • Fix pre-commit hook to use POSIX sh syntax instead of bash-only constructs ([[ ]], =~, process substitution), since /bin/sh on many systems is dash, not bash
  • Fix Cannot find namespace 'JSX' TypeScript errors in 4 component files by replacing JSX.Element with React.ReactElement (the global JSX namespace was removed in newer TS versions)

Test plan

  • Verify yarn tsc passes with no errors
  • Verify git commit triggers the pre-commit hook successfully on a system where /bin/sh is dash

🤖 Generated with Claude Code

hkalodner and others added 3 commits February 14, 2026 19:03
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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arbitrum-docs Ready Ready Preview Mar 6, 2026 4:59am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) in filter_prettier_ignored with POSIX-compatible printf '%s\n' and pipe-to-while pattern
  • Replace JSX.Element return type annotation with React.ReactElement in 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 anegg0 merged commit 9541aca into master Mar 6, 2026
10 checks passed
@anegg0 anegg0 deleted the hk/fix-precommit-and-ts branch March 6, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants