Re:Show HN: Learn and practice modern JavaScript
by jacobwg on Thursday January 03, 2019 @04:05PM
(#18819263)
I think you are misunderstanding what Prettier does - Prettier is more in line with gofmt as it is a formatter not a linter. Prettier parses the JS code into an abstract syntax tree and then outputs that AST back into code using a defined set of rules, so you end up with one unified style. Prettier intentionally doesn't give you many configuration options for this style, with the goal of eliminating the discussion about which style to use.
If you are using Prettier, you can use the Prettier config with eslint or tslint, which fully disables the style rules for those two linters and lets them focus solely on linting for errors and structural issues.
Re:Show HN: Learn and practice modern JavaScript
by ergothus on Thursday January 03, 2019 @06:00PM
(#18820212)
Ah, I thought it consumed the style rules and rewrote to them, so you could pick your preferred styles and have everyone submit code that met them even if they didn't write in that way. Which sounds mostly correct, except for the "pick" part.
None of which says that Prettier itself is bad, but that excessive linting rules, with or without Prettier, are bad.
If I'm wrong about what Prettier does, please let me know. If you're discussing a default set of linting rules Prettier uses, cool, but I can't really say if I think they impact expressiveness since I'm not familiar with that set of rules.