Skip to content

Commit 8ce3a81

Browse files
pablobirukovbradzacher
authored andcommitted
fix(typescript-estree): correct ClassDeclarationBase type (typescript-eslint#1008)
according to the spec, ClassDeclarationBase.id and ClassDeclarationBase.superClass are always present and nullable
1 parent cdf9294 commit 8ce3a81

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/eslint-plugin/src/rules/indent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export default util.createRule<Options, MessageIds>({
344344
]({
345345
type: AST_NODE_TYPES.ClassDeclaration,
346346
body: node.body as any,
347-
id: undefined,
347+
id: null,
348348
// TODO: This is invalid, there can be more than one extends in interface
349349
superClass: node.extends![0].expression as any,
350350

packages/typescript-estree/src/ts-estree/ts-estree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ interface BinaryExpressionBase extends BaseNode {
454454
interface ClassDeclarationBase extends BaseNode {
455455
typeParameters?: TSTypeParameterDeclaration;
456456
superTypeParameters?: TSTypeParameterInstantiation;
457-
id?: Identifier;
457+
id: Identifier | null;
458458
body: ClassBody;
459-
superClass?: LeftHandSideExpression;
459+
superClass: LeftHandSideExpression | null;
460460
implements?: ExpressionWithTypeArguments[];
461461
abstract?: boolean;
462462
declare?: boolean;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy