mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
00e1b762e0
We no longer need to maintain the `oxc-miette` repo as most of the code is now removed, the remaining code is minimal and can be vendored.
1.2 KiB
1.2 KiB
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.