# oxc-project/oxc architecture

> Architecture diagram of the GitHub repository oxc-project/oxc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oxc-project/oxc
- Repository: https://github.com/oxc-project/oxc

## Overview

Oxc is a Rust toolkit for JavaScript and TypeScript, with standalone linting and formatting applications plus compiler components for building tooling. The principal developer workflow is to provide source code to a tool and receive lint diagnostics or formatted output; the README also documents parser, transformer, and minifier capabilities for downstream toolchains. The graph preserves these distinct product areas and includes the AST as an internal layer. Internal call relationships are limited because the excerpts do not show the main runtime wiring; dashed edges mark documented capabilities without verified internal calls.

Main entry points: [`apps/oxlint/src/main.rs`](https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/main.rs) (Oxlint CLI), [`apps/oxlint/src/run.rs`](https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/run.rs) (Lint runner), [`apps/oxfmt/src/main.rs`](https://github.com/oxc-project/oxc/blob/main/apps/oxfmt/src/main.rs) (Oxfmt CLI), [`apps/oxfmt/src/api/format_api.rs`](https://github.com/oxc-project/oxc/blob/main/apps/oxfmt/src/api/format_api.rs) (Format API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Developer tools"]
  node_oxlint["Oxlint CLI<br/>[main.rs]"]
  node_oxlint_run["Lint runner<br/>[run.rs]"]
  node_oxlint_config["Lint config<br/>[config_loader.rs]"]
  node_lint_output["Lint reporters<br/>[mod.rs]"]
  node_oxfmt["Oxfmt CLI<br/>[main.rs]"]
  node_format_api["Format API<br/>[format_api.rs]"]
end

subgraph group_compiler["Compiler components"]
  node_format_core["Formatter engine<br/>[lib.rs]"]
  node_parser["JavaScript parser<br/>[lib.rs]"]
  node_transformer["Transformer<br/>[lib.rs]"]
  node_minifier["Minifier<br/>[lib.rs]"]
  node_resolver["Module resolver"]
end

subgraph group_language["Editor integration"]
  node_lsp["Language server<br/>[worker_manager.rs]"]
end

subgraph group_shared["Shared foundations"]
  node_ast["Syntax AST<br/>[mod.rs]"]
  node_compat["Target compatibility<br/>[engine_targets.rs]"]
  node_diagnostics["Diagnostics<br/>[lib.rs]"]
end

node_developer(("Developer"))

node_developer -->|"runs lint"| node_oxlint
node_oxlint -.->|"runs"| node_oxlint_run
node_oxlint -.->|"loads config"| node_oxlint_config
node_oxlint_run -.->|"reports findings"| node_lint_output
node_developer -->|"formats code"| node_oxfmt
node_oxfmt -.->|"invokes"| node_format_api
node_format_api -.->|"formats source"| node_format_core
node_developer -->|"parses source"| node_parser
node_developer -->|"transforms source"| node_transformer
node_developer -->|"minifies source"| node_minifier
node_developer -->|"resolves modules"| node_resolver
node_developer -.->|"uses editor tooling"| node_lsp

click node_oxlint "https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/main.rs"
click node_oxlint_run "https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/run.rs"
click node_oxlint_config "https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/config_loader.rs"
click node_lint_output "https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/output_formatter/mod.rs"
click node_oxfmt "https://github.com/oxc-project/oxc/blob/main/apps/oxfmt/src/main.rs"
click node_format_api "https://github.com/oxc-project/oxc/blob/main/apps/oxfmt/src/api/format_api.rs"
click node_format_core "https://github.com/oxc-project/oxc/blob/main/crates/oxc_formatter/src/lib.rs"
click node_parser "https://github.com/oxc-project/oxc/blob/main/crates/oxc_parser/src/lib.rs"
click node_ast "https://github.com/oxc-project/oxc/blob/main/crates/oxc_ast/src/ast/mod.rs"
click node_transformer "https://github.com/oxc-project/oxc/blob/main/crates/oxc_transformer/src/lib.rs"
click node_minifier "https://github.com/oxc-project/oxc/blob/main/crates/oxc_minifier/src/lib.rs"
click node_compat "https://github.com/oxc-project/oxc/blob/main/crates/oxc_compat/src/engine_targets.rs"
click node_diagnostics "https://github.com/oxc-project/oxc/blob/main/crates/oxc_diagnostics/src/lib.rs"
click node_lsp "https://github.com/oxc-project/oxc/blob/main/crates/oxc_language_server/src/worker_manager.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_oxlint,node_oxlint_run,node_oxlint_config,node_lint_output,node_oxfmt,node_format_api toneBlue
class node_format_core,node_parser,node_transformer,node_minifier,node_resolver toneAmber
class node_lsp toneMint
class node_ast,node_compat,node_diagnostics toneRose
class node_developer toneIndigo
```

## Components

### Developer tools

- [Oxlint CLI](https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/main.rs): `apps/oxlint/src/main.rs`
- [Lint runner](https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/run.rs): `apps/oxlint/src/run.rs`
- [Lint config](https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/config_loader.rs): `apps/oxlint/src/config_loader.rs`
- [Lint reporters](https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/output_formatter/mod.rs): `apps/oxlint/src/output_formatter/mod.rs`
- [Oxfmt CLI](https://github.com/oxc-project/oxc/blob/main/apps/oxfmt/src/main.rs): `apps/oxfmt/src/main.rs`
- [Format API](https://github.com/oxc-project/oxc/blob/main/apps/oxfmt/src/api/format_api.rs): `apps/oxfmt/src/api/format_api.rs`

### Compiler components

- [Formatter engine](https://github.com/oxc-project/oxc/blob/main/crates/oxc_formatter/src/lib.rs): `crates/oxc_formatter/src/lib.rs`
- [JavaScript parser](https://github.com/oxc-project/oxc/blob/main/crates/oxc_parser/src/lib.rs): `crates/oxc_parser/src/lib.rs`
- [Transformer](https://github.com/oxc-project/oxc/blob/main/crates/oxc_transformer/src/lib.rs): `crates/oxc_transformer/src/lib.rs`
- [Minifier](https://github.com/oxc-project/oxc/blob/main/crates/oxc_minifier/src/lib.rs): `crates/oxc_minifier/src/lib.rs`
- **Module resolver**

### Editor integration

- [Language server](https://github.com/oxc-project/oxc/blob/main/crates/oxc_language_server/src/worker_manager.rs): `crates/oxc_language_server/src/worker_manager.rs`

### Shared foundations

- [Syntax AST](https://github.com/oxc-project/oxc/blob/main/crates/oxc_ast/src/ast/mod.rs): `crates/oxc_ast/src/ast/mod.rs`
- [Target compatibility](https://github.com/oxc-project/oxc/blob/main/crates/oxc_compat/src/engine_targets.rs): `crates/oxc_compat/src/engine_targets.rs`
- [Diagnostics](https://github.com/oxc-project/oxc/blob/main/crates/oxc_diagnostics/src/lib.rs): `crates/oxc_diagnostics/src/lib.rs`

### Other components

- **Developer**

## Connections

- Developer → Oxlint CLI: runs lint (evidence: `README.md`)
- Oxlint CLI → Lint runner: runs
- Oxlint CLI → Lint config: loads config
- Lint runner → Lint reporters: reports findings
- Developer → Oxfmt CLI: formats code (evidence: `README.md`)
- Oxfmt CLI → Format API: invokes
- Format API → Formatter engine: formats source
- Developer → JavaScript parser: parses source (evidence: `README.md`)
- Developer → Transformer: transforms source (evidence: `README.md`)
- Developer → Minifier: minifies source (evidence: `README.md`)
- Developer → Module resolver: resolves modules (evidence: `README.md`)
- Developer → Language server: uses editor tooling
