Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up`lines-between-class-members` & class field declarations #1347
Comments
swansontec
changed the title
`lines-between-class-members` & class properties
`lines-between-class-members` & class field declarations
Aug 2, 2019
This comment has been minimized.
This comment has been minimized.
|
Adding |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the suggestion. I agree with your reasoning. |
feross
closed this
in
db18da3
Aug 4, 2019
This comment has been minimized.
This comment has been minimized.
|
This will ship in |
feross
added this to the standard v14 milestone
Aug 4, 2019
feross
added
accepted
enhancement
labels
Aug 4, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
swansontec commentedAug 2, 2019
What version of standard?
v13
What did you expect to happen?
The new
lines-between-class-membersrule is great, since putting spaces between member functions is an obvious code cleanup. However, the class fields stage 3 proposal, Typescript, and Flow all add the concept of class member variables to the mix. They look something like this:What actually happened?
With the new rule, Standard now insists on spaces between the class field declarations:
This is a clear readability loss.
This mainly affects shareable config users, since Standard doesn't support class field declarations out-of-the-box. Adding the
"exceptAfterSingleLine": trueoption to this eslint rule would help users who use Standard.js along with this experimental / non-standard feature.