Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(linter): enable no-fallthrough test with disable-next-line. #3766

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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