-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedThis change will require a new major version to be releasedenhancementNew feature or requestNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please 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-estreeIssues related to @typescript-eslint/typescript-estree
Milestone
Description
For each TSEnumDeclaration
, we place its members directly on this AST node.
export interface TSEnumDeclaration extends BaseNode {
type: AST_NODE_TYPES.TSEnumDeclaration;
id: Identifier;
members: TSEnumMember[];
const?: boolean;
declare?: boolean;
modifiers?: Modifier[];
decorators?: Decorator[];
}
For each TSInterfaceDeclaration
, we have a separate TSInterfaceBody
node, upon which we place the members.
export interface TSInterfaceDeclaration extends BaseNode {
type: AST_NODE_TYPES.TSInterfaceDeclaration;
body: TSInterfaceBody;
id: Identifier;
typeParameters?: TSTypeParameterDeclaration;
extends?: ExpressionWithTypeArguments[];
implements?: ExpressionWithTypeArguments[];
decorators?: Decorator[];
abstract?: boolean;
declare?: boolean;
}
export interface TSInterfaceBody extends BaseNode {
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 why TSEnumDeclaration
was created without a body, but I think that creating a TSEnumBody
node seems like the correct thing to do.
Doing so would align it with not only TSInterfaceDeclaration
, but also TSModuleDeclaration
, ClassDeclaration
and FunctionDeclaration
.
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedThis change will require a new major version to be releasedenhancementNew feature or requestNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please 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-estreeIssues related to @typescript-eslint/typescript-estree