diff --git a/tasks/lint_rules/src/eslint-rules.cjs b/tasks/lint_rules/src/eslint-rules.cjs index 8068285be17c9..0ee0be1c51d59 100644 --- a/tasks/lint_rules/src/eslint-rules.cjs +++ b/tasks/lint_rules/src/eslint-rules.cjs @@ -263,3 +263,7 @@ exports.loadTargetPluginRules = (linter) => { loadPluginReactPerfRules(linter); loadPluginNextRules(linter); }; + +// some typescript rules are some extension of the basic eslint rules +// we need them later to map them for both +exports.pluginTypeScriptRulesNames = Object.keys(pluginTypeScriptAllRules); \ No newline at end of file diff --git a/tasks/lint_rules/src/oxlint-rules.cjs b/tasks/lint_rules/src/oxlint-rules.cjs index 4a6b2f65f3225..03572267beaa7 100644 --- a/tasks/lint_rules/src/oxlint-rules.cjs +++ b/tasks/lint_rules/src/oxlint-rules.cjs @@ -1,5 +1,6 @@ const { resolve } = require("node:path"); const { readFile } = require("node:fs/promises"); +const { pluginTypeScriptRulesNames } = require("./eslint-rules.cjs"); const readAllImplementedRuleNames = async () => { const rulesFile = await readFile( @@ -34,6 +35,18 @@ const readAllImplementedRuleNames = async () => { // Ignore no reference rules if (prefixedName.startsWith("oxc/")) continue; + // some tyescript rules are extensions of eslint core rules + if (prefixedName.startsWith("eslint/")) { + const ruleName = prefixedName.replace('eslint/', ''); + + // there is no alias + if (!pluginTypeScriptRulesNames.includes(ruleName)) { + continue; + } + + rules.add(`typescript/${ruleName}`); + } + rules.add(prefixedName); } }