Skip to content

Commit 7b08822

Browse files
committed
fix(linter/jest/no-large-snapshots): update Default implementation for NoLargeSnapshotsConfig
1 parent 0eaebcd commit 7b08822

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,19 @@ fn too_long_snapshot(line_limit: usize, line_count: usize, span: Span) -> OxcDia
3535
#[derive(Debug, Default, Clone)]
3636
pub struct NoLargeSnapshots(Box<NoLargeSnapshotsConfig>);
3737

38-
#[derive(Debug, Default, Clone)]
38+
#[derive(Debug, Clone)]
3939
pub struct NoLargeSnapshotsConfig {
4040
pub max_size: usize,
4141
pub inline_max_size: usize,
4242
pub allowed_snapshots: FxHashMap<CompactStr, Vec<CompactStr>>,
4343
}
4444

45+
impl Default for NoLargeSnapshotsConfig {
46+
fn default() -> Self {
47+
Self { max_size: 50, inline_max_size: 50, allowed_snapshots: FxHashMap::default() }
48+
}
49+
}
50+
4551
impl Deref for NoLargeSnapshots {
4652
type Target = NoLargeSnapshotsConfig;
4753

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

0 commit comments

Comments
 (0)