CodeVetter · Repo Unpack · Data flow
biomejs/biome
Input is a filesystem path plus biome.json. The CLI or LSP opens a Workspace, scans projects, classifies each file by extension and embedded language, then parses to a Rowan CST. Settings (formatter, linter, assist, overrides, plugins) are merged from configuration and VCS ignore data. Analyzers and the formatter consume the CST and optional semantic or type information. Diagnostics and code actions return to the CLI printer, the LSP, or the JSON-RPC/WASM boundary. Fixes can be written back through the FileSystem trait.
- File classification starts in file_handlers: extension and language directives choose DocumentFileSource, then a language-specific parser builds the CST.
- biome_parser and biome_rowan own the green-tree representation shared by every language. Syntax nodes are cheap handles into an immutable tree; text is recovered from tokens.
- Configuration load path: locate biome.json or biome.jsonc, deserialize into biome_configuration types, merge extends and overrides, then push Settings into the workspace. VCS (Git) ignore rules further filter the file set.
- Lint execution goes through biome_analyze: a RuleRegistry matches query types against the syntax tree (and semantic events). Each rule emits RuleDiagnostic or a code action.
- The formatter lowers CST to a format IR (biome_formatter) and prints with options from configuration (indent, line width, quote style). Language crates implement FormatNode rules.
- Type-aware rules use Salsa-backed inference in biome_js_type_info and biome_module_graph rather than only syntactic matching. The workspace requests inferred types for a module.
- Stdin mode treats unnamed input as a virtual document. The CLI still routes it through the same parse, lint, and format pipeline and prints the result instead of writing a path.
- Fixes and assists mutate the CST via biome_rowan batches or text edits, then the workspace writes the new source through FileSystem. Unsafe fixes are gated by CLI flags and rule fix kind.