Commit 8c2cfbc
committed
fix(linter): false negative in no-restricted-imports (#11026)
in scenrio such as
```ts
import 'foo'
import { a } from 'b'
```
if `foo` was banned module, it wouldn't be reported as `module_record.import_entries.is_empty()` would not be true.
we now check if `import 'foo'` is included in `module_record.import_entries` to decide whether to add to side effects map1 parent db6afb9 commit 8c2cfbc
File tree
2 files changed
+20
-1
lines changed- crates/oxc_linter/src
- rules/eslint
- snapshots
2 files changed
+20
-1
lines changedLines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
996 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
997 | 1003 | | |
998 | 1004 | | |
999 | 1005 | | |
| |||
3026 | 3032 | | |
3027 | 3033 | | |
3028 | 3034 | | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
3029 | 3041 | | |
3030 | 3042 | | |
3031 | 3043 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
811 | 818 | | |
812 | 819 | | |
813 | 820 | | |
| |||
0 commit comments