File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 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 {
3131}
3232
3333/**
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
3535 */
3636function checkParams ( node : TSESTree . MethodDefinition ) : boolean {
3737 return (
3838 ! node . value . params ||
3939 ! 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 ,
4143 )
4244 ) ;
4345}
Original file line number Diff line number Diff line change @@ -206,6 +206,20 @@ class A extends B {
206206 `
207207class A {
208208 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+ }
209223}
210224 ` ,
211225 ] ,
You can’t perform that action at this time.
0 commit comments