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

Commit

Permalink
Handle FunctionDeclaration separately
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-hanson committed May 6, 2017
1 parent 4ecb7e9 commit 4207cb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rules/spaceBeforeFunctionParenRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ function getOption(node: ts.Node, options: Options): Option | undefined {
return options.constructor;

case ts.SyntaxKind.FunctionDeclaration:
return options.named;

case ts.SyntaxKind.FunctionExpression:
return (node as ts.FunctionLikeDeclaration).name !== undefined ? options.named : options.anonymous;
return (node as ts.FunctionExpression).name !== undefined ? options.named : options.anonymous;

case ts.SyntaxKind.MethodDeclaration:
case ts.SyntaxKind.MethodSignature:
Expand Down

0 comments on commit 4207cb1

Please sign in to comment.