Skip to content

fix: Fix mapping typescript rules that extend the original ESLint rule.#412

Merged
Sysix merged 5 commits intooxc-project:mainfrom
connorshea:claude/fix-issue-410-mHPPw
Mar 8, 2026
Merged

fix: Fix mapping typescript rules that extend the original ESLint rule.#412
Sysix merged 5 commits intooxc-project:mainfrom
connorshea:claude/fix-issue-410-mHPPw

Conversation

@connorshea
Copy link
Copy Markdown
Member

This fixes #410.

I have tested all three of these cases and confirmed that this works correctly for all three cases, it also does not print an unsupported warning for eslint/dot-notation anymore:

import tseslint from "typescript-eslint";

export default tseslint.config({
  plugins: {
    "@typescript-eslint": tseslint.plugin,
  },
  rules: {
    "dot-notation": "off",
    "@typescript-eslint/dot-notation": "error",
  },
});
import tseslint from "typescript-eslint";

export default tseslint.config({
  plugins: {
    "@typescript-eslint": tseslint.plugin,
  },
  rules: {
    "@typescript-eslint/dot-notation": "error",
  },
});
export default [
  {
    rules: {
      "dot-notation": "error",
    },
  },
];

typescript/consistent-return also has this same situation, and so is also fixed.

Generated with Claude Code, tested and reviewed by me.

@connorshea connorshea force-pushed the claude/fix-issue-410-mHPPw branch 2 times, most recently from 408c7df to 2e847d1 Compare March 1, 2026 17:41
@Sysix
Copy link
Copy Markdown
Member

Sysix commented Mar 1, 2026

@connorshea
Copy link
Copy Markdown
Member Author

Should this not be fixed by oxlint with the typescript alias mapping? https://github.com/oxc-project/oxc/blob/8b89309f5740aeba5d7ef9b1389d41f915239bbb/crates/oxc_linter/src/utils/mod.rs#L86-L129

The problem is that - if we do it that way - we need to move the rule into the ESLint namespace to avoid this bug that occurs when we mark a rule as a typescript extension rule: oxc-project/oxc#19437

Currently, the oxc config evaluation logic breaks if you have an extension rule that is in the typescript namespace instead of the eslint namespace (so after adding dot-notation to the list of extended rules, eslint/dot_notation.rs would be fine, but if you have typescript/dot_notation.rs we have problems).

Though, arguably we should figure out the root cause and fix that bug in oxc so we can do this aliasing properly in oxc, but 🤷

@Sysix
Copy link
Copy Markdown
Member

Sysix commented Mar 1, 2026

Oh, these rules require type-aware flag, this change everything 🤔
Let me think how to resolve this at best. I wish that Oxlint has some solution for this. :')

@connorshea
Copy link
Copy Markdown
Member Author

Oh, these rules require type-aware flag, this change everything 🤔 Let me think how to resolve this at best. I wish that Oxlint has some solution for this. :')

Any ideas? :D This would be nice to have fixed since it's hard to figure out which of my overrides in my complex ESLint config use these rules

@Sysix
Copy link
Copy Markdown
Member

Sysix commented Mar 8, 2026

Sorry, I thought about it last day but could not find a good solution. I think the only way is to split the rules like I want to do it with jest/vitest in this stack: oxc-project/oxc#18603

In the meantime I would accept this fix in the migration script :) could you resolve the conflicts?

claude and others added 4 commits March 8, 2026 17:41
…ript equivalents when --type-aware is enabled

When the --type-aware flag is set, ESLint rules that are unsupported in
oxlint but have @typescript-eslint equivalents (dot-notation and
consistent-return) are now remapped to their typescript counterparts
instead of being marked as unsupported. Since the typescript equivalents
are nursery rules, --with-nursery is also required to include them in
the final output.

Fixes oxc-project#410

https://claude.ai/code/session_01CMRErqfmz5SMJDGDif36w3
…case

The nursery check for these rules is a temporary state; the test now
focuses on the core behavior of remapping ESLint rules to their
@typescript-eslint equivalents when --type-aware is enabled.

https://claude.ai/code/session_01CMRErqfmz5SMJDGDif36w3
@connorshea connorshea force-pushed the claude/fix-issue-410-mHPPw branch from 2e847d1 to 86cc8af Compare March 8, 2026 23:42
@connorshea connorshea requested a review from Sysix March 8, 2026 23:45
@Sysix Sysix merged commit 462293f into oxc-project:main Mar 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dot-notation rule is not migrated like it should be

3 participants