SonarTS
SonarTS copied to clipboard
Rule: Use parameter properties
https://www.typescriptlang.org/docs/handbook/classes.html
class A {
public prop: number
constructor(prop:number) {
this.prop = prop; // Noncompliant
}
}
class A {
constructor(public prop:number) {
}
}
There is open PR in TSLint https://github.com/palantir/tslint/pull/3656 We should wait until it's merged
looks like tslint PR was not merged, so we can try to implement our rule