DEV Community

Paula Marín S
Paula Marín S

Posted on

Rome

Today we are going to talk about Rome. According to their github page

  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

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

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

npx rome

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

rome init

And this is my new file

rome json

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

check app

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

Rome extension

And now I have the option to format with Rome

format with rome

Well that did changed the quotes in my file

changed App js

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. I used the command npx rome format --help and this is what I got.

format options

And for the lint options npx rome check --help

check options

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!

Top comments (0)