Skip to content

Commit

Permalink
refactor(linter): correctly handle loose options for eslint/eqeqeq
Browse files Browse the repository at this point in the history
  • Loading branch information
shulaoda committed Jan 31, 2025
1 parent 0aeaedd commit 9aefeda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/eslint/eqeqeq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare_oxc_lint!(

impl Rule for Eqeqeq {
fn from_configuration(value: serde_json::Value) -> Self {
let first_arg = value.get(0).and_then(serde_json::Value::as_str).map(CompareType::from);
let first_arg = value.get(0).and_then(serde_json::Value::as_str);

let null_type = value
.get(usize::from(first_arg.is_some()))
Expand All @@ -51,7 +51,7 @@ impl Rule for Eqeqeq {
.map(NullType::from)
.unwrap_or_default();

let compare_type = first_arg.unwrap_or_default();
let compare_type = first_arg.map(CompareType::from).unwrap_or_default();

Self { compare_type, null_type }
}
Expand Down

0 comments on commit 9aefeda

Please sign in to comment.