Skip to content

Commit 69091c0

Browse files
authored
fix(linter): correct default for eslint/no-eval (oxc-project#9312)
closes oxc-project#9311 Incredible, I had overlooked this before. I always thought `from_configuration` was enough, until the `correctness` rule exposed this issue.
1 parent ef43487 commit 69091c0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ fn no_eval_diagnostic(span: Span) -> OxcDiagnostic {
1515
OxcDiagnostic::warn("eval can be harmful.").with_label(span)
1616
}
1717

18-
#[derive(Debug, Default, Clone)]
18+
#[derive(Debug, Clone)]
1919
pub struct NoEval {
2020
allow_indirect: bool,
2121
}
2222

23+
impl Default for NoEval {
24+
fn default() -> Self {
25+
NoEval { allow_indirect: true }
26+
}
27+
}
28+
2329
declare_oxc_lint!(
2430
/// ### What it does
2531
///

0 commit comments

Comments
 (0)