How biomejs/biome works
Biome is a web-language toolchain for formatting, linting, and editor-integrated code health. The main workflow starts with a CLI or editor client, processes project configuration and file discovery, parses source, then formats or analyzes it and returns diagnostics, fixes, or formatted text. The graph also preserves the documented editor/LSP, project scanning, and Grit search capabilities. Internal links are limited to relationships shown in the README or SOURCE INDEX; unsampled implementation details are not inferred.
Main entry points: server.rs Workspace Server · mod.rs CLI Commands · scanner.rs File Scanner · file_handlers Language Dispatch
Components 22
Client Entry Points
- CLI Commands
crates/biome_cli/src/commands/mod.rs - Language Server
crates/biome_lsp/src/server.rs
Workspace Services
- Workspace API
crates/biome_service/src/workspace.rs - Workspace Server
crates/biome_service/src/workspace/server.rs - Project Configuration
crates/biome_service/src/configuration.rs - Effective Settings
crates/biome_service/src/settings.rs - Project Management
crates/biome_service/src/projects.rs - File Scanner
crates/biome_service/src/scanner.rs - Workspace State
crates/biome_service/src/db/mod.rs
Language Processing
- Language Dispatch
crates/biome_service/src/file_handlers - JavaScript Parser
crates/biome_js_parser/src/syntax/program.rs - Expression Parser
crates/biome_js_parser/src/syntax/expr.rs - Statement Parser
crates/biome_js_parser/src/syntax/stmt.rs - CSS Parser
crates/biome_css_parser/src/parser.rs - Language Formatters
crates/biome_css_formatter/src/prelude.rs
Analysis and Results
- Analyzer Engine
crates/biome_analyze/src/registry.rs - JavaScript Rules
crates/biome_js_analyze/src/react/components.rs - Diagnostics
crates/biome_service/src/diagnostics.rs
Search and Migration
- Grit Queries
crates/biome_grit_patterns/src/grit_query.rs - Tool Migrations
crates/biome_cli/src/execute/migrate.rs
Other components
- Developer
- Editor Client
Connections 23
- Developer → CLI Commands: runs commands
README.md - Editor Client → Language Server: sends requests
README.md - CLI Commands → Workspace API: requests processing
- Language Server → Workspace API: uses workspace
crates/biome_lsp/src/server.rs - Workspace API → Workspace Server: delegates requests
crates/biome_service/src/workspace.rs - Workspace Server → Project Configuration: loads configuration
crates/biome_service/src/workspace/server.rs - Workspace Server → Workspace State: reads and updates
crates/biome_service/src/workspace/server.rs - Workspace Server → Effective Settings: selects settings
crates/biome_service/src/workspace/server.rs - Workspace Server → Project Management: selects project
crates/biome_service/src/workspace/server.rs - Workspace Server → File Scanner: invokes scans
crates/biome_service/src/workspace/server.rs - File Scanner → Workspace State: publishes index
crates/biome_service/src/scanner.rs - File Scanner → Project Management: reads project data
crates/biome_service/src/scanner.rs - Workspace Server → Language Dispatch: dispatches files
crates/biome_service/src/workspace/server.rs - Language Dispatch → JavaScript Parser: parses JavaScript
- Language Dispatch → CSS Parser: parses CSS
- JavaScript Parser → Expression Parser: parses expressions
crates/biome_js_parser/src/syntax/program.rs - JavaScript Parser → Statement Parser: parses statements
crates/biome_js_parser/src/syntax/program.rs - Workspace Server → Language Formatters: formats documents
- Workspace Server → Analyzer Engine: runs analysis
- Analyzer Engine → JavaScript Rules: dispatches rules
- Workspace Server → Diagnostics: produces diagnostics
crates/biome_service/src/workspace/server.rs - CLI Commands → Grit Queries: offers search
- CLI Commands → Tool Migrations: runs migrations