Skip to content

Commit fbdf59f

Browse files
committed
fix(linter): default options for eslint/no-unneeded-ternary
1 parent c199a38 commit fbdf59f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/oxc_linter/src/rules/eslint/no_unneeded_ternary.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@ fn no_unneeded_ternary_conditional_expression_diagnostic(span: Span) -> OxcDiagn
1919
.with_label(span)
2020
}
2121

22-
#[derive(Debug, Default, Clone)]
22+
#[derive(Debug, Clone)]
2323
pub struct NoUnneededTernary {
2424
default_assignment: bool,
2525
}
2626

27+
impl Default for NoUnneededTernary {
28+
fn default() -> Self {
29+
Self { default_assignment: true }
30+
}
31+
}
32+
2733
declare_oxc_lint!(
2834
/// ### What it does
2935
///

crates/oxc_linter/tests/rule_configuration_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ fn test_rule_default_matches_from_configuration_null() {
2525
// 1. The Default implementation returns the same values as from_configuration(null), or
2626
// 2. The from_configuration method is updated to return Default::default() when given null
2727
let exceptions = [
28-
"eslint/no-unneeded-ternary",
2928
"eslint/no-else-return",
3029
"import/extensions",
3130
"import/no-anonymous-default-export",

0 commit comments

Comments
 (0)