@@ -71,22 +71,22 @@ ruleTester.run('no-wildcard-imports', rule, {
71
71
72
72
// Test default import
73
73
{
74
- code : `import useIsomorphicLayoutEffect from '@primer/react/lib-esm/useIsomorphicLayoutEffect'` ,
74
+ code : `import useIsomorphicLayoutEffect from '@primer/react/lib-esm/utils/ useIsomorphicLayoutEffect'` ,
75
75
output : `import {useIsomorphicLayoutEffect} from '@primer/react'` ,
76
76
errors : [
77
77
{
78
78
messageId : 'wildcardMigration' ,
79
79
data : {
80
- wildcardEntrypoint : '@primer/react/lib-esm/useIsomorphicLayoutEffect' ,
80
+ wildcardEntrypoint : '@primer/react/lib-esm/utils/ useIsomorphicLayoutEffect' ,
81
81
} ,
82
82
} ,
83
83
] ,
84
84
} ,
85
85
86
86
// Test multiple wildcard imports into single entrypoint
87
87
{
88
- code : `import useResizeObserver from '@primer/react/lib-esm/hooks/useResizeObserver'
89
- import useIsomorphicLayoutEffect from '@primer/react/lib-esm/useIsomorphicLayoutEffect'` ,
88
+ code : `import { useResizeObserver} from '@primer/react/lib-esm/hooks/useResizeObserver'
89
+ import useIsomorphicLayoutEffect from '@primer/react/lib-esm/utils/ useIsomorphicLayoutEffect'` ,
90
90
output : `import {useResizeObserver} from '@primer/react'
91
91
import {useIsomorphicLayoutEffect} from '@primer/react'` ,
92
92
errors : [
@@ -99,7 +99,21 @@ ruleTester.run('no-wildcard-imports', rule, {
99
99
{
100
100
messageId : 'wildcardMigration' ,
101
101
data : {
102
- wildcardEntrypoint : '@primer/react/lib-esm/useIsomorphicLayoutEffect' ,
102
+ wildcardEntrypoint : '@primer/react/lib-esm/utils/useIsomorphicLayoutEffect' ,
103
+ } ,
104
+ } ,
105
+ ] ,
106
+ } ,
107
+
108
+ // Test renamed wildcard imports
109
+ {
110
+ code : `import type {ItemProps} from '@primer/react/lib-esm/deprecated/ActionList/Item'` ,
111
+ output : `import type {ActionListItemProps as ItemProps} from '@primer/react/deprecated'` ,
112
+ errors : [
113
+ {
114
+ messageId : 'wildcardMigration' ,
115
+ data : {
116
+ wildcardEntrypoint : '@primer/react/lib-esm/deprecated/ActionList/Item' ,
103
117
} ,
104
118
} ,
105
119
] ,
@@ -154,7 +168,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
154
168
} ,
155
169
{
156
170
code : `import {SelectPanel} from '@primer/react/lib-esm/SelectPanel/SelectPanel'` ,
157
- output : `import {SelectPanel} from '@primer/react/experimental '` ,
171
+ output : `import {SelectPanel} from '@primer/react'` ,
158
172
errors : [
159
173
{
160
174
messageId : 'wildcardMigration' ,
@@ -166,7 +180,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
166
180
} ,
167
181
{
168
182
code : `import type {SelectPanelProps} from '@primer/react/lib-esm/SelectPanel/SelectPanel'` ,
169
- output : `import type {SelectPanelProps} from '@primer/react/experimental '` ,
183
+ output : `import type {SelectPanelProps} from '@primer/react'` ,
170
184
errors : [
171
185
{
172
186
messageId : 'wildcardMigration' ,
@@ -226,7 +240,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
226
240
} ,
227
241
{
228
242
code : `import type {ItemProps} from '@primer/react/lib-esm/deprecated/ActionList'` ,
229
- output : `import type {ActionListItemProps} from '@primer/react/deprecated'` ,
243
+ output : `import type {ActionListItemProps as ItemProps } from '@primer/react/deprecated'` ,
230
244
errors : [
231
245
{
232
246
messageId : 'wildcardMigration' ,
@@ -238,7 +252,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
238
252
} ,
239
253
{
240
254
code : `import type {GroupedListProps} from '@primer/react/lib-esm/deprecated/ActionList/List'` ,
241
- output : `import type {ActionListGroupedListProps} from '@primer/react/deprecated'` ,
255
+ output : `import type {ActionListGroupedListProps as GroupedListProps } from '@primer/react/deprecated'` ,
242
256
errors : [
243
257
{
244
258
messageId : 'wildcardMigration' ,
@@ -250,7 +264,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
250
264
} ,
251
265
{
252
266
code : `import {ItemInput} from '@primer/react/lib-esm/deprecated/ActionList/List'` ,
253
- output : `import {ActionListItemInput} from '@primer/react/deprecated'` ,
267
+ output : `import {ActionListItemInput as ItemInput } from '@primer/react/deprecated'` ,
254
268
errors : [
255
269
{
256
270
messageId : 'wildcardMigration' ,
@@ -262,7 +276,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
262
276
} ,
263
277
{
264
278
code : `import type {ItemProps} from '@primer/react/lib-esm/deprecated/ActionList/Item'` ,
265
- output : `import type {ActionListItemProps} from '@primer/react/deprecated'` ,
279
+ output : `import type {ActionListItemProps as ItemProps } from '@primer/react/deprecated'` ,
266
280
errors : [
267
281
{
268
282
messageId : 'wildcardMigration' ,
@@ -277,21 +291,21 @@ import type {ButtonBaseProps} from '@primer/react'`,
277
291
278
292
// @primer /react/lib-esm/useIsomorphicLayoutEffect
279
293
{
280
- code : `import useIsomorphicLayoutEffect from '@primer/react/lib-esm/useIsomorphicLayoutEffect'` ,
294
+ code : `import useIsomorphicLayoutEffect from '@primer/react/lib-esm/utils/ useIsomorphicLayoutEffect'` ,
281
295
output : `import {useIsomorphicLayoutEffect} from '@primer/react'` ,
282
296
errors : [
283
297
{
284
298
messageId : 'wildcardMigration' ,
285
299
data : {
286
- wildcardEntrypoint : '@primer/react/lib-esm/useIsomorphicLayoutEffect' ,
300
+ wildcardEntrypoint : '@primer/react/lib-esm/utils/ useIsomorphicLayoutEffect' ,
287
301
} ,
288
302
} ,
289
303
] ,
290
304
} ,
291
305
292
306
// @primer /react/lib-esm/hooks/useResizeObserver
293
307
{
294
- code : `import useResizeObserver from '@primer/react/lib-esm/hooks/useResizeObserver'` ,
308
+ code : `import { useResizeObserver} from '@primer/react/lib-esm/hooks/useResizeObserver'` ,
295
309
output : `import {useResizeObserver} from '@primer/react'` ,
296
310
errors : [
297
311
{
@@ -305,7 +319,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
305
319
306
320
// @primer /react/lib-esm/hooks/useProvidedRefOrCreate
307
321
{
308
- code : `import useProvidedRefOrCreate from '@primer/react/lib-esm/hooks/useProvidedRefOrCreate'` ,
322
+ code : `import { useProvidedRefOrCreate} from '@primer/react/lib-esm/hooks/useProvidedRefOrCreate'` ,
309
323
output : `import {useProvidedRefOrCreate} from '@primer/react'` ,
310
324
errors : [
311
325
{
@@ -319,7 +333,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
319
333
320
334
// @primer /react/lib-esm/hooks/useResponsiveValue
321
335
{
322
- code : `import useResponsiveValue from '@primer/react/lib-esm/hooks/useResponsiveValue'` ,
336
+ code : `import { useResponsiveValue} from '@primer/react/lib-esm/hooks/useResponsiveValue'` ,
323
337
output : `import {useResponsiveValue} from '@primer/react'` ,
324
338
errors : [
325
339
{
0 commit comments