News for hackers. Stuff that matters.
Re:Node.js can now execute TypeScript files by Sammi on Sunday August 17, 2025 @06:08AM (#44930409)

  npx prettier
Re:Node.js can now execute TypeScript files by thrown-0825 on Sunday August 17, 2025 @06:13AM (#44930437)
does that require a config?
Re:Node.js can now execute TypeScript files by coldtea on Sunday August 17, 2025 @06:35AM (#44930548)
depends, will you keep finding pendatic faults after any answer?
Re:Node.js can now execute TypeScript files by ohmahjong on Sunday August 17, 2025 @07:03AM (#44930710)
Having a typo in "pendantic" is a masterstroke
Re:Node.js can now execute TypeScript files by masfuerte on Sunday August 17, 2025 @07:07AM (#44930741)
> "pendantic"

Genius!

Re:Node.js can now execute TypeScript files by throwanem on Sunday August 17, 2025 @10:59AM (#44932090)
One more time and it's pentadic. But imagine someone finding a way to bikeshed anti-bikeshedding tools. "Take with food."
Re:Node.js can now execute TypeScript files by coldtea on Monday August 18, 2025 @06:13PM (#44945857)
Seeing that my comment was against pedantry, no contradiction there!
Re:Node.js can now execute TypeScript files by thrown-0825 on Monday August 18, 2025 @12:52AM (#44937525)
I come from go where this stuff is default
Re:Node.js can now execute TypeScript files by akarlsten on Sunday August 17, 2025 @09:01AM (#44931282)
No, it has good defaults. See also: https://prettier.io/docs/option-philosophy
Re:Node.js can now execute TypeScript files by ZYbCRq22HbJ2y7 on Sunday August 17, 2025 @11:10PM (#44937022)
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".

Re:Node.js can now execute TypeScript files by nake89 on Monday August 18, 2025 @02:42AM (#44938016)
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

Re:Node.js can now execute TypeScript files by ZYbCRq22HbJ2y7 on Monday August 18, 2025 @07:50PM (#44946657)
> 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.

Re:Node.js can now execute TypeScript files by nake89 on Tuesday August 19, 2025 @01:56AM (#44948646)
> 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.

Re:Node.js can now execute TypeScript files by moogly on Sunday August 17, 2025 @01:05PM (#44933081)
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.
Re:Node.js can now execute TypeScript files by MrJohz on Sunday August 17, 2025 @03:19PM (#44934114)
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.

Re:Node.js can now execute TypeScript files by latchkey on Sunday August 17, 2025 @02:49PM (#44933903)
Replacing something hard to setup with something buggy is a win?
Re:Node.js can now execute TypeScript files by moogly on Sunday August 17, 2025 @06:11PM (#44935369)
They've improved, and they will be fine pretty soon.