
There is a superior pattern for class field declarations that can declutter constructors (often making them totally unnecessary.) The feature is still considered experimental but it works out of the box with babel.
Fail:
class Foo {
constructor() {
this.foo = 'foo';
}
}
Pass:
class Foo {
foo = 'foo';
}
IssueHunt Summary
frsgit has been rewarded.
Backers (Total: $30.00)
Submitted pull Requests
Tips
There is a superior pattern for class field declarations that can declutter constructors (often making them totally unnecessary.) The feature is still considered experimental but it works out of the box with babel.
Fail:
Pass:
IssueHunt Summary
Backers (Total: $30.00)
Submitted pull Requests
prefer-class-fieldsruleTips