Rome v12.1: a linter formatter for TypeScript, JSX and JSON
rome.tools
rome.tools
But even dprint doesn't do a couple of the things I want, #1 of which is "For the love of science, please stop deleting the intentionally placed blank line after a hugely long class declaration!" E.g.:
@Directive()
export abstract class AutocompleteComponentBase<T> implements ControlValueAccessor, AfterContentInit, OnDestroy {
@ViewChild(DsAutocompleteContainerDirective, { static: true }) autocomplete: DsAutocompleteContainerDirective<T>;
// class definition continues...
I mean, I know I am a bad person because of those long names, but that is how life goes sometimes! And the blank line there at the top is just very important to like, catch one's breath, while reading this code.(I'm really just posting this in the hopes that somebody will throw me a "Bro, just use hpstrlnt, it totally lets you configure that!" -- I have not actually tried Rome to see if it does (it's Monday morning and I'm not quite ready to be disappointed again...))
[1]: dprint is good, and I recommend it as the best code formatter I currently know of: https://dprint.dev/
I think Bun has a better shot than Deno because it has a very fast built in node_modules installer. But I think Bun's goals are too ambitious - trying to be all things to all projects from a single binary. No one cares if you have to use a separate binary, esbuild, for all your bundling needs, for example.
It's amusing how the entire JS ecosystem put up with such slow build times for a decade. If these JS tools teach us anything it's that JavaScript doesn't cut it for performance and a compiled language is the way to go.
If it is IO that is causing slow project builds, then the IO in theory would be slow with compiled tools as well.
At first glance, I thought you were saying "this Rome thing might have been relevant 5 years ago, but now Bun and Deno exist, so it is not." But, that didn't really make sense because Bun and Deno are both new and growing and there's no clear winner, or even leader, in the "post-NodeJS runtimey programming thingamajig and excution environment".
Re-reading your comment, though, it seems like what you are really saying is "JavaScript itself is slow, so it is no longer relevant".
But when stated so plainly that sentiment becomes absurd, so as a reader I sort of mentally revise my interpretation of it to "JavaScript is slow (yes), so I personally wish people would just switch to faster languages".
But that doesn't really make sense in this context, either, because this tool is written in Rust.
So... what are you saying? What thot r u the thinkr of here?
I wasted so much time with configuration of eslint / prettier and a ton of plugins, that es why i had enough and switch to someting simpler... rome.
But if you want to configure every single bit of your source code, stay with eslint, prettier, ...
It re-implements a bunch of popular linting rulesets & plugins in Rust and is incredibly fast, especially compared to the other tools.
Done.
Now demonstrate the equivalent using prettier, eslint, and typescript. It’s a configuration nightmare …
Feels like they could stand to merge, like eslint+tslint.
It’s worth a try, but wouldn’t necessarily recommend ‘switching’ wholesale at the moment.
And after a while it is ok. You realize, that you spend before much time to modify everyhting, that is not really necesary.
I do miss C#'s use of macros to allow defining arbitrary blocks that can be named and folded though.
https://www.jetbrains.com/help/webstorm/working-with-source-...
The LSP (VSCode extension) is less stable at the moment.
Would it have been impossible to nudge Node.js in the direction of where Deno is today?
Would it have been impossible to replace Babel with a Go implementation?
I also don't want tools that want to be literally everything.
Imagine if Daniel Stenberg was like, "You know what I'm tired of cURL, let me rebuild literally the same thing in another language and give it a new name, and entirely different opts."
JS linters running in Node are mostly CPU-bound. You can get an order-of-magnitude improvement from writing those tools in Rust.
Would you get divorced from your spouse if something minor wasn't working out, too?
It's not the 1st time NodeJs required "forking". And so what if we do nudge Node yet again? It will just keep repeating itself unless there are bigger changes.
> Would it have been impossible to replace Babel with a Go implementation?
More like the world has changed since IE left the chat. We need less / different set of polyfills.
Both Node.js and Deno have strong reasons to exist. Node has a massive installed base that values slightly more stability at this point. Deno benefits from being able to boldly explore big changes.
But, I only see this happening in the JavaScript space.
There seems to be something intrinsically wrong with JavaScript and NodeJS that a lot of the tools used to manipulate the language is written in other languages.
JS has nothing like that, and it has been cool to see more experiments around this type of approach. Many disparate tools and versions are hard to manage because there are so many permutations of options!
I don’t think anything necessarily prevents Node from being nudged in that direction — and I think we’re seeing the first signs of that with Node 20 — but the implication in nudging is that it takes a comparatively much longer amount of time. Deno has its own set of challenges as a result of it being an independent project with its own sets of breaking differences, but I think the goal with Deno was try to push the JavaScript server ecosystem forward rather than to slowly nudge it forward (with the sizable resistance that entails).
cURL is more singular here in comparison; there’s no rapidly-changing ecosystem that dictates the pace at which it changes or improves, but that’s not the case for the JavaScript ecosystem (see: Node’s many problems in keeping pace with the adoption of modules over the last several years).
The other problem with existing and working projects is, that they have maintainer and a community and you can't change things radically. That is a really long process.
And sometimes competetive projects improve each other.
I have sometimes the same feeling. I often dream of a "united community" working on a "perfect tool".
But there are so many differences in the community. In reality – as in most human systems – people create their own "dream tools". And the success of new tools influences earlier tools trying to catch up.
Because Deno has some traction, this forces Nodejs to catch up. I think Bunjs has accelerated some changes in Deno's Nodejs compatibility.
In the process, a lot of efforts seem lost. However, this is the way humans and communities are working: people learn by imitating others, changes are often pushed by new tools and systems that have more freedom to evolve.
Kind of a pessimistic view, but I do think this is what happens.
You call them thought leaders, Jamie Zawinsky used to call them attention-deficit teenagers, in his CADT model theory of open-source.
www.jwz.org/doc/cadt.html
Yes, do you not remember the whole nodejs vs. IOjs split? The community is already pulling node in tons of different directions.
> Would it have been impossible to replace Babel with a Go implementation?
Again, yes it would be impossible by dint of the fact babel is made to be a framework where you process JS ASTs using JavaScript. Rewriting it in Go removes the whole ecosystem of JS plugins it built, which is kind of the entire point of the project. A Go rewrite of certain transforms is a new project.
There’s a ton of value of everyone using the same tool even if it isn’t perfect for every specific use case. Now install readme files regularly explain both yarn and npm installs and the community needs to be aware of the existence of two basically identical tools.
https://github.com/orogene/orogene/blob/main/BENCHMARKS.md
As you can see, both bun and orogene beat the js implementations by miles.
* Single file scripting with dependencies
* No node_modules folder
* Typescript built in. You might dismiss it as easy, but it's only easy in the sense that it's not a lot of work if you've done it. It's still a massive faff and paper cut. Whatever the next thing up from a paper cut is. Toe stub?
* Guaranteed type hints.
* A good standard library
All the others are subjective (and wrong :))
fracturedJSON gets close but not exactly what I want.
[0] https://github.com/rome/tools/discussions/4302 [1] https://twitter.com/sebmck
Curious to learn more though.
It is Ireland, undisclosed (the founder, so probably SF), France, and UK.
What do you think of pnpm?
I saw it off and on since 2015 and read some projects switched to it and then back again, when it didn't work out.
Use it in some projects, but for the most simplier projects i stay with simple npm and use scripts (via scripty).
Install / update perfomance or SSD space saving are for me not really killer features.
pnpm offers fast installs and the best dependency management capabilities I have seen.
However, there is a steep learning-curve attached to the latter. You cannot just task a random developer with fixing emerging problems or else you will be left with half-a-dozen large and unintelligible config files and hacks.
If you are the type of team that never updates dependencies, it is not worth the effort. If you are the type of team that applies the heuristic of "yes" to the question "Should I download a dependency?", it is not worth the effort.
On the other hand, if you value build tool performance, if you are updating frequently and if your dependencies are carefully curated, pnpm is great and with Node >16 it is just a...
$ corepack enable
...away, too.If you can do that and live with that, rome is a excellent tool. It took me some weeks to accept the "rome way" and now i am more than happy with that and did not waste time with endless configurations of eslint/prettier.
A migration path is required, otherwise you'll introduce a tool, have a PR that reformats everything and it will be a huge mess.
However, Rome is also trying to provide a smooth experience. And we are open to relax some rules if it makes sense. If you have some time, we would like to get to know the rough edges of Rome.
I'll give it an honest shot tomorrow and update you on the pain points.
https://docs.github.com/en/repositories/working-with-files/u...
Otherwise, most of the rules are not fine-tunable in the way that ESLint is. Rome tries to provide the experience that Prettier provided in the formatting landscape: good defaults for a near-zero configuration experience. It tries to adopt the conventions of the JS/TS community. Still, some configuration is provided when the community is divided on some opinions (e.g. space vs. tab indentation, semicolons or as-needed semicolons, ...).
There is an open issue [1] for listing equivalent rules between ESLint and Rome. Expect more documentation in the future, and maybe a migration tool.
If I had been one of the founders of Rome, I could have pushed for more compatibility with ESLint. In particular, using the same naming conventions and thus the same names for most rules, and recognising ESLint ignore comments.
0.10.0
0.11.0
12.0.0
Or are we just starting at whatever versions we want now? My next library is gonna start at 666.0.0 once it gets stable in that case.
I’d be more likely to think something was wrong with those releases, and assume someone was forced to delist versions 0.16.0 thru 1.5.0.
As long as you only increase ever number, and not go down, you're good.
I don't know much about compilers/formatters/linkers and how they work though, so I could easily be wrong.
Not really.