Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
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
Description
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
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