Skip to content

Commit c2fdfc4

Browse files
authoredJan 31, 2025··
refactor(linter): correctly handle loose options for eslint/eqeqeq (#8798)
Related to #8790 For the configuration `"eqeqeq": ["warn", "alw", { "null": "ignore" }]`, we should default `"alw"` to `"always"` and correctly handle the option `{ "null": "ignore" }`.
1 parent b3bf205 commit c2fdfc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎crates/oxc_linter/src/rules/eslint/eqeqeq.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ declare_oxc_lint!(
4242

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

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

54-
let compare_type = first_arg.unwrap_or_default();
54+
let compare_type = first_arg.map(CompareType::from).unwrap_or_default();
5555

5656
Self { compare_type, null_type }
5757
}

0 commit comments

Comments
 (0)
Please sign in to comment.