Skip to content

Commit 5d52e92

Browse files
committed
fix(linter/jest/no-deprecated-functions): update Default implementation for JestConfig
1 parent c6eb6b2 commit 5d52e92

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@ fn deprecated_function(deprecated: &str, new: &str, span: Span) -> OxcDiagnostic
1313
.with_label(span)
1414
}
1515

16-
#[derive(Debug, Default, Clone)]
16+
#[derive(Debug, Clone)]
1717
pub struct JestConfig {
1818
version: String,
1919
}
2020

21+
impl Default for JestConfig {
22+
fn default() -> Self {
23+
Self { version: "29".to_string() }
24+
}
25+
}
26+
2127
#[derive(Debug, Default, Clone)]
2228
pub struct NoDeprecatedFunctions(Box<NoDeprecatedFunctionsConfig>);
2329

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-
"jest/no-deprecated-functions",
2928
"jest/no-large-snapshots",
3029
"jest/prefer-lowercase-title",
3130
"react/jsx-filename-extension",

0 commit comments

Comments
 (0)