mirror of
https://github.com/danbulant/oxc
synced 2026-05-20 04:38:54 +00:00
chore: Rust v1.77.0 (#2781)
This commit is contained in:
parent
2c0a7d6c23
commit
ef1108a749
16 changed files with 90 additions and 99 deletions
108
Cargo.toml
108
Cargo.toml
|
|
@ -80,64 +80,64 @@ oxc_syntax = { version = "0.10.0", path = "crates/oxc_syntax" }
|
|||
oxc_transformer = { version = "0.10.0", path = "crates/oxc_transformer" }
|
||||
|
||||
# publish = false
|
||||
oxc_macros = { path = "crates/oxc_macros" }
|
||||
oxc_linter = { path = "crates/oxc_linter" }
|
||||
oxc_prettier = { path = "crates/oxc_prettier" }
|
||||
oxc_tasks_common = { path = "tasks/common" }
|
||||
oxc_macros = { path = "crates/oxc_macros" }
|
||||
oxc_linter = { path = "crates/oxc_linter" }
|
||||
oxc_prettier = { path = "crates/oxc_prettier" }
|
||||
oxc_tasks_common = { path = "tasks/common" }
|
||||
|
||||
napi = { version = "2" }
|
||||
napi-derive = { version = "2" }
|
||||
|
||||
assert-unchecked = { version = "0.1.2" }
|
||||
bpaf = { version = "0.9.9" }
|
||||
bitflags = { version = "2.4.2" }
|
||||
bumpalo = { version = "3.15.4" }
|
||||
convert_case = { version = "0.6.0" }
|
||||
dashmap = { version = "5.5.3" }
|
||||
flate2 = { version = "1.0.28" }
|
||||
futures = { version = "0.3.30" }
|
||||
glob = { version = "0.3.1" }
|
||||
ignore = { version = "0.4.22" }
|
||||
itertools = { version = "0.12.1" }
|
||||
jemallocator = { version = "0.5.4" }
|
||||
lazy_static = { version = "1.4.0" }
|
||||
miette = { version = "7.2.0", features = ["fancy-no-syscall"] }
|
||||
mimalloc = { version = "0.1.39" }
|
||||
num-bigint = { version = "0.4.4" }
|
||||
num-traits = { version = "0.2.18" }
|
||||
phf = { version = "0.11" }
|
||||
pico-args = { version = "0.5.0" }
|
||||
proc-macro2 = { version = "1.0.79" }
|
||||
project-root = { version = "0.2.2" }
|
||||
quote = { version = "1.0.35" }
|
||||
rayon = { version = "1.9.0" }
|
||||
regex = { version = "1.10.3" }
|
||||
rustc-hash = { version = "1.1.0", default-features = false, features = ["std"] }
|
||||
ryu-js = { version = "1.0.1" }
|
||||
ropey = { version = "1.6.1" }
|
||||
seq-macro = { version = "0.3.5" }
|
||||
serde = { version = "1.0.197" }
|
||||
serde_json = { version = "1.0.114" }
|
||||
syn = { version = "=1.0.109" }
|
||||
tempfile = { version = "3.10.1" }
|
||||
thiserror = { version = "1.0.58" }
|
||||
tokio = { version = "1" }
|
||||
tower-lsp = { version = "0.20.0", features = ["proposed"] }
|
||||
unicode-id-start = { version = "1.1.2" }
|
||||
ureq = { version = "2.9.6", default-features = false, features = ["tls", "json"] }
|
||||
url = { version = "2.5.0" }
|
||||
walkdir = { version = "2.5.0" }
|
||||
indexmap = { version = "2.2.5" }
|
||||
index_vec = { version = "0.1.3" }
|
||||
static_assertions = { version = "1.1.0" }
|
||||
tracing-subscriber = { version = "0.3" }
|
||||
insta = { version = "1.36.1", features = ["glob"] }
|
||||
mime_guess = { version = "2.0.4" }
|
||||
language-tags = { version = "0.3.2" }
|
||||
tsify = { version = "0.4.5" }
|
||||
wasm-bindgen = { version = "0.2" }
|
||||
serde-wasm-bindgen = { version = "0.6.5" }
|
||||
handlebars = { version = "5.1.0" }
|
||||
assert-unchecked = { version = "0.1.2" }
|
||||
bpaf = { version = "0.9.9" }
|
||||
bitflags = { version = "2.4.2" }
|
||||
bumpalo = { version = "3.15.4" }
|
||||
convert_case = { version = "0.6.0" }
|
||||
dashmap = { version = "5.5.3" }
|
||||
flate2 = { version = "1.0.28" }
|
||||
futures = { version = "0.3.30" }
|
||||
glob = { version = "0.3.1" }
|
||||
ignore = { version = "0.4.22" }
|
||||
itertools = { version = "0.12.1" }
|
||||
jemallocator = { version = "0.5.4" }
|
||||
lazy_static = { version = "1.4.0" }
|
||||
miette = { version = "7.2.0", features = ["fancy-no-syscall"] }
|
||||
mimalloc = { version = "0.1.39" }
|
||||
num-bigint = { version = "0.4.4" }
|
||||
num-traits = { version = "0.2.18" }
|
||||
phf = { version = "0.11" }
|
||||
pico-args = { version = "0.5.0" }
|
||||
proc-macro2 = { version = "1.0.79" }
|
||||
project-root = { version = "0.2.2" }
|
||||
quote = { version = "1.0.35" }
|
||||
rayon = { version = "1.9.0" }
|
||||
regex = { version = "1.10.3" }
|
||||
rustc-hash = { version = "1.1.0", default-features = false, features = ["std"] }
|
||||
ryu-js = { version = "1.0.1" }
|
||||
ropey = { version = "1.6.1" }
|
||||
seq-macro = { version = "0.3.5" }
|
||||
serde = { version = "1.0.197" }
|
||||
serde_json = { version = "1.0.114" }
|
||||
syn = { version = "=1.0.109" }
|
||||
tempfile = { version = "3.10.1" }
|
||||
thiserror = { version = "1.0.58" }
|
||||
tokio = { version = "1" }
|
||||
tower-lsp = { version = "0.20.0", features = ["proposed"] }
|
||||
unicode-id-start = { version = "1.1.2" }
|
||||
ureq = { version = "2.9.6", default-features = false, features = ["tls", "json"] }
|
||||
url = { version = "2.5.0" }
|
||||
walkdir = { version = "2.5.0" }
|
||||
indexmap = { version = "2.2.5" }
|
||||
index_vec = { version = "0.1.3" }
|
||||
static_assertions = { version = "1.1.0" }
|
||||
tracing-subscriber = { version = "0.3" }
|
||||
insta = { version = "1.36.1", features = ["glob"] }
|
||||
mime_guess = { version = "2.0.4" }
|
||||
language-tags = { version = "0.3.2" }
|
||||
tsify = { version = "0.4.5" }
|
||||
wasm-bindgen = { version = "0.2" }
|
||||
serde-wasm-bindgen = { version = "0.6.5" }
|
||||
handlebars = { version = "5.1.0" }
|
||||
|
||||
[profile.release.package.oxc_wasm]
|
||||
opt-level = 'z'
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ oxc_span = { workspace = true }
|
|||
|
||||
ignore = { workspace = true, features = ["simd-accel"] }
|
||||
miette = { workspace = true }
|
||||
tempfile = {workspace=true}
|
||||
tempfile = { workspace = true }
|
||||
rayon = { workspace = true }
|
||||
bpaf = { workspace = true, features = ["derive", "autocomplete", "bright-color"] }
|
||||
tracing-subscriber = { workspace = true, features = ["env-filter"] }
|
||||
|
|
|
|||
|
|
@ -126,8 +126,14 @@ fn default_true() -> bool {
|
|||
#[serde(untagged)]
|
||||
enum TagNamePreference {
|
||||
TagNameOnly(String),
|
||||
ObjectWithMessageAndReplacement { message: String, replacement: String },
|
||||
ObjectWithMessage { message: String },
|
||||
ObjectWithMessageAndReplacement {
|
||||
message: String,
|
||||
replacement: String,
|
||||
},
|
||||
ObjectWithMessage {
|
||||
message: String,
|
||||
},
|
||||
#[allow(dead_code)]
|
||||
FalseOnly(bool), // Should care `true`...?
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -206,9 +206,7 @@ pub fn get_array_method_name<'a>(
|
|||
}
|
||||
|
||||
// "methods",
|
||||
let Some(method) = callee.static_property_name() else {
|
||||
return None;
|
||||
};
|
||||
let method = callee.static_property_name()?;
|
||||
if let Some(&array_method) = TARGET_METHODS.get_key(method) {
|
||||
// Check that current node is parent's first argument
|
||||
if call.arguments.len() == 1 && is_nth_argument(call, current_node_arg, 0) {
|
||||
|
|
|
|||
|
|
@ -121,9 +121,7 @@ fn filter_and_process_jest_result<'a>(
|
|||
possible_jest_node: &PossibleJestNode<'a, '_>,
|
||||
ctx: &LintContext<'a>,
|
||||
) -> Option<(Span, &'a Atom<'a>, JestFnKind, AstNodeId)> {
|
||||
let Some(result) = parse_general_jest_fn_call(call_expr, possible_jest_node, ctx) else {
|
||||
return None;
|
||||
};
|
||||
let result = parse_general_jest_fn_call(call_expr, possible_jest_node, ctx)?;
|
||||
let kind = result.kind;
|
||||
// we only need check `describe` or `test` block
|
||||
if !matches!(kind, JestFnKind::General(JestGeneralFnKind::Describe | JestGeneralFnKind::Test)) {
|
||||
|
|
@ -134,9 +132,7 @@ fn filter_and_process_jest_result<'a>(
|
|||
return None;
|
||||
}
|
||||
|
||||
let Some(parent_id) = get_closest_block(possible_jest_node.node, ctx) else {
|
||||
return None;
|
||||
};
|
||||
let parent_id = get_closest_block(possible_jest_node.node, ctx)?;
|
||||
|
||||
match call_expr.arguments.first() {
|
||||
Some(Argument::Expression(Expression::StringLiteral(string_lit))) => {
|
||||
|
|
|
|||
|
|
@ -134,9 +134,7 @@ fn get_jasmine_property_name<'a>(member_expr: &'a MemberExpression<'a>) -> Optio
|
|||
if !is_jasmine_object {
|
||||
return None;
|
||||
}
|
||||
let Some((span, property_name)) = member_expr.static_property_info() else {
|
||||
return None;
|
||||
};
|
||||
let (span, property_name) = member_expr.static_property_info()?;
|
||||
Some((span, property_name))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,9 +85,7 @@ fn is_in_array_or_iter<'a, 'b>(
|
|||
let mut is_explicit_return = false;
|
||||
|
||||
loop {
|
||||
let Some(parent) = ctx.nodes().parent_node(node.id()) else {
|
||||
return None;
|
||||
};
|
||||
let parent = ctx.nodes().parent_node(node.id())?;
|
||||
|
||||
match parent.kind() {
|
||||
AstKind::ArrowFunctionExpression(arrow_expr) => {
|
||||
|
|
@ -99,9 +97,7 @@ fn is_in_array_or_iter<'a, 'b>(
|
|||
return None;
|
||||
}
|
||||
|
||||
let Some(parent) = ctx.nodes().parent_node(parent.id()) else {
|
||||
return None;
|
||||
};
|
||||
let parent = ctx.nodes().parent_node(parent.id())?;
|
||||
|
||||
if let AstKind::ObjectProperty(_) = parent.kind() {
|
||||
return None;
|
||||
|
|
@ -112,9 +108,7 @@ fn is_in_array_or_iter<'a, 'b>(
|
|||
is_outside_containing_function = true;
|
||||
}
|
||||
AstKind::Function(_) => {
|
||||
let Some(parent) = ctx.nodes().parent_node(parent.id()) else {
|
||||
return None;
|
||||
};
|
||||
let parent = ctx.nodes().parent_node(parent.id())?;
|
||||
|
||||
if let AstKind::ObjectProperty(_) = parent.kind() {
|
||||
return None;
|
||||
|
|
@ -391,7 +385,7 @@ fn test() {
|
|||
(Component) => <div><Component /></div>
|
||||
];
|
||||
",
|
||||
r"
|
||||
r"
|
||||
MyStory.decorators = [
|
||||
(Component) => {
|
||||
const store = useMyStore();
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ memchr = "2.7.1"
|
|||
oxc_ast = { workspace = true, features = ["serialize"] }
|
||||
miette = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
ouroboros = "0.18.3" # for `multi-thread` example
|
||||
ouroboros = "0.18.3" # for `multi-thread` example
|
||||
|
||||
[features]
|
||||
# Expose Lexer for benchmarks
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ fn main() {
|
|||
let ast = ast_rx.recv().unwrap();
|
||||
let index = ast.borrow_index();
|
||||
println!("received ast({index}) in {:?} at {}", thread::current().id(), timestamp());
|
||||
ast.with_ast(|bumpalo_program| {
|
||||
println!("AST span: {:?}", bumpalo_program.0.span);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,9 @@ pub(super) fn print_variable_declarator<'a>(
|
|||
pub(super) enum AssignmentLikeNode<'a, 'b> {
|
||||
AssignmentExpression(&'b AssignmentExpression<'a>),
|
||||
VariableDeclarator(&'b VariableDeclarator<'a>),
|
||||
#[allow(dead_code)]
|
||||
PropertyDefinition(&'b PropertyDefinition<'a>),
|
||||
#[allow(dead_code)]
|
||||
AccessorProperty(&'b AccessorProperty<'a>),
|
||||
ObjectProperty(&'b ObjectProperty<'a>),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,11 +38,11 @@ wasm-bindgen = { workspace = true, optional = true }
|
|||
[dev-dependencies]
|
||||
oxc_parser = { workspace = true }
|
||||
|
||||
itertools = { workspace = true }
|
||||
indexmap = { workspace = true }
|
||||
insta = { workspace = true }
|
||||
phf = { workspace = true, features = ["macros"] }
|
||||
rustc-hash = { workspace = true }
|
||||
itertools = { workspace = true }
|
||||
indexmap = { workspace = true }
|
||||
insta = { workspace = true }
|
||||
phf = { workspace = true, features = ["macros"] }
|
||||
rustc-hash = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
|
|||
|
|
@ -19,9 +19,7 @@ impl<'a> JSDocFinder<'a> {
|
|||
}
|
||||
|
||||
pub fn get_one_by_node<'b>(&'b self, node: &AstNode<'a>) -> Option<JSDoc<'a>> {
|
||||
let Some(jsdocs) = self.get_all_by_node(node) else {
|
||||
return None;
|
||||
};
|
||||
let jsdocs = self.get_all_by_node(node)?;
|
||||
|
||||
// If flagged, at least 1 JSDoc is attached
|
||||
// If multiple JSDocs are attached, return the last = nearest
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
pub fn trim_multiline_comment(s: &str) -> String {
|
||||
s.trim()
|
||||
.split('\n')
|
||||
.lines()
|
||||
.map(|line| line.trim().trim_start_matches('*').trim())
|
||||
.filter(|line| !line.is_empty())
|
||||
.collect::<Vec<_>>()
|
||||
|
|
|
|||
|
|
@ -270,14 +270,10 @@ impl<'a> TypeScript<'a> {
|
|||
fn has_value_references(&self, name: &Atom) -> bool {
|
||||
let root_scope_id = self.ctx.scopes().root_scope_id();
|
||||
|
||||
self.ctx
|
||||
.scopes()
|
||||
.get_binding(root_scope_id, name)
|
||||
.map(|symbol_id| {
|
||||
self.ctx.symbols().get_flag(symbol_id).is_export()
|
||||
|| self.ctx.symbols().get_resolved_references(symbol_id).any(|x| !x.is_type())
|
||||
})
|
||||
.unwrap_or_default()
|
||||
self.ctx.scopes().get_binding(root_scope_id, name).is_some_and(|symbol_id| {
|
||||
self.ctx.symbols().get_flag(symbol_id).is_export()
|
||||
|| self.ctx.symbols().get_resolved_references(symbol_id).any(|x| !x.is_type())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
2
justfile
2
justfile
|
|
@ -17,7 +17,7 @@ init:
|
|||
ready:
|
||||
git diff --exit-code --quiet
|
||||
typos
|
||||
cargo fmt
|
||||
just fmt
|
||||
just check
|
||||
just test
|
||||
just lint
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
[toolchain]
|
||||
channel = "1.76.0"
|
||||
channel = "1.77.0"
|
||||
profile = "default"
|
||||
|
|
|
|||
Loading…
Reference in a new issue