Skip to content

Commit 4265db7

Browse files
committed
fix(linter/import/no-anonymous-default-export): update Default implementation for NoAnonymousDefaultExport config (#12784)
1 parent 6a360e3 commit 4265db7

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

crates/oxc_linter/src/rules/import/no_anonymous_default_export.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn no_anonymous_default_export_diagnostic(span: Span, msg: &'static str) -> OxcD
1414
OxcDiagnostic::warn(msg).with_label(span)
1515
}
1616

17-
#[derive(Debug, Default, Clone)]
17+
#[derive(Debug, Clone)]
1818
pub struct NoAnonymousDefaultExport {
1919
allow_array: bool,
2020
allow_arrow_function: bool,
@@ -26,6 +26,21 @@ pub struct NoAnonymousDefaultExport {
2626
allow_object: bool,
2727
}
2828

29+
impl Default for NoAnonymousDefaultExport {
30+
fn default() -> Self {
31+
Self {
32+
allow_array: false,
33+
allow_arrow_function: false,
34+
allow_anonymous_class: false,
35+
allow_anonymous_function: false,
36+
allow_call_expression: true,
37+
allow_new: false,
38+
allow_literal: false,
39+
allow_object: false,
40+
}
41+
}
42+
}
43+
2944
declare_oxc_lint!(
3045
/// ### What it does
3146
///

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-
"import/no-anonymous-default-export",
2928
"jest/no-deprecated-functions",
3029
"jest/no-large-snapshots",
3130
"jest/prefer-lowercase-title",

0 commit comments

Comments
 (0)