Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: wrong ImportAttribute#parent type #10254

Closed
Labels
ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
@ota-meshi

Description

@ota-meshi

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 havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Relevant Package

ast-spec

Playground Link

https://typescript-eslint.io/play/#ts=5.4.3&showAST=es&fileType=.tsx&code=JYWwDg9gTgLgBAQzgMyhEcDkA6A9AzOAd2BgAs4BvGATzAFMAuLAKwGcIA7TAXwG4AUPQAekWFTgAjODxRoMOXJMIlyVWg2aZ2XXoJFj4AKjnoseAMYrSFanSasO3fgNCGAFIoAmmADQTVMmZKOA0HbSdCWR4ASkEgA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYBfEWg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

Looking at the source code, the types are currently defined as follows:

interfaceImportAttribute{parent:TSESTree.ImportDeclaration|TSESTree.ImportExpression;}

parent:TSESTree.ImportDeclaration|TSESTree.ImportExpression;

However, I think the correct way to follow ESTree is as follows:

  interface ImportAttribute {-    parent: TSESTree.ImportDeclaration | TSESTree.ImportExpression;+    parent: TSESTree.ImportDeclaration | TSESTree. ExportNamedDeclaration | TSESTree. ExportAllDeclaration;  }

https://github.com/estree/estree/blob/master/es2025.md

What do you think?

ESLint Config

module.exports={/* This is not necessary. */};

tsconfig

{"compilerOptions": {// This is not necessary.  }}

Expected Result

I thinkImportAttribute#parent needs to beTSESTree.ImportDeclaration | TSESTree. ExportNamedDeclaration | TSESTree. ExportAllDeclaration.

Actual Result

Currently,ImportAttribute#parent isTSESTree.ImportDeclaration | TSESTree.ImportExpression, but I think this is wrong.

Additional Info

No response

Versions

packageversion
@typescript-eslint/eslint-plugin8.12.2
@typescript-eslint/parser8.12.2
@typescript-eslint/rule-tester8.12.2
@typescript-eslint/scope-manager8.12.2
@typescript-eslint/typescript-estree8.12.2
@typescript-eslint/type-utils8.12.2
@typescript-eslint/utils8.12.2
TypeScript5.6.2
ESLint9.3.0
node22.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp