Closed KidkArolis closed 5 years ago
Hi! Thanks for the pull request!
Neither of those rules conflict with Prettier or are unnecessary when using Prettier.
react/self-closing-comp
used to be part of eslint-config-prettier, but was removed in v5.0.0.
lines-between-class-members
enforces 0 or 1 blank line between class methods and suchlike. Prettier allows either 0 or 1 blank line there, so it does not conflict. I use this rule in several projects to autofix 1 blank line between class methods, since IMO it makes the code easier to read.
Which problems are you trying to solve with this pull request?
OK. I think I'm gonna close this PR, you're right in that neither of those rules conflict with prettier.
I now see that eslint-config-prettier is about turning off the rules that are:
I used to think that eslint-config-prettier was more about turning off rules that are code formatting related. That is, eslint can be seen as useful for 2 distinct use cases - code formatting (e.g white space, where to break the lines, new lines, etc.) and code correctness (unused variables, incorrect node api usage, etc.) I thought that if prettier doesn't format the class methods with a space between each method, then this config should turn the rule off, so that users can rely entirely on prettier to make the formatting decisions without having to do extra work. But in reality, all of this is a bit more blurry. Or in fact, eslint-config-prettier, as stated above, is only about not conflicting and about removing the unnecesary, not about "no formatting rules whatsoever".
Anyway, this was in context of https://github.com/KidkArolis/healthier, a tool which applies all of the standard
rules that are relevant for prettier
formatted codebase (since prettier
and standard
are not compatible out of the box). After releasing healthier 3.0, which upgrades to the latest standard 14, I ran it on an existing codebase and got a bunch of warnings about lines-between-class-members
and I thought – if prettier doesn't format that way, then perhaps the user running healthier shouldn't have to worry about manually adding extra formatting. I think I have 2 options here, extend healthier's config to disable that rule if healthier is more about turning off all formatting related rules. Or keep the rule in, to keep things really simple and continue conforming to standard as much as possible, which is still the primary purpose of the tool (whilst making it also compatible with prettier ouf of the box).
Anyway, thanks for reading if you got this far ;) And thanks for considering the PR.
The
lines-between-class-members
has been added to standard 14, but is a whitespace related rule. Best to turn it off if it's not something prettier formats to.The
react/self-closing-comp
was there in older versions of standard (I think?), but now that Prettier no longer automatically closes components, I think this should also be turned off.