Live data from Hacker News

Why is Prettier rock solid?

mrmr.io

41–50 of 163 posts

Re: Why is Prettier rock solid?

#41

I picked up standard[1] a while back for this reason, I don't want to have to think about it. It works fine, I have no complaints (took me a while to get used to not using semi-colons but now I prefer it) Same reason I use `cargo fmt` as well. [1] https://standardjs.com/

I switched to Python Black and isort for the exact same reason. It just takes all of the thinking out of it. Even better, these tools mean I don't have to teach (and police) code style. I let a pre-commit hook handle that.

I prefer https://github.com/asottile/reorder-python-imports over isort because isort has over 100 configuration options.

Re: Why is Prettier rock solid?

#42
post #35

I picked up standard[1] a while back for this reason, I don't want to have to think about it. It works fine, I have no complaints (took me a while to get used to not using semi-colons but now I prefer it) Same reason I use `cargo fmt` as well. [1] https://standardjs.com/

The hubris of naming it “standard” when it is not is a bit of a turn off.

Fake it 'til you make it.

Re: Why is Prettier rock solid?

#43

The debate for me is now eslint —-fix or prettier. I don’t get why people need more “control”. If it breaks code, then sure, I understand the reservation but in 99% of cases, it just, “I don’t like how it breaks up my code”. Why care? At least, if you’re all using it, the diffs will be predictable and PRs can focus on what matters. //rant

I can't remember the last time PR comments addressed minor formatting issues at all, in any language. If something is hard to grok it usually has to do with logic, not if there's a space between `if` and `(`.

Re: Why is Prettier rock solid?

#44
> note that gofmt doesn't indent, which is the hard part

interesting because for me it's hard to read changelogs of js/ts based repos that are using prettier compared to go repos, I wonder if the indentation is a reason for that. I'm honestly not sure what the author means by that either, gofmt seems to fix indentation for me.

Re: Why is Prettier rock solid?

#45
post #19

Earlier quoted context omitted.

For example, the latest Prettier makes XHTML files invalid by changing DOCTYPE to lowercase: https://github.com/prettier/prettier/issues/15476 Prettier moves ts-ignore comments which can cause TypeScript errors: https://github.com/prettier/prettier/issues/15876 Interpreting nested CSS functions' "-" as minus and inserting a space: https://github.com/prettier/prettier/issues/15369

1.1k open issues. OOF

1.1k isn't bad for a project with ~33 million weekly downloads[1], imo. Yes, I know that's not necessarily a good metric, but it's ~10 million more than React[2] which also has a similar number of open issues[3].

[1]: https://www.npmjs.com/package/prettier

[2]: https://www.npmjs.com/package/react

[3]: https://github.com/facebook/react

Re: Why is Prettier rock solid?

#46

The debate for me is now eslint —-fix or prettier. I don’t get why people need more “control”. If it breaks code, then sure, I understand the reservation but in 99% of cases, it just, “I don’t like how it breaks up my code”. Why care? At least, if you’re all using it, the diffs will be predictable and PRs can focus on what matters. //rant

ESLint deprecated its formatting rules and recommends Prettier and dprint - https://eslint.org/blog/2023/10/deprecating-formatting-rules...

Re: Why is Prettier rock solid?

#47
Interestingly, prettier just made a breaking change in a patch release and refused to undo it for a week or so, until a particularly silly pedantic argument won them over.

https://github.com/prettier/prettier/issues/15942

My only bad experience with prettier, besides the incredible slowness (orders of magnitude slower than ruff)

Re: Why is Prettier rock solid?

#48
post #35

I picked up standard[1] a while back for this reason, I don't want to have to think about it. It works fine, I have no complaints (took me a while to get used to not using semi-colons but now I prefer it) Same reason I use `cargo fmt` as well. [1] https://standardjs.com/

The hubris of naming it “standard” when it is not is a bit of a turn off.

Maybe the authors' meant "a" instead of "the".

Re: Why is Prettier rock solid?

#49
post #40

Off topic but every once and a while I'm made aware of the impact prettier has had on my typing. It's so hard to write code without a tool like prettier because formatting related keystrokes have largely been removed from my muscle memory. You basically end up writing a sort of shorthand.

But I am quite happy with it I don’t have to waste my time typing. I don’t have to waste my time improving my raw typing speed. I do solid touch typing 60WPM writing plain text. With code completion and linting it easily goes twice as fast writing code.

That's cool. I'm unironically interested, how do you manage to think at such speed?

Re: Why is Prettier rock solid?

#50
post #19

Earlier quoted context omitted.

For example, the latest Prettier makes XHTML files invalid by changing DOCTYPE to lowercase: https://github.com/prettier/prettier/issues/15476 Prettier moves ts-ignore comments which can cause TypeScript errors: https://github.com/prettier/prettier/issues/15876 Interpreting nested CSS functions' "-" as minus and inserting a space: https://github.com/prettier/prettier/issues/15369

1.1k open issues. OOF

Is that because they don’t use a bot to auto-close issues like a lot of other projects?
Post reply on HN