Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
trailing-comma: check for a closing parenthesis (#4457)
Browse files Browse the repository at this point in the history
fixes #4456
  • Loading branch information
steinuil authored and adidahiya committed Jan 29, 2019
1 parent 4958030 commit 8486bf0
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/rules/trailingCommaRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,19 @@ class TrailingCommaWalker extends Lint.AbstractWalker<Options> {
case ts.SyntaxKind.ConstructorType:
case ts.SyntaxKind.FunctionType:
case ts.SyntaxKind.CallSignature:
this.checkList(
(node as ts.SignatureDeclaration).parameters,
getChildOfKind(node, ts.SyntaxKind.CloseParenToken, this.sourceFile)!.end,
"functions",
isRestParameter,
const closingParen = getChildOfKind(
node,
ts.SyntaxKind.CloseParenToken,
this.sourceFile,
);
if (closingParen !== undefined) {
this.checkList(
(node as ts.SignatureDeclaration).parameters,
closingParen.end,
"functions",
isRestParameter,
);
}
break;
case ts.SyntaxKind.TypeLiteral:
this.checkTypeLiteral(node as ts.TypeLiteralNode);
Expand Down

0 comments on commit 8486bf0

Please sign in to comment.