Live data from Hacker News

Must have VSCode extensions for Front end developers

sharelist.co

11–18 of 18 posts

Re: Must have VSCode extensions for Front end developers

#11
post #8

Earlier quoted context omitted.

Why do you care about its style so much?

It's a bit annoying when you have a large project then someone introduces prettier. Suddenly every pull request has dozens of random formatting changes everywhere and it obscures the actual changes. It also completely nullifies the functionality of git blame (I know there are other ways to see the file history).

Run prettier on the entire codebase once and add an ignore-revs-file: https://git-scm.com/docs/git-blame#Documentation/git-blame.t...

Re: Must have VSCode extensions for Front end developers

#12
post #8

Earlier quoted context omitted.

Why do you care about its style so much?

It's a bit annoying when you have a large project then someone introduces prettier. Suddenly every pull request has dozens of random formatting changes everywhere and it obscures the actual changes. It also completely nullifies the functionality of git blame (I know there are other ways to see the file history).

The best way to introduce a formatter is with a git hook on commit/push (for JS projects see Husky), to ensure everyone is onboard and avoid exactly the formatting churn you mention.

Thanks LaurensBER for the ‘git blame’ solution!

https://github.com/typicode/husky

Re: Must have VSCode extensions for Front end developers

#13
post #2

I dislike prettier, imo it is too aggressive all around. I understand the lack of configurability is intentional (to force consistency on a macro scale) but I don’t like its style. Anyone have any good experiences with a more configurable formatter? Looking for one to adapt to existing coding style in a several years-old multi-application project.

[deleted]

Re: Must have VSCode extensions for Front end developers

#14
post #2

I dislike prettier, imo it is too aggressive all around. I understand the lack of configurability is intentional (to force consistency on a macro scale) but I don’t like its style. Anyone have any good experiences with a more configurable formatter? Looking for one to adapt to existing coding style in a several years-old multi-application project.

I've found that consistency trumps all aesthetic bike-shedding and hobby horses.

It’s not consistent. The worst thing about “prettier” is how it constantly flip flops back and forth between a single line or multiple lines for imports, destructuring and JSX tags.

I will jump ship the second something comes along that respects line breaks.

Re: Must have VSCode extensions for Front end developers

#15
post #8

Earlier quoted context omitted.

It's a bit annoying when you have a large project then someone introduces prettier. Suddenly every pull request has dozens of random formatting changes everywhere and it obscures the actual changes. It also completely nullifies the functionality of git blame (I know there are other ways to see the file history).

Run prettier on the entire codebase once and add an ignore-revs-file: https://git-scm.com/docs/git-blame#Documentation/git-blame.t...

How does that help? Genuine question.

Re: Must have VSCode extensions for Front end developers

#16

Earlier quoted context omitted.

Run prettier on the entire codebase once and add an ignore-revs-file: https://git-scm.com/docs/git-blame#Documentation/git-blame.t...

How does that help? Genuine question.

> running it on the entire codebase

The autoformatter config file is checked in with the PR that’s runs it on the entire codebase. Everybody’s machine autoformats the same way.

Only things that are changed in the PR will be formatted along with the PR.

The separate problem I’ve found is any outstanding PRs at the time of running it on the whole codebase should merge in the commit before the format all, then the format all change, then current master. It’s made resolving the PR merge conflicts easier

idk what the ignore rev file does

Re: Must have VSCode extensions for Front end developers

#17

Earlier quoted context omitted.

How does that help? Genuine question.

> running it on the entire codebase The autoformatter config file is checked in with the PR that’s runs it on the entire codebase. Everybody’s machine autoformats the same way. Only things that are changed in the PR will be formatted along with the PR. The separate problem I’ve found is any outstanding PRs at the time of running it on the whole codebase should merge in the commit before the format all, then the forma…

> idk what the ignore rev file does

Sorry - my question was ambiguous. That's the part that I don't understand.

Re: Must have VSCode extensions for Front end developers

#18
post #2

I dislike prettier, imo it is too aggressive all around. I understand the lack of configurability is intentional (to force consistency on a macro scale) but I don’t like its style. Anyone have any good experiences with a more configurable formatter? Looking for one to adapt to existing coding style in a several years-old multi-application project.

Why do you care about its style so much?

Because I find that its style reduces code readability.
Post reply on HN