Skip to content

Commit

Permalink
test(linter): enable no-fallthrough test with disable-next-line. (#…
Browse files Browse the repository at this point in the history
…3766)

I thought we didn't have this, But now that I've read the `LintContext` I have realized it wasn't true.
  • Loading branch information
rzvxa committed Jun 19, 2024
1 parent 4d2b7f1 commit 887da40
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions crates/oxc_linter/src/rules/eslint/no_fallthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,10 @@ fn test() {
("switch (foo) { case 0: try {} finally { break; } default: b(); }", None),
("switch (foo) { case 0: try { throw 0; } catch (err) { break; } default: b(); }", None),
("switch (foo) { case 0: do { throw 0; } while(a); default: b(); }", None),
// TODO: we need a way to handle disables in the higher context, For example purging
// disabled diagnostics.
// (
// "switch (foo) { case 0: a(); \n// eslint-disable-next-line no-fallthrough\n case 1: }",
// None,
// ),
(
"switch (foo) { case 0: a(); \n// eslint-disable-next-line no-fallthrough\n case 1: }",
None,
),
(
"switch(foo) { case 0: a(); /* no break */ case 1: b(); }",
Some(serde_json::json!([{
Expand Down

0 comments on commit 887da40

Please sign in to comment.