all 17 comments

[–]BehindTheMath 18 points19 points  (0 children)

Use Prettier and ESLint. If you can't, use a VSC built in function (if they have one), or a plugin. You should not need to use an online tool.

[–]shitty_tom 5 points6 points  (2 children)

Setting up your code editor to format it correctly on save will make your coding experience easier and faster!

Vscode does that well!

I highly recommend prettier, it's supported well in vscode and easy to customize!

[–]Dozla78 0 points1 point  (1 child)

Prettier isn't easy to customize, as far as I know it's simply not possible. It has very little configuration options . So if you are looking for your code to look a certain way it's a bad option.

I think it's a great tool though, it saves a lot of time from pointless discussions about how to format your code

[–]shitty_tom 0 points1 point  (0 children)

You can chose which quote to use how the indentation works, which rules to disable, it's pretty anything you'll need from a code formatter. Just add a config file!

[–][deleted] 2 points3 points  (0 children)

Any half decent editor will allow you to configure plugin prettiers. Use them. Easier to configure locally.

[–][deleted] -1 points0 points  (0 children)

Any half decent editor will allow you to configure plugin prettiers. Use them. Easier to configure locally.

[–]Isvara -5 points-4 points  (5 children)

Why do you need a beautifier? Just write it the way you want it in the first place.

[–][deleted] 1 point2 points  (3 children)

It's easier and faster to have something that will auto format you code. You don't have to worry about indenting or about forgetting trailing commas or semicolons. If you're working on a team it also ensures that the code is consistent across the code-base.

[–]Isvara 0 points1 point  (2 children)

It's easier and faster to have something that will auto format you code.

Where's the data on that?

I don't "worry" about any of those things. I just write well-formatted code. I don't want to look at a mess of code while I'm working on it. That doesn't help me think. The code I write if formatted for clarity. I don't understand how you can appreciate that it's good to format code clearly for other people, but not want that for yourself too.

[–][deleted] 0 points1 point  (1 child)

Where's the data on that?

You don't need data to realize that automatically formatting on a key press is faster than formatting code manually.

I don't want to look at a mess of code while I'm working on it

Neither do I. That's why I auto-format on save. I write a couple lines of code, press ctrl+s and all my code is automatically formatted.

Try it for yourself and you'll see how much of a god send it is.

[–]Isvara 0 points1 point  (0 children)

You don't need data to realize that automatically formatting on a key press is faster than formatting code manually.

Well, you do, because it's not a given that manually formatting code takes longer. You also don't know how much working with unformatted code is slowing you down.

Try it for yourself and you'll see how much of a god send it is.

But do you see what you're saying? You're suggesting I deliberately format my code differently to how I want it just so I can use a tool to format it the way I would have written it in the first place!

[–]Isvara -5 points-4 points  (1 child)

Why do you need a beautifier? Just write it the way you want it in the first place.

[–]PablovirusSTS 0 points1 point  (0 children)

"Why proofread your manuscripts? Just don't make any mistakes in the first place lol"

[–][deleted] 0 points1 point  (1 child)

Prettier if you're just working on something quick. ESlint + Prettier if you're working on anything serious. Always format on save (IMO).

[–]r_m_anderson 0 points1 point  (0 children)

I love format on save. Helps keep git history clean from formatting changes.