Skip to content

JsxAttributes - Add kind property #32364

Closed
@dsherret

Description

@dsherret

Search Terms

JsxAttributes kind

Suggestion

Change:

export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
    parent: JsxOpeningLikeElement;
}

To:

export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
    kind: SyntaxKind.JsxAttributes;
    parent: JsxOpeningLikeElement;
}

Use Cases

Would help when people are narrowing down types while using the compiler api.

In my case, I'm analyzing nodes in the compiler and it couldn't figure out the kind of JsxAttributes. So I hardcoded a condition right now to properly return the kind.

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelates to the public API for TypeScriptSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions