File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
packages/eslint-plugin/src/rules Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -92,22 +92,10 @@ export default createESLintRule<Options, MessageIds>({
92
92
parent : TSESTree . ClassBody & { parent : TSESTree . ClassDeclaration } ;
93
93
} ,
94
94
) {
95
- const params = ( node . value as TSESTree . FunctionExpression ) . params ;
95
+ const params = ( node . value as TSESTree . FunctionExpression ) . params ?? [ ] ;
96
96
if ( params . length === 0 ) {
97
97
return ;
98
98
}
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
-
111
99
for ( const param of params ) {
112
100
if ( shouldReportParameter ( param ) ) {
113
101
context . report ( { node : param , messageId : 'preferInject' } ) ;
You can’t perform that action at this time.
0 commit comments