Skip to content

Imports and declare module #372

@eps1lon

Description

@eps1lon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions