Rome is a toolchain for the web: formatter, linter and more for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS
npx @tessl/cli install tessl/npm-rome@11.0.0Rome is a comprehensive web development toolchain that unifies functionality traditionally provided by separate tools like Babel, ESLint, webpack, Prettier, and Jest. Written in Rust for performance, it provides formatting, linting, bundling capabilities for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS with strong conventions and minimal configuration.
npm install romeRome is primarily used as a CLI tool rather than a library. It provides executable commands through npm scripts or direct CLI usage:
# Via npx
npx rome format src/
# Via npm scripts (in package.json)
"scripts": {
"format": "rome format src/",
"lint": "rome check src/",
"ci": "rome ci src/"
}# Format files
rome format src/
# Check (lint) files with auto-fix
rome check src/ --apply
# Combined format check and linting for CI
rome ci src/
# Initialize Rome configuration
rome init
# Start daemon for faster subsequent runs
rome start
rome check src/ --use-server
rome stopRome is built around several key components:
rome.json with sensible defaultsCode formatting functionality that replaces Prettier, with support for JavaScript, TypeScript, JSON, and CSS files.
rome format [OPTIONS] <INPUTS...>
# Key options:
--write # Edit files in place
--skip-errors # Skip files with syntax errors
--json # Output results in JSON format
--stdin-file-path <string> # File name with extension for reading from stdin
--max-diagnostics <number> # Cap diagnostics displayed (default: 50)
--verbose # Print additional verbose advice
--indent-style <tabs|space> # Change indentation character (default: tabs)
--indent-size <number> # Spaces for indentation when using space style (default: 2)
--line-width <number> # Maximum characters per line (default: 80)
--quote-style <single|double> # Quotation character for strings (default: double)Static analysis and linting functionality that replaces ESLint, with extensive rules for code quality, accessibility, performance, and security.
rome check [OPTIONS] <INPUTS...>
# Key options:
--apply # Apply safe fixes
--apply-suggested # Apply safe and suggested fixes
--max-diagnostics <number> # Cap diagnostics displayed (default: 20)
--verbose # Print additional verbose adviceCombined formatting and linting checks optimized for CI/CD environments.
rome ci [OPTIONS] <INPUTS...>
# Key options:
--formatter-enabled # Enable/disable formatter check (default: true)
--linter-enabled # Enable/disable linter check (default: true)
--max-diagnostics <number> # Cap diagnostics displayed (default: 50)
--verbose # Print additional verbose adviceConfiguration system supporting project initialization and extensive customization options.
rome init # Bootstrap new rome project
# Configuration via rome.json:
{
"formatter": { "enabled": true, "indentStyle": "space" },
"linter": { "enabled": true, "rules": { "recommended": true } },
"files": { "ignore": ["dist/**", "node_modules/**"] }
}Optional server mode for improved performance across multiple operations.
rome start # Start Rome daemon server process
rome stop # Stop Rome daemon server process
rome lsp-proxy # Language Server Protocol over stdin/stdout
# Use daemon for commands:
rome check src/ --use-serverAdditional commands for version information and debugging support.
rome version # Show Rome version information
rome rage # Print debugging information
rome help [command] # Print help message for commandsUsage Examples:
# Show version
rome version
# Get debugging information for issue reports
rome rage
# Get help for specific command
rome help format# Available for all commands:
--colors <off|force> # Set markup formatting mode
--use-server # Connect to running daemon instance
--version # Show version information
--help # Show help information
--files-max-size <bytes> # Maximum file size in bytes (default: 1MB)
--show-metrics # Display performance metrics.js, .jsx, .mjs, .cjs.ts, .tsx, .mts, .cts, .d.ts.json, .jsonc.css (parsing support)Rome provides detailed diagnostics with: