CodeVetter · Repo Unpack · Behavior traces
oxc-project/oxc
The following traces were reconstructed by reading callers and callees, without execution. They follow parser API use, lint startup and fixes, suppression persistence, formatter startup and writes, and minification. Branch conditions matter: parser recovery differs from lint rejection, configuration can fail during streaming, and type-check-only alters the lint pipeline.
- Parser flow: parse_sync → parse_with_return → get_source_type/get_ast_type → parse_impl → Parser::new.with_options.parse; showSemanticErrors then conditionally invokes SemanticBuilder before UTF-16 conversion and ESTree serialization.
- Lint startup: main → lint_command().run → init_tracing → handle_threads → CliRunner::new.run; --lsp instead constructs Tokio and awaits run_lsp.
- Lint orchestration: CliRunner::run → Walk::paths → ConfigLoader::load_root_and_nested → ConfigStoreBuilder::build → LintRunner::builder.build → lint_files; regular LintService runs before optional tsgolint, while type-check-only collects parse diagnostics instead of regular rules.
- Per-file lint/fix flow: Runtime::run_impl resolves modules → process_path_to_module reads source → process_source splits sections → process_source_section parses and builds semantics → run_with_disable_directives → optional Fixer::fix → write_file for modified source.
- Suppression persistence: CliRunner loads SuppressionManager → build_diff → lint_files accumulates counts → finalize computes suppression/pruning updates → write → SuppressionTracking::save serializes and writes JSON; type-check-only skips finalization.
- Node formatter startup: cli.ts gathers argv and supplies callbacks → run_cli parses modes → initialization/migration returns to JavaScript; CLI mode initializes Rayon, constructs WalkRunner with external services and a config loader, then calls run.
- Formatter write flow: WalkRunner::run loads ConfigScopes → starts FormatService::run_streaming → ScopedWalker::run sends targets → SourceFormatter::format dispatches a strategy → format_with_session.print for JS → fs::write only when Write mode and is_changed are both true.
- Minification flow: minify_sync → minify_impl validates options → Parser::parse → disables property mangling if parsing reported diagnostics → Minifier::minify → Codegen with returned scoping/private mappings → result containing code, map, comments, errors, and eligible cache.