diff --git a/tasks/lint_rules/src/main.cjs b/tasks/lint_rules/src/main.cjs index 3631d182cee05..bd1b406423934 100644 --- a/tasks/lint_rules/src/main.cjs +++ b/tasks/lint_rules/src/main.cjs @@ -10,6 +10,7 @@ const { updateImplementedStatus, overrideTypeScriptPluginStatusWithEslintPluginStatus: syncTypeScriptPluginStatusWithEslintPluginStatus, syncVitestPluginStatusWithJestPluginStatus, + syncUnicornPluginStatusWithEslintPluginStatus, } = require('./oxlint-rules.cjs'); const { renderMarkdown } = require('./markdown-renderer.cjs'); const { updateGitHubIssue } = require('./result-reporter.cjs'); @@ -63,6 +64,7 @@ Plugins: ${Array.from(ALL_TARGET_PLUGINS.keys()).join(', ')} updateNotSupportedStatus(ruleEntries); await syncTypeScriptPluginStatusWithEslintPluginStatus(ruleEntries); await syncVitestPluginStatusWithJestPluginStatus(ruleEntries); + syncUnicornPluginStatusWithEslintPluginStatus(ruleEntries); // // Render list and update if necessary diff --git a/tasks/lint_rules/src/oxlint-rules.cjs b/tasks/lint_rules/src/oxlint-rules.cjs index aa54724132c28..31961ffb1bc34 100644 --- a/tasks/lint_rules/src/oxlint-rules.cjs +++ b/tasks/lint_rules/src/oxlint-rules.cjs @@ -196,3 +196,23 @@ exports.syncVitestPluginStatusWithJestPluginStatus = async (ruleEntries) => { } } }; + +/** + * Some Unicorn rules rules are re-implemented version of eslint rules. + * We should override these to make implementation status up-to-date. + * @param {RuleEntries} ruleEntries + */ +exports.syncUnicornPluginStatusWithEslintPluginStatus = (ruleEntries) => { + const rules = new Set(['no-negated-condition']); + + for (const rule of rules) { + const unicornRuleEntry = ruleEntries.get(`unicorn/${rule}`); + const eslintRuleEntry = ruleEntries.get(`eslint/${rule}`); + if (unicornRuleEntry && eslintRuleEntry) { + ruleEntries.set(`unicorn/${rule}`, { + ...unicornRuleEntry, + isImplemented: eslintRuleEntry.isImplemented, + }); + } + } +};