Skip to content

Commit

Permalink
fix(typescript-estree): correct ClassDeclarationBase type (#1008)
Browse files Browse the repository at this point in the history
according to the spec, ClassDeclarationBase.id and ClassDeclarationBase.superClass are always present and nullable
  • Loading branch information
pablobirukov authored and bradzacher committed Sep 25, 2019
1 parent cdf9294 commit 8ce3a81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/indent.ts
Expand Up @@ -344,7 +344,7 @@ export default util.createRule<Options, MessageIds>({
]({
type: AST_NODE_TYPES.ClassDeclaration,
body: node.body as any,
id: undefined,
id: null,
// TODO: This is invalid, there can be more than one extends in interface
superClass: node.extends![0].expression as any,

Expand Down
4 changes: 2 additions & 2 deletions packages/typescript-estree/src/ts-estree/ts-estree.ts
Expand Up @@ -454,9 +454,9 @@ interface BinaryExpressionBase extends BaseNode {
interface ClassDeclarationBase extends BaseNode {
typeParameters?: TSTypeParameterDeclaration;
superTypeParameters?: TSTypeParameterInstantiation;
id?: Identifier;
id: Identifier | null;
body: ClassBody;
superClass?: LeftHandSideExpression;
superClass: LeftHandSideExpression | null;
implements?: ExpressionWithTypeArguments[];
abstract?: boolean;
declare?: boolean;
Expand Down

0 comments on commit 8ce3a81

Please sign in to comment.