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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Wrong error message when using JSX in a non-JSX file #2085

Open
1 task done
simon-paris opened this issue Mar 14, 2024 · 2 comments
Open
1 task done

馃悰 Wrong error message when using JSX in a non-JSX file #2085

simon-paris opened this issue Mar 14, 2024 · 2 comments
Labels
A-Parser Area: parser L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@simon-paris
Copy link

Environment information

CLI:
  Version:                      1.6.1
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.18"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           true
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 false

Workspace:
  Open Documents:               0

What happened?

  1. Use JSX in a .js file (no typescript, no JSX)
  2. The error message is "Type assertion are a TypeScript only feature."

https://biomejs.dev/playground/?code=ZgB1AG4AYwB0AGkAbwBuACAAZgAoACkAIAB7AAoAIAAgAHIAZQB0AHUAcgBuACAAPABkAGkAdgAvAD4AOwAKAH0A&typescript=false&jsx=false&script=true

Expected result

It should print a better error message.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@togami2864 togami2864 added S-Help-wanted Status: you're familiar with the code base and want to help the project A-Parser Area: parser L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature labels Mar 14, 2024
@cdvillard
Copy link

I'm experiencing the same with a very basic React demo I'm writing. This is specifically involving JSX syntax as it occurs for me in both JS and JSX files.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Parser Area: parser L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

No branches or pull requests

3 participants