Skip to content

Support for import attributes with TypeScript #15699

@marvinruder

Description

@marvinruder

Environments:

  • Prettier Version: 3.1.0
  • Running Prettier via: VS Code plugin (esbenp.prettier-vscode), also via ESLint and [email protected]
  • Runtime: Node.js v21.2.0
  • Operating System: Dev Container based on Alpine Linux 3.18.4
  • Prettier plugins (if any): –

Steps to reproduce:

Process the file

import packageInfo from "../../package.json" with { type: "json" };

with TypeScript parser.

https://prettier.io/playground/…

Expected behavior:

No errors

Actual behavior:

SyntaxError: ';' expected. (1:46)

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions