test(oxlint): improve disabling "no-nested-ternary" tests (#8814)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Alexander S. 2025-01-31 14:19:11 +01:00 committed by GitHub
parent 8ce21d1d48
commit 2b83b71b94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 34 additions and 17 deletions

View file

@ -0,0 +1,6 @@
{
"plugins": [],
"rules": {
"eslint/no-nested-ternary": "off"
}
}

View file

@ -1,10 +1,8 @@
{
"plugins": [
"oxc",
"unicorn"
],
"rules": {
"eslint/no-nested-ternary": "off",
"unicorn/no-nested-ternary": "off"
}
}

View file

@ -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]

View file

@ -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
----------

View file

@ -1,12 +0,0 @@
---
source: apps/oxlint/src/tester.rs
---
##########
arguments: -c .oxlintrc.json test.js
working directory: fixtures/two_rules_with_same_name
----------
Found 0 warnings and 0 errors.
Finished in <variable>ms on 1 file with 74 rules using 1 threads.
----------
CLI result: LintSucceeded
----------