File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,15 @@ function checkAccessibility(node: TSESTree.MethodDefinition): boolean {
31
31
}
32
32
33
33
/**
34
- * Check if method is not unless due to typescript parameter properties
34
+ * Check if method is not useless due to typescript parameter properties and decorators
35
35
*/
36
36
function checkParams ( node : TSESTree . MethodDefinition ) : boolean {
37
37
return (
38
38
! node . value . params ||
39
39
! node . value . params . some (
40
- param => param . type === AST_NODE_TYPES . TSParameterProperty ,
40
+ param =>
41
+ param . type === AST_NODE_TYPES . TSParameterProperty ||
42
+ param . decorators ?. length ,
41
43
)
42
44
) ;
43
45
}
Original file line number Diff line number Diff line change @@ -206,6 +206,20 @@ class A extends B {
206
206
`
207
207
class A {
208
208
constructor(foo);
209
+ }
210
+ ` ,
211
+ `
212
+ class A extends Object {
213
+ constructor(@Foo foo: string) {
214
+ super(foo);
215
+ }
216
+ }
217
+ ` ,
218
+ `
219
+ class A extends Object {
220
+ constructor(foo: string, @Bar() bar) {
221
+ super(foo, bar);
222
+ }
209
223
}
210
224
` ,
211
225
] ,
You can’t perform that action at this time.
0 commit comments