fix: Fix mapping typescript rules that extend the original ESLint rule.#412
Conversation
408c7df to
2e847d1
Compare
|
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, 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 🤷 |
|
Oh, these rules require type-aware flag, this change everything 🤔 |
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 |
|
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? |
…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
2e847d1 to
86cc8af
Compare
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-notationanymore:typescript/consistent-return also has this same situation, and so is also fixed.
Generated with Claude Code, tested and reviewed by me.