Skip to content
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

Imports and declare module #372

Open
eps1lon opened this issue Mar 21, 2024 · 0 comments
Open

Imports and declare module #372

eps1lon opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@eps1lon
Copy link
Owner

eps1lon commented Mar 21, 2024

We either add the imports globally (scoped-jsx) or add them to the very first import with source 'react'. However, this is incorrect when we're dealing with module augmentation.

This is a reduced example from vercel/nextjs where we had to manually adjust the codemod

-import {type JSX} from 'react'

 declare module 'react-dom/server.browser'
 declare module 'react-dom/server.edge' {
+  import {type JSX} from 'react'
 }

It's going to be a bit involved to get this working since we have to leverage scope analysis to fix it.

@eps1lon eps1lon added the bug Something isn't working label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready
Development

No branches or pull requests

1 participant