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

Align AST for TSEnumDeclaration with TSInterfaceDeclaration, TSModuleDeclaration, etc #1305

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedenhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: typescript-estreeIssues related to @typescript-eslint/typescript-estree
Milestone
@bradzacher

Description

@bradzacher

For eachTSEnumDeclaration, we place its members directly on this AST node.

exportinterfaceTSEnumDeclarationextendsBaseNode{type:AST_NODE_TYPES.TSEnumDeclaration;id:Identifier;members:TSEnumMember[];const?:boolean;declare?:boolean;modifiers?:Modifier[];decorators?:Decorator[];}

For eachTSInterfaceDeclaration, we have a separateTSInterfaceBody node, upon which we place the members.

exportinterfaceTSInterfaceDeclarationextendsBaseNode{type:AST_NODE_TYPES.TSInterfaceDeclaration;body:TSInterfaceBody;id:Identifier;typeParameters?:TSTypeParameterDeclaration;extends?:ExpressionWithTypeArguments[];implements?:ExpressionWithTypeArguments[];decorators?:Decorator[];abstract?:boolean;declare?:boolean;}exportinterfaceTSInterfaceBodyextendsBaseNode{type:AST_NODE_TYPES.TSInterfaceBody;body:TypeElement[];}

I'm not sure why there's this inconsistency between the two, but I think we should consider aligning the two.

I'm not sure whyTSEnumDeclaration was created without a body, but I think that creating aTSEnumBody node seems like the correct thing to do.
Doing so would align it with not onlyTSInterfaceDeclaration, but alsoTSModuleDeclaration,ClassDeclaration andFunctionDeclaration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedenhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp