Skip to content

Bug: JSXElement type is not listed in .value of JSXAttribute #8280

Closed
@auvred

Description

@auvred

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

ast-spec

Playground Link

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

Repro Code

type value = TSESTree.JSXAttribute['value']
//   ^?

ESLint Config

No response

tsconfig

No response

Expected Result

type value = TSESTree.JSXAttribute['value']
//   ^? type value = TSESTree.JSXElement | TSESTree.JSXExpression | TSESTree.Literal | null

Actual Result

type value = TSESTree.JSXAttribute['value']
//   ^? type value = TSESTree.JSXExpression | TSESTree.Literal | null

Additional Info

ESLint Stylistic has JSXAttribute > JSXElement in the rule listener: source code. this is not yet supported by ast-spec:

export interface JSXAttribute extends BaseNode {
type: AST_NODE_TYPES.JSXAttribute;
name: JSXIdentifier | JSXNamespacedName;
value: JSXExpression | Literal | null;
}


This is the code that produces JSXAttribute > JSXElement:

<App horror=<div /> />

Ref: eslint-stylistic tests

Versions

package version
@typescript-eslint/typescript-estree 6.19.0
TypeScript 5.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinggood first issueGood for newcomerspackage: ast-specIssues related to @typescript-eslint/ast-spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions