Skip to content

🐛 Valid JS parsed as TS #9548

@marvinhagemeister

Description

@marvinhagemeister

Environment information

Details
@biomejs/biome: 2.4.8

What happened?

const slotFn = isFirstMount
  ? i => ({ [CONTENT_SLOT]: i })
  : i => wrapSlotExpr(newExprs[i]);

Prints 2 errors:

expected `:` but instead found `=>`

and

return type annotation are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.

See https://biomejs.dev/playground/?code=YwBvAG4AcwB0ACAAcwBsAG8AdABGAG4AIAA9ACAAaQBzAEYAaQByAHMAdABNAG8AdQBuAHQACgAgACAAPwAgAGkAIAA9AD4AIAAoAHsAIABbAEMATwBOAFQARQBOAFQAXwBTAEwATwBUAF0AOgAgAGkAIAB9ACkACgAgACAAOgAgAGkAIAA9AD4AIAB3AHIAYQBwAFMAbABvAHQARQB4AHAAcgAoAG4AZQB3AEUAeABwAHIAcwBbAGkAXQApADsA&language=ts

Expected result

No errors.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

Labels

A-ParserArea: parserL-JavaScriptLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions