Skip to content

React-Plugin does not respect the jsxImportSource from TSConfig  #9

@seivan

Description

@seivan

Description

A user shouldn't have to define jsxImportSource twice, if it's in a TSConfig then it's already defined.
ESBuild (and hopefully Vite) already respects that as far as I know for:
jsxFactory
jsxFragmentFactory

I think the plugin should do that for jsxImportSource as well.

Suggested solution

Read TSConfig.compilerOptions.jsxImportSource ?? options?.jsxImportSource ?? "react"

Alternative

Building a shim for the auto-import and let ESBuild the whole thing instead of using the plugin.

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions