Hacker News new | ask | show | jobs
by normie3000 249 days ago
> format-on-save

A dystopian feature!

3 comments

I'll do one better: In the recent teams I worked, we even had "organize imports on save".
I love format on save. I can type (or paste) ignoring whitespace, hit save, and everything pops right into place for me.

Also, stuff not auto formatting is usually immediate feedback that I didn’t match my parenthesis or have some other major syntax error.

Yes, some people do not see the light. Ever since starting to rely on prettier + format on save, I can just bang out code and focus more on content than formatting and let it handle everything for me. Speed multiplier.
I do care about my whitespace and it does have meaning. Throwing it all away on safe sounds annoying.
Sure, but it sounds like you have a problem with prettier/white space auto-formatters in general? My comment was assuming you want an auto-formatter, and I gave the reasons for why you’d want it to apply on save vs format-on-commit or w/e.
I care about my vertical white space (eg: grouping some things together gives me some logical separation).

I don't care about horizontal white space. That should just properly get indented and spaced into a consistent block format.

Fine, I do. Also most tools don't get the difference between indenting and aligning and mess that up.
100% agree. Autoformatting is such a great feedback mechanism.

Did this not indent where I expected? Did it not change the formatting?

Do I use it as a crutch? Maybe. Would I be a better programmer if I didn't use it? I doubt it.

Fight the power, setup format on checkout with your own rules.