Bug: wrong ImportAttribute#parent type #10254
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
AST
PRs and Issues about the AST structure
bug
Something isn't working
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
Uh oh!
There was an error while loading. Please reload this page.
Before You File a Bug Report Please Confirm You Have Done The Following...
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:
typescript-eslint/packages/types/src/ts-estree.ts
Line 54 in 964fa91
However, I think the correct way to follow ESTree is as follows:
https://github.com/estree/estree/blob/master/es2025.md
What do you think?
ESLint Config
tsconfig
Expected Result
I think
ImportAttribute#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
@typescript-eslint/eslint-plugin
8.12.2
@typescript-eslint/parser
8.12.2
@typescript-eslint/rule-tester
8.12.2
@typescript-eslint/scope-manager
8.12.2
@typescript-eslint/typescript-estree
8.12.2
@typescript-eslint/type-utils
8.12.2
@typescript-eslint/utils
8.12.2
TypeScript
5.6.2
ESLint
9.3.0
node
22.4.1
The text was updated successfully, but these errors were encountered: