Skip to content

Bug: Unexpected node TSAssertEntry #7960

@fisker

Description

@fisker

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Relevant Package

typescript-estree

Playground Link

No response

Repro Code

> require('@typescript-eslint/typescript-estree').parse('import json from "./foo.json" assert { type: "json", type: "bar" };').body[0].attributes
[
  {
    type: 'TSAssertEntry',
    name: {
      type: 'Identifier',
      decorators: [],
      name: 'type',
      optional: false,
      typeAnnotation: undefined,
      range: [Array],
      loc: [Object]
    },
    value: {
      type: 'Literal',
      value: 'json',
      raw: '"json"',
      range: [Array],
      loc: [Object]
    }
  },
  {
    type: 'TSAssertEntry',
    name: {
      type: 'Identifier',
      decorators: [],
      name: 'type',
      optional: false,
      typeAnnotation: undefined,
      range: [Array],
      loc: [Object]
    },
    value: {
      type: 'Literal',
      value: 'bar',
      raw: '"bar"',
      range: [Array],
      loc: [Object]
    }
  }
]

ESLint Config

No response

tsconfig

No response

Expected Result

Didn't see it mentioned in the changelog.

Actual Result

See above.

Additional Info

No response

Versions

6.11.0

Ref: prettier/prettier#15695

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy