zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
44.51k stars 2.4k forks source link

Typescript `react-jsx` JSX not well handled. #14344

Open neolitec opened 1 month ago

neolitec commented 1 month ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I have a React project where I'm using this configuration in tsconfig.json:

{
  "compilerOptions": {
    ...
    "jsx": "react-jsx",
    ...
  }
}

This way, we don't have to import React every time we're using the JSX syntax.

The issue is that I'm still seeing this error:

'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.

image

Environment

Zed: v0.143.7 (Zed) OS: macOS 14.5.0 Memory: 36 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

Moshyfawn commented 1 month ago

A simple Vite React + TS project using

{
  "compilerOptions": {
    ...
    "jsx": "react-jsx",
    ...
  }
}

seems to be handled correctly. Do you happen to have a reproduction of this behaviour?

Moshyfawn commented 1 month ago

Toggling the jsx flag on and off seems to be handled correctly by Zed too 🤔