Rome
Tags: javascript, typescript, webdev
Published: 2023-02-14 20:12:56

Today we are going to talk about Rome. According to their [github page](https://github.com/rome/tools)

> 1. Rome is a formatter, linter, bundler, and more for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS.
> 2. Rome is designed to replace Babel, ESLint, webpack, Prettier, Jest, and others.
> 3. Rome unifies functionality that has previously been separate tools. Building upon a shared base allows us to provide a cohesive experience for processing code, displaying errors, parallelizing work, caching, and configuration.
> 4. Rome has strong conventions and aims to have minimal configuration. Read more about our project philosophy.
> 5. Rome is written in Rust.
> 6. Rome has first-class IDE support, with a sophisticated parser that represents the source text in full fidelity and top-notch error recovery.
> 7. Rome is MIT licensed and moderated under the Contributor Covenant Code of Conduct.

That is what it wants to be, but for now it is a formatter and linter, but it still intrigues me.
It was founded by the creator of Babel and Yarn and in the future it promises to be a:

1. Compiler - March 2023
2. Bundler - March 2023
3. Testing - June 2023

> Rome unifies your development stack by combining the functionality of separate tools.
> Single configuration file, amazing performance, and works with any stack.

For now it works with Javascript and Typescript, it will work with:

1. Json - Dec 2022
2. HTML - June 2023
3. Markdown - Nov 2023
4. CSS - Nov 2023

So for now I want to see how easy it is to start working with it and compare it in a month when they will launch the compiler and bundler functionalities.

First we have to have a folder with a `package.json`, so I will start a react project like always.

`npx create-react-app my-rome-app`

So I have this in my folder

![npx create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/185esznrnd47oym4c3su.png)

Now we are going to get Rome `npm install --save-dev rome`

And I already have 6 high vulnerabilities, I don't like that very much.

![install rome](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1x8h7wzxy0d61ud76m3b.png)

But, now we should be able to run Rome `npx rome`

![npx rome](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zruzgiw6ugv02255e2n1.png)

They do recommend to create a `rome.json` configuration file for each project `npx rome init`

![rome init](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6jamjp3241o8mbvokvln.png)

And this is my new file

![rome json](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2e6v14izvnmlnhejy4rv.png)

Let's check a file `npx rome check ./src/App.js`

![check app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6enzrpoebsoqtx6ies9.png)

Well, I was expecting more...

Let's try something else, they do recommend installing our editor integration to get the most out of Rome. So I'm going to install the [extension for VSCode](https://marketplace.visualstudio.com/items?itemName=rome.rome) 

![Rome extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8utdgm7w1mm9v3xh7svz.png)

And now I have the option to format with Rome

![format with rome](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zm65frsb4ssst2kag99d.png)

Well that did changed the quotes in my file

![changed App js](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gcrofp61ocb7idhf96ks.png)

> Rome’s an opinionated formatter that has the goal to stop all ongoing debates over styles. It follows a similar philosophy to Prettier, only supporting few options to avoid that debates over styles turn into debates over Rome options. It deliberately resists the urge to add new options to prevent bike-shed discussions in teams so they can focus on what really matters instead.

And here you can learn more about the [formatter](https://docs.rome.tools/formatter/). I used the command `npx rome format --help` and this is what I got.

![format options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sz8gccxy3u2l900n1cog.png)

And for the lint options `npx rome check --help`

![check options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qi7z16lnzt23zsnkjg6f.png)

> Recommended rules are enabled by default and emit diagnostics with the error severity. Rules that are not recommended are disabled by default, but they can be enabled via configuration. The diagnostics emitted by these rules are displayed with the warning severity in the documentation.

Well, for now in my opinion Rome is cute, but I'm going to be waiting when they do add more functionalities.

Cheers!