Skip to content

Commit 3db661d

Browse files
fix(no-return-void): check additional ts function types
1 parent 3fda67a commit 3db661d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/rules/no-return-void.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,14 @@ export const rule = createRule<keyof typeof errorMessages, Options>(
137137
meta,
138138
defaultOptions,
139139
{
140+
ArrowFunctionExpression: checkFunction,
140141
FunctionDeclaration: checkFunction,
141142
FunctionExpression: checkFunction,
142-
ArrowFunctionExpression: checkFunction,
143+
TSCallSignatureDeclaration: checkFunction,
144+
TSConstructSignatureDeclaration: checkFunction,
145+
TSDeclareFunction: checkFunction,
146+
TSEmptyBodyFunctionExpression: checkFunction,
143147
TSFunctionType: checkFunction,
148+
TSMethodSignature: checkFunction,
144149
}
145150
);

src/util/node-types.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ export type ESFunction =
55
| TSESTree.FunctionDeclaration
66
| TSESTree.FunctionExpression;
77

8-
export type ESFunctionType = ESFunction | TSESTree.TSFunctionType;
8+
export type ESFunctionType =
9+
| ESFunction
10+
| TSESTree.TSCallSignatureDeclaration
11+
| TSESTree.TSConstructSignatureDeclaration
12+
| TSESTree.TSDeclareFunction
13+
| TSESTree.TSEmptyBodyFunctionExpression
14+
| TSESTree.TSFunctionType
15+
| TSESTree.TSMethodSignature;
916

1017
export type ESClass = TSESTree.ClassDeclaration | TSESTree.ClassExpression;
1118

0 commit comments

Comments
 (0)