Skip to content

Commit c2cd991

Browse files
committed
chore: fix prefer-inject
1 parent d514cb4 commit c2cd991

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

packages/eslint-plugin/src/rules/prefer-inject.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,10 @@ export default createESLintRule<Options, MessageIds>({
9292
parent: TSESTree.ClassBody & { parent: TSESTree.ClassDeclaration };
9393
},
9494
) {
95-
const params = (node.value as TSESTree.FunctionExpression).params;
95+
const params = (node.value as TSESTree.FunctionExpression).params ?? [];
9696
if (params.length === 0) {
9797
return;
9898
}
99-
100-
// ignore constructors that only call super() (no parameters to inject)
101-
const body = node.value.body?.body ?? [];
102-
const onlySuper =
103-
body.length === 1 &&
104-
body[0].type === AST_NODE_TYPES.ExpressionStatement &&
105-
body[0].expression.type === AST_NODE_TYPES.CallExpression &&
106-
body[0].expression.callee.type === AST_NODE_TYPES.Super;
107-
if (onlySuper) {
108-
return;
109-
}
110-
11199
for (const param of params) {
112100
if (shouldReportParameter(param)) {
113101
context.report({ node: param, messageId: 'preferInject' });

0 commit comments

Comments
 (0)