or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

ci-integration.mdconfiguration.mddaemon-mode.mdformatting.mdindex.mdlinting.md
tile.json

tessl/npm-rome

Rome is a toolchain for the web: formatter, linter and more for JavaScript, TypeScript, JSON, HTML, Markdown, and CSS

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/rome@11.0.x

To install, run

npx @tessl/cli install tessl/npm-rome@11.0.0

index.mddocs/

Rome

Rome 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.

Package Information

  • Package Name: rome
  • Package Type: npm
  • Language: Rust (distributed via npm)
  • Installation: npm install rome
  • Documentation: https://docs.rome.tools/
  • Repository: https://github.com/rome/tools

Core Imports

Rome 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/"
}

Basic Usage

# 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 stop

Architecture

Rome is built around several key components:

  • CLI Interface: Primary interaction through command-line commands
  • Language Support: Parsers and formatters for JavaScript, TypeScript, JSON, and CSS
  • Configuration System: Flexible configuration via rome.json with sensible defaults
  • Daemon Mode: Optional server mode for improved performance across multiple operations
  • Language Server: LSP implementation for editor integration

Capabilities

Formatting

Code 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)

Formatting

Linting and Code Analysis

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 advice

Linting

Continuous Integration

Combined 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 advice

CI Integration

Configuration Management

Configuration 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/**"] }
}

Configuration

Daemon Mode

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-server

Daemon Mode

Utility Commands

Additional 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 commands

Usage Examples:

# Show version
rome version

# Get debugging information for issue reports
rome rage

# Get help for specific command
rome help format

Global Options

# 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

Supported File Types

  • JavaScript: .js, .jsx, .mjs, .cjs
  • TypeScript: .ts, .tsx, .mts, .cts, .d.ts
  • JSON: .json, .jsonc
  • CSS: .css (parsing support)

Error Handling

Rome provides detailed diagnostics with:

  • Precise error locations: Line and column information
  • Contextual messages: Clear explanations of issues
  • Fix suggestions: Automatic fixes for many problems
  • Multiple output formats: Human-readable and JSON formats
  • Graceful degradation: Continues processing despite individual file errors