Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ unused_peekable = "warn"
too_long_first_doc_paragraph = "warn"
suspicious_operation_groupings = "warn"
redundant_clone = "warn"
unnecessary_unwrap = "allow" # FIXME
needless_doctest_main = "allow" # FIXME
zero_sized_map_values = "allow" # FIXME https://github.com/rust-lang/rust-clippy/issues/15429
# cargo
Expand Down
11 changes: 6 additions & 5 deletions crates/oxc_linter/src/rules/nextjs/no_duplicate_head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,14 @@ impl Rule for NoDuplicateHead {
}

let node_id = reference.node_id();
if first_node_id.is_none() {
// First `<Head>` found
first_node_id = Some(node_id);
} else if labels.is_empty() {
if labels.is_empty()
&& let Some(first_node_id) = first_node_id
{
// 2nd `<Head>` found - populate `labels` with both
let first_node_id = first_node_id.unwrap();
labels.extend([get_label(first_node_id), get_label(node_id)]);
} else if first_node_id.is_none() {
// First `<Head>` found
first_node_id = Some(node_id);
} else {
// Further `<Head>` found - add to `node_ids`
labels.push(get_label(node_id));
Expand Down
6 changes: 4 additions & 2 deletions crates/oxc_parser/src/js/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ impl<'a> ParserImpl<'a> {
let mut phase = None;
let mut import_kind = ImportOrExportKind::Value;

if self.at(Kind::Eq) && identifier_after_import.is_some() {
if self.at(Kind::Eq)
&& let Some(identifier_after_import) = identifier_after_import
{
// `import something = ...`
let decl = self.parse_ts_import_equals_declaration(
ImportOrExportKind::Value,
identifier_after_import.unwrap(),
identifier_after_import,
span,
);
return Statement::from(decl);
Expand Down
Loading