mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
0389c4010e
### 🚀 Features -83cb516minifier: Improve negation of expressions in boolean context (#25755) (Armano) ### 🐛 Bug Fixes -134fb22isolated-declarations: Preserve unresolved parameter types (#25909) (Dunqing) -526c2b3codegen: Remove deprecated test APIs (#25889) (camc314) -344a9b2codegen: Align enum template sourcemaps (#25872) (camc314) ### ⚡ Performance -5ef0c93minifier: Unwrap all unary exprs without creating dummy expressions (#25891) (Armano) -8783524packages/codegen: Remove loop from `growMappingBuffer` (#25886) (overlookmotel) -b6b14c0packages/codegen: Remove redundant branch (#25885) (overlookmotel) -be6adf0packages/sourcemap: Make `location` passed to `recordSourceMapping` always a number (#25884) (overlookmotel) -f720f15packages/codegen: Take named-mapping only code off hot path in `recordSourceMapping` (#25883) (overlookmotel) -a734af5packages/codegen: Remove redundant setting of `last` in `printImportAttributes` and `printIf` (#25882) (overlookmotel) -c6e44c6packages/codegen: Combine 2 writes in `printJSXElement` (#25881) (overlookmotel) -8801662packages/codegen: Remove redundant mapping from `printParams` (#25880) (overlookmotel) ### 📚 Documentation -5ad330epackages/codegen: Reformat comments (#25876) (overlookmotel)
Oxc Diagnostics
Error reporting and diagnostic utilities for JavaScript and TypeScript tooling.
Overview
This crate provides comprehensive error handling and diagnostic reporting capabilities for JavaScript and TypeScript tooling.
Key Features
- Rich diagnostics: Detailed error messages with source context
- Source highlighting: Syntax-highlighted error locations
- Multiple error support: Collect and report multiple errors at once
- Built-in renderers: Graphical terminal and machine-readable JSON output
- Severity levels: Support for errors, warnings, and informational messages
Architecture
Diagnostic Components
- Message: Primary error/warning description
- Labels: Highlight specific source locations
- Help text: Suggestions for fixing the issue
- Source context: Display relevant source code sections
Error Flow
- Creation: Tools create
OxcDiagnosticinstances for problems - Collection:
DiagnosticServiceaggregates diagnostics - Formatting: Rich terminal output with colors and context
- Reporting: Display to users in IDE, CLI, or other interfaces
The diagnostic system ensures consistent, high-quality error reporting across all oxc tools.