Commit 6bc8aec
committed
fix(linter): Fix the behavior of
See #18918 for details and a test repo. This fixes the problematic behavior of the Oxlint implementation so we match the implementation from the original import plugin.
Basically, we want to have `tsx: never` in the rule config, and in that case it should disallow this:
```tsx
import Foo from "./Foo.stories.tsx";
```
It correctly did that, but if you _removed_ the `tsx` extension, you would end up with an error about not allowing the `stories` extension, which was nonsensical. Now we correctly handle this behavior, so `import Foo from "./Foo.stories";` is allowed for this config setting.
Built with Claude Code, reviewed and tested by me. [Another user also confirmed that this fixes the problem for them](#18681 (comment)).
Fixes #18918 and #18681.import/extensions rule for a file that has multiple extensions. (#18919)1 parent 1bf569b commit 6bc8aec
File tree
5 files changed
+58
-3
lines changed- crates/oxc_linter
- fixtures/import
- src
- rules/import
- snapshots
5 files changed
+58
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
543 | 555 | | |
544 | 556 | | |
545 | | - | |
| 557 | + | |
546 | 558 | | |
547 | 559 | | |
548 | 560 | | |
549 | | - | |
| 561 | + | |
550 | 562 | | |
551 | | - | |
| 563 | + | |
552 | 564 | | |
553 | 565 | | |
554 | 566 | | |
| |||
1217 | 1229 | | |
1218 | 1230 | | |
1219 | 1231 | | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
1220 | 1237 | | |
1221 | 1238 | | |
1222 | 1239 | | |
| |||
1685 | 1702 | | |
1686 | 1703 | | |
1687 | 1704 | | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
1688 | 1715 | | |
1689 | 1716 | | |
1690 | 1717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
0 commit comments