sindresorhus/eslint-plugin-unicorn
Do you want to work on this issue?
You can request for a bounty in order to promote it!
Rule proposal: `prefer-class-fields` #314
MrHen posted onGitHub
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';
}
Fund this Issue
Only logged in users can fund an issue
Pull requests
Add `prefer-class-fields` rule #2512submitted byfrsgit(7)
Recent activities