diff --git a/src/rules/spaceBeforeFunctionParenRule.ts b/src/rules/spaceBeforeFunctionParenRule.ts index 0b285e9571a..e1c8b1363e5 100644 --- a/src/rules/spaceBeforeFunctionParenRule.ts +++ b/src/rules/spaceBeforeFunctionParenRule.ts @@ -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: