mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor: move all miette usages to oxc_diagnostics
This commit is contained in:
parent
f039ad6007
commit
87b9978859
11 changed files with 18 additions and 22 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
|
@ -1500,7 +1500,6 @@ dependencies = [
|
||||||
"globset",
|
"globset",
|
||||||
"ignore",
|
"ignore",
|
||||||
"log",
|
"log",
|
||||||
"miette",
|
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
"oxc_diagnostics",
|
"oxc_diagnostics",
|
||||||
"oxc_linter",
|
"oxc_linter",
|
||||||
|
|
@ -1526,7 +1525,6 @@ dependencies = [
|
||||||
"language-tags",
|
"language-tags",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"memchr",
|
"memchr",
|
||||||
"miette",
|
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|
@ -1606,12 +1604,12 @@ name = "oxc_napi_parser"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"flexbuffers",
|
"flexbuffers",
|
||||||
"miette",
|
|
||||||
"napi",
|
"napi",
|
||||||
"napi-build",
|
"napi-build",
|
||||||
"napi-derive",
|
"napi-derive",
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
"oxc_ast",
|
"oxc_ast",
|
||||||
|
"oxc_diagnostics",
|
||||||
"oxc_parser",
|
"oxc_parser",
|
||||||
"oxc_span",
|
"oxc_span",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
@ -1692,7 +1690,6 @@ dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"insta",
|
"insta",
|
||||||
"itertools 0.12.0",
|
"itertools 0.12.0",
|
||||||
"miette",
|
|
||||||
"oxc_allocator",
|
"oxc_allocator",
|
||||||
"oxc_ast",
|
"oxc_ast",
|
||||||
"oxc_diagnostics",
|
"oxc_diagnostics",
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ doctest = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
miette = { workspace = true }
|
miette = { workspace = true, features = ["fancy-no-backtrace"] }
|
||||||
|
|
||||||
unicode-width = "0.1.11"
|
unicode-width = "0.1.11"
|
||||||
owo-colors = { version = "3.5.0" }
|
owo-colors = { version = "3.5.0" }
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ oxc_span = { workspace = true }
|
||||||
dashmap = { workspace = true }
|
dashmap = { workspace = true }
|
||||||
futures = { workspace = true }
|
futures = { workspace = true }
|
||||||
ignore = { workspace = true, features = ["simd-accel"] }
|
ignore = { workspace = true, features = ["simd-accel"] }
|
||||||
miette = { workspace = true, features = ["fancy-no-backtrace"] }
|
|
||||||
ropey = { workspace = true }
|
ropey = { workspace = true }
|
||||||
tokio = { workspace = true, features = ["full"] }
|
tokio = { workspace = true, features = ["full"] }
|
||||||
tower-lsp = { workspace = true, features = ["proposed"] }
|
tower-lsp = { workspace = true, features = ["proposed"] }
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ memchr = "2.7.1"
|
||||||
json-strip-comments = "1.0.1"
|
json-strip-comments = "1.0.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
miette = { workspace = true }
|
|
||||||
insta = { workspace = true }
|
insta = { workspace = true }
|
||||||
|
|
||||||
[package.metadata.cargo-machete]
|
[package.metadata.cargo-machete]
|
||||||
|
|
|
||||||
|
|
@ -116,8 +116,11 @@ impl<'a> Fixer<'a> {
|
||||||
mod test {
|
mod test {
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
use miette::{self, Diagnostic};
|
use oxc_diagnostics::{
|
||||||
use oxc_diagnostics::{thiserror::Error, Error};
|
miette::{self, Diagnostic},
|
||||||
|
thiserror::Error,
|
||||||
|
Error,
|
||||||
|
};
|
||||||
use oxc_span::Span;
|
use oxc_span::Span;
|
||||||
|
|
||||||
use super::{Fix, FixResult, Fixer, Message};
|
use super::{Fix, FixResult, Fixer, Message};
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ bitflags = { workspace = true }
|
||||||
indexmap = { workspace = true }
|
indexmap = { workspace = true }
|
||||||
insta = { workspace = true }
|
insta = { workspace = true }
|
||||||
itertools = { workspace = true }
|
itertools = { workspace = true }
|
||||||
miette = { workspace = true, features = ["fancy-no-backtrace"] }
|
|
||||||
phf = { workspace = true, features = ["macros"] }
|
phf = { workspace = true, features = ["macros"] }
|
||||||
pretty_assertions = "1.4.0"
|
pretty_assertions = "1.4.0"
|
||||||
rustc-hash = { workspace = true }
|
rustc-hash = { workspace = true }
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ use std::{path::PathBuf, sync::Arc};
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use oxc_allocator::Allocator;
|
use oxc_allocator::Allocator;
|
||||||
use oxc_diagnostics::{miette::NamedSource, Error};
|
use oxc_diagnostics::{miette::NamedSource, Error};
|
||||||
extern crate miette;
|
|
||||||
use oxc_semantic::{print_basic_block, Semantic, SemanticBuilder};
|
use oxc_semantic::{print_basic_block, Semantic, SemanticBuilder};
|
||||||
use oxc_span::SourceType;
|
use oxc_span::SourceType;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use oxc_diagnostics::{miette::miette, Error};
|
use oxc_diagnostics::{miette::miette, Error};
|
||||||
extern crate miette;
|
|
||||||
use oxc_semantic::{Reference, ScopeFlags, Semantic, SymbolFlags, SymbolId};
|
use oxc_semantic::{Reference, ScopeFlags, Semantic, SymbolFlags, SymbolId};
|
||||||
use oxc_span::Atom;
|
use oxc_span::Atom;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ oxc_allocator = { workspace = true }
|
||||||
oxc_parser = { workspace = true }
|
oxc_parser = { workspace = true }
|
||||||
oxc_ast = { workspace = true, features = ["serde"] }
|
oxc_ast = { workspace = true, features = ["serde"] }
|
||||||
oxc_span = { workspace = true }
|
oxc_span = { workspace = true }
|
||||||
|
oxc_diagnostics = { workspace = true }
|
||||||
|
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
serde_json = { workspace = true }
|
serde_json = { workspace = true }
|
||||||
flexbuffers = { version = "2.0.0" }
|
flexbuffers = { version = "2.0.0" }
|
||||||
miette = { workspace = true, features = ["fancy-no-backtrace"] }
|
|
||||||
|
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
napi = { version = "2", features = ["serde-json", "async"] }
|
napi = { version = "2", features = ["serde-json", "async"] }
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,15 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use flexbuffers::FlexbufferSerializer;
|
use flexbuffers::FlexbufferSerializer;
|
||||||
use miette::NamedSource;
|
|
||||||
use napi::bindgen_prelude::Buffer;
|
use napi::bindgen_prelude::Buffer;
|
||||||
use napi_derive::napi;
|
use napi_derive::napi;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
use oxc_allocator::Allocator;
|
use oxc_allocator::Allocator;
|
||||||
pub use oxc_ast::ast::Program;
|
pub use oxc_ast::ast::Program;
|
||||||
|
use oxc_diagnostics::miette::NamedSource;
|
||||||
use oxc_parser::{Parser, ParserReturn};
|
use oxc_parser::{Parser, ParserReturn};
|
||||||
use oxc_span::SourceType;
|
use oxc_span::SourceType;
|
||||||
use serde::Serialize;
|
|
||||||
|
|
||||||
/// Babel Parser Options
|
/// Babel Parser Options
|
||||||
///
|
///
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue