-
Notifications
You must be signed in to change notification settings - Fork 649
[WIP] Emitting Declarations for React Components requires type annotation #1086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@copilot try again |
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
I've implemented a fix for the jsx-runtime declaration emit issue. The problem was that jsx-runtime imports were being treated as unsafe node_modules references. I added a helper function to detect jsx-runtime related imports and exclude them from the unsafe import check. The fix handles multiple jsx-runtime path patterns and doesn't break existing tests. Commit 1b414f4. |
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
internal/checker/jsx_runtime_test.go
Outdated
@@ -0,0 +1,33 @@ | |||
// Test to ensure jsx-runtime imports are allowed in declaration files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not create new unit tests, use compiler tests like in testdata/cases, or fix existing tests in the submodule. See your instructions on how to run tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Removed the unit test file and restored the compiler test in testdata/tests/cases/compiler/jsxRuntimeDeclarationEmit.tsx. The test runs correctly and verifies that jsx-runtime declaration emit no longer produces the unsafe import error. Commit 19b3ddb.
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.
Original issue description:
Fixes #1011.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.