CodeVetter · Repo Unpack · Extension points
oxc-project/oxc
Extensions attach to explicit Rust traits, generated registries, callback interfaces, and dispatch tables. Native lint rules and JavaScript lint plugins enter through different mechanisms. Formatter integration owns language routing and host services, while language crates implement formatting. Compiler hooks and filesystem abstractions provide composition points without requiring changes to application startup.
- Native lint rules implement Rule hooks for configuration, AST nodes, whole-file analysis, Jest/Vitest nodes, and per-file should_run selection.
- Rule metadata is declared with declare_oxc_lint, as demonstrated by NoDebugger; the generated rule enum identifies cargo lintgen as its regeneration command.
- External lint plugins supply workspace create/destroy, plugin loading, rule configuration, and per-file lint callbacks carrying rule IDs, options IDs, settings, globals, and allocator access.
- RuntimeFileSystem is an injection boundary for reading and writing linted files; LintService accepts it for filesystem linting, source linting, and parse-diagnostic collection.
- Whole-file formatter support plugs into classify_file_kind and FormatStrategy::from_format_config; classification returns None for excluded or unsupported targets and gates Prettier strategies on napi.
- Embedded language support plugs into route and dispatcher assembly; aliases resolve centrally, with typed Native, Prettier, and Unsupported outcomes.
- Language-server tools implement ToolBuilder::build and Tool methods for configuration, watchers, commands, code actions, formatting, and diagnostic lifecycle behavior.
- CompilerInterface exposes stage options and after_parse/after_semantic/after_transform hooks with early termination; formatter test consumers separately implement FixtureFormatter with language-owned options and fingerprints.