diff --git a/crates/oxc_linter/src/rules/react/jsx_filename_extension.rs b/crates/oxc_linter/src/rules/react/jsx_filename_extension.rs index 1b75fea329a3f..b9ab2e1965fad 100644 --- a/crates/oxc_linter/src/rules/react/jsx_filename_extension.rs +++ b/crates/oxc_linter/src/rules/react/jsx_filename_extension.rs @@ -41,13 +41,23 @@ impl AllowType { #[derive(Debug, Default, Clone)] pub struct JsxFilenameExtension(Box); -#[derive(Debug, Default, Clone)] +#[derive(Debug, Clone)] pub struct JsxFilenameExtensionConfig { allow: AllowType, extensions: Vec, ignore_files_without_code: bool, } +impl Default for JsxFilenameExtensionConfig { + fn default() -> Self { + Self { + allow: AllowType::Always, + extensions: vec![CompactStr::from("jsx")], + ignore_files_without_code: false, + } + } +} + impl std::ops::Deref for JsxFilenameExtension { type Target = JsxFilenameExtensionConfig; diff --git a/crates/oxc_linter/tests/rule_configuration_test.rs b/crates/oxc_linter/tests/rule_configuration_test.rs index 047d7d705945c..e068399285a53 100644 --- a/crates/oxc_linter/tests/rule_configuration_test.rs +++ b/crates/oxc_linter/tests/rule_configuration_test.rs @@ -25,7 +25,6 @@ fn test_rule_default_matches_from_configuration_null() { // 1. The Default implementation returns the same values as from_configuration(null), or // 2. The from_configuration method is updated to return Default::default() when given null let exceptions = [ - "react/jsx-filename-extension", "typescript/no-this-alias", "unicorn/prefer-object-from-entries", "unicorn/prefer-structured-clone",