Skip to content

Commit

Permalink
test(oxlint): improve disabling "no-nested-ternary" tests (#8814)
Browse files Browse the repository at this point in the history
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
Sysix and autofix-ci[bot] authored Jan 31, 2025
1 parent 8ce21d1 commit 2b83b71
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": [],
"rules": {
"eslint/no-nested-ternary": "off"
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"plugins": [
"oxc",
"unicorn"
],
"rules": {
"eslint/no-nested-ternary": "off",
"unicorn/no-nested-ternary": "off"
}
}
9 changes: 6 additions & 3 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,13 @@ mod test {
}

#[test]
fn test_two_rules_with_same_name_from_different_plugin_names() {
fn test_disable_eslint_and_unicorn_alias_rules() {
// Issue: <https://github.com/oxc-project/oxc/issues/8485>
let args = &["-c", ".oxlintrc.json", "test.js"];
Tester::new().with_cwd("fixtures/two_rules_with_same_name".into()).test_and_snapshot(args);
let args_1 = &["-c", ".oxlintrc-eslint.json", "test.js"];
let args_2 = &["-c", ".oxlintrc-unicorn.json", "test.js"];
Tester::new()
.with_cwd("fixtures/disable_eslint_and_unicorn_alias_rules".into())
.test_and_snapshot_multiple(&[args_1, args_2]);
}

#[test]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: apps/oxlint/src/tester.rs
---
##########
arguments: -c .oxlintrc-eslint.json test.js
working directory: fixtures/disable_eslint_and_unicorn_alias_rules
----------
Found 0 warnings and 0 errors.
Finished in <variable>ms on 1 file with 48 rules using 1 threads.
----------
CLI result: LintSucceeded
----------

##########
arguments: -c .oxlintrc-unicorn.json test.js
working directory: fixtures/disable_eslint_and_unicorn_alias_rules
----------
Found 0 warnings and 0 errors.
Finished in <variable>ms on 1 file with 61 rules using 1 threads.
----------
CLI result: LintSucceeded
----------

This file was deleted.

0 comments on commit 2b83b71

Please sign in to comment.