diff --git a/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/.oxlintrc-eslint.json b/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/.oxlintrc-eslint.json index 9f5e705e3..c60c7a4b4 100644 --- a/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/.oxlintrc-eslint.json +++ b/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/.oxlintrc-eslint.json @@ -1,6 +1,6 @@ { "plugins": [], "rules": { - "eslint/no-nested-ternary": "off" + "eslint/no-negated-condition": "off" } } diff --git a/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/.oxlintrc-unicorn.json b/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/.oxlintrc-unicorn.json index 6d34ea2c5..3347526bd 100644 --- a/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/.oxlintrc-unicorn.json +++ b/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/.oxlintrc-unicorn.json @@ -3,6 +3,6 @@ "unicorn" ], "rules": { - "unicorn/no-nested-ternary": "off" + "unicorn/no-negated-condition": "off" } } diff --git a/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/test.js b/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/test.js index 498f6f9b2..bfcc644f1 100644 --- a/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/test.js +++ b/apps/oxlint/fixtures/disable_eslint_and_unicorn_alias_rules/test.js @@ -1 +1,5 @@ -console.log(bar ? baz : qux === quxx ? bing : bam); +if (!condition) { + console.log(123) +} else { + console.log(666) +} diff --git a/apps/oxlint/fixtures/two_rules_with_same_rule_name/.oxlintrc.json b/apps/oxlint/fixtures/two_rules_with_same_rule_name/.oxlintrc.json new file mode 100644 index 000000000..ee3c88d50 --- /dev/null +++ b/apps/oxlint/fixtures/two_rules_with_same_rule_name/.oxlintrc.json @@ -0,0 +1,9 @@ +{ + "plugins": [ + "unicorn" + ], + "rules": { + "eslint/no-nested-ternary": "off", + "unicorn/no-nested-ternary": "off" + } +} diff --git a/apps/oxlint/fixtures/two_rules_with_same_rule_name/test.js b/apps/oxlint/fixtures/two_rules_with_same_rule_name/test.js new file mode 100644 index 000000000..498f6f9b2 --- /dev/null +++ b/apps/oxlint/fixtures/two_rules_with_same_rule_name/test.js @@ -0,0 +1 @@ +console.log(bar ? baz : qux === quxx ? bing : bam); diff --git a/apps/oxlint/src/lint.rs b/apps/oxlint/src/lint.rs index 446eb6cea..3c1f2f1eb 100644 --- a/apps/oxlint/src/lint.rs +++ b/apps/oxlint/src/lint.rs @@ -826,7 +826,6 @@ mod test { #[test] fn test_disable_eslint_and_unicorn_alias_rules() { - // Issue: let args_1 = &["-c", ".oxlintrc-eslint.json", "test.js"]; let args_2 = &["-c", ".oxlintrc-unicorn.json", "test.js"]; Tester::new() @@ -834,6 +833,15 @@ mod test { .test_and_snapshot_multiple(&[args_1, args_2]); } + #[test] + fn test_two_rules_with_same_rule_name_from_different_plugins() { + // Issue: + let args = &["-c", ".oxlintrc.json", "test.js"]; + Tester::new() + .with_cwd("fixtures/two_rules_with_same_rule_name".into()) + .test_and_snapshot(args); + } + #[test] fn test_adjust_ignore_patterns() { let base = PathBuf::from("/project/root"); diff --git a/apps/oxlint/src/snapshots/fixtures__two_rules_with_same_rule_name_-c .oxlintrc.json test.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__two_rules_with_same_rule_name_-c .oxlintrc.json test.js@oxlint.snap new file mode 100644 index 000000000..a388090bc --- /dev/null +++ b/apps/oxlint/src/snapshots/fixtures__two_rules_with_same_rule_name_-c .oxlintrc.json test.js@oxlint.snap @@ -0,0 +1,12 @@ +--- +source: apps/oxlint/src/tester.rs +--- +########## +arguments: -c .oxlintrc.json test.js +working directory: fixtures/two_rules_with_same_rule_name +---------- +Found 0 warnings and 0 errors. +Finished in ms on 1 file with 61 rules using 1 threads. +---------- +CLI result: LintSucceeded +----------