5 ms·
I wish gofmt would let you set a desired line length and break it for you.. prettier has me spoiled in that regard
by thatswrong0 7y ago
I wish gofmt would let you set a desired line length and break it for you.. prettier has me spoiled in that regard
- mcbits 7y agoIf a tool is going to enforce line length limits, I'd rather have it spit a warning/error than silently try to guess a good place to break the line automatically. Otherwise, an editor tool that soft-wraps long lines at the (often poorly) guessed location without touching the code would be better.
- thatswrong0 7y agoBut that’s the thing about prettier - it wraps exceptionally well because it actually parses the AST. I never think about how I space my JavaScript anymore because it always does it correctly.. it’s one less thing to get in my way when I code
- mcbits 7y agoThe number of options that prettier exposes (despite boasting about being "opinionated", i.e. disregarding the user's opinions) suggests that there are people with different aesthetics or accessibility needs who would not consider one style to be always correct. IMHO we're about 10 years overdue for committing a canonical representation of that AST to version control instead of treating a particular serialized visualization of it as the single source of truth (and spending countless hours debating which format is "good enough" for everyone in every situation).
- hacknat 7y agoYou can always set your defaults for your editor.