Remix.run Logo
thrown-0825 5 days ago

does it have a go fmt / lint command yet?

Sammi 5 days ago | parent | next [-]

  npx prettier
moogly 4 days ago | parent | next [-]

I moved on to Biome (which replaces both ESLint and Prettier) and while the IDE extensions have been a bit buggy, it's much faster and has fewer dependencies. It was always a pain to set up ESLint + Prettier.

MrJohz 4 days ago | parent | next [-]

ESLint these days doesn't have any styling related lints (unless you opt into them) which means that it works out-of-the-box with Prettier (or Biome's formatter, presumably).

My fear with Biome is missing out on type-aware lints, but I know Oxlint has had some success integrating the new Go typescript compiler, so maybe that will work out for Biome as well.

latchkey 4 days ago | parent | prev [-]

Replacing something hard to setup with something buggy is a win?

moogly 4 days ago | parent [-]

They've improved, and they will be fine pretty soon.

thrown-0825 5 days ago | parent | prev [-]

does that require a config?

coldtea 5 days ago | parent | next [-]

depends, will you keep finding pendatic faults after any answer?

ohmahjong 5 days ago | parent | next [-]

Having a typo in "pendantic" is a masterstroke

coldtea 3 days ago | parent | next [-]

Seeing that my comment was against pedantry, no contradiction there!

masfuerte 5 days ago | parent | prev [-]

> "pendantic"

Genius!

throwanem 4 days ago | parent [-]

One more time and it's pentadic. But imagine someone finding a way to bikeshed anti-bikeshedding tools. "Take with food."

thrown-0825 4 days ago | parent | prev [-]

I come from go where this stuff is default

akarlsten 4 days ago | parent | prev [-]

No, it has good defaults. See also: https://prettier.io/docs/option-philosophy

3 days ago | parent | next [-]
[deleted]
ZYbCRq22HbJ2y7 4 days ago | parent | prev [-]

Good to someone, somewhere, telling everyone else what good is.

Arguably, code formatters should be configurable, to get a format for your code that you want. Unfortunately, prettier isn't one, and it is a form of regression in many communities at the cost of choice pruning.

It might be great for a CI pipeline for constraining how code should look (use prettier, dumbass!), but it isn't great for actually formatting code, as it just makes the code "prettier".

nake89 4 days ago | parent [-]

Using it as a precommit hook in OSS projects makes it so that people can write code however they want. But it ends up in the repo following the guidelines of the repo. Minimizing unnecessary back-and-forth with PRs. Extremely useful in my opinion.

Even though prettier has defaults, but they can be modified to quite some extent to suit your projects needs: https://prettier.io/docs/options

ZYbCRq22HbJ2y7 3 days ago | parent [-]

> Using it as a precommit hook in OSS projects makes it so that people can write code however they want.

That is the point of a formatter, so any formatter would do that (and there were many more active projects to allow formatting before prettier came around).

> quite some extent

Not really, and I have written prettier plugins to get around that constraint.

IMO, its not great, which is kind of how things work out when you try to do everything in one project.

nake89 3 days ago | parent [-]

> That is the point of a formatter, so any formatter would do that (and there were many more active projects to allow formatting before prettier came around).

No arguments here. You are free to choose the formatter you want.

> Not really, and I have written prettier plugins to get around that constraint.

Or you could simply use those better formatters you were talking about.

pjmlp 5 days ago | parent | prev | next [-]

jslint/tslint are an install away.

beart 2 days ago | parent | next [-]

tslint has been deprecated for quite a long time now - from 2019: https://github.com/palantir/tslint/issues/4534

thrown-0825 5 days ago | parent | prev [-]

werent one of the js linters part of a supply chain attack recently?

pjmlp 5 days ago | parent [-]

Maybe, are you sure Go dependencies are immune to similar attacks?

fabioborellini 4 days ago | parent | next [-]

Yes, with the difference that Google would have to be compromised in order to poison the go distributable containing fmt tool. With js, it’s enough to poison any single one of the 1400 dependencies of the linter

pjmlp 4 days ago | parent | next [-]

I forgot that even though fmt will never suffer from middle man attacks downloading the Go toolchain, the standard library already covers 100% of the uses cases someone cares about using Go for, and no one is using CGO.

DanielHB 4 days ago | parent [-]

I used to use CGO quite a lot in linux-embedded environment.

And we had huge dependency chains as well to non-standard library stuff, nowhere near as bad as an average nodejs project but still not free from the problem.

homebrewer 4 days ago | parent | prev [-]

Use biome, it doesn't have any external dependencies. eslint should have been put to rest a long time ago.

prmph 4 days ago | parent | next [-]

Good advice. That was my conclusion as well after years of fighting with eslint.

thrown-0825 4 days ago | parent | prev [-]

someone else recommended this too, I'll give it a shot next time I'm in js land.

DanielHB 4 days ago | parent [-]

We added biome to our project, now we have eslint, prettier and biome in the project.

Seriously though it is nice, but migrating away from your existing tooling is painful and underappreciated.

thrown-0825 4 days ago | parent | prev [-]

go std lib being compromised would be a pretty major achievement

sisve 5 days ago | parent | prev [-]

Nope

thrown-0825 4 days ago | parent [-]

shame, I remember having a lot of issues getting ts-lint to work with test runners a few years back.