-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
What version of standard?
v13
What did you expect to happen?
The new lines-between-class-members rule 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:
class DataMuncher {
// Work:
pendingItems = []
finishedItems = []
// Scheduling:
started: boolean = false
stopped: boolean = false
timeoutId = null
constructor () { ... }
someMethod () { ... }
}What actually happened?
With the new rule, Standard now insists on spaces between the class field declarations:
class DataMuncher {
// Work:
pendingItems = []
finishedItems = []
// Scheduling:
started: boolean = false
stopped: boolean = false
timeoutId = null
constructor () { ... }
someMethod () { ... }
}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": true option to this eslint rule would help users who use Standard.js along with this experimental / non-standard feature.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status