@@ -30,7 +30,7 @@ ruleTester.run('no-wildcard-imports', rule, {
30
30
// Test type import
31
31
{
32
32
code : `import type {SxProp} from '@primer/react/lib-esm/sx'` ,
33
- output : `import type { SxProp} from '@primer/react'` ,
33
+ output : `import { type SxProp} from '@primer/react'` ,
34
34
errors : [
35
35
{
36
36
messageId : 'wildcardMigration' ,
@@ -44,7 +44,7 @@ ruleTester.run('no-wildcard-imports', rule, {
44
44
// Test multiple type imports
45
45
{
46
46
code : `import type {BetterSystemStyleObject, SxProp, BetterCssProperties} from '@primer/react/lib-esm/sx'` ,
47
- output : `import type { BetterSystemStyleObject, SxProp, BetterCssProperties} from '@primer/react'` ,
47
+ output : `import { type BetterSystemStyleObject, type SxProp, type BetterCssProperties} from '@primer/react'` ,
48
48
errors : [
49
49
{
50
50
messageId : 'wildcardMigration' ,
@@ -58,7 +58,7 @@ ruleTester.run('no-wildcard-imports', rule, {
58
58
// Test import alias
59
59
{
60
60
code : `import type {SxProp as RenamedSxProp} from '@primer/react/lib-esm/sx'` ,
61
- output : `import type { SxProp as RenamedSxProp} from '@primer/react'` ,
61
+ output : `import { type SxProp as RenamedSxProp} from '@primer/react'` ,
62
62
errors : [
63
63
{
64
64
messageId : 'wildcardMigration' ,
@@ -108,7 +108,7 @@ ruleTester.run('no-wildcard-imports', rule, {
108
108
// Test renamed wildcard imports
109
109
{
110
110
code : `import type {ItemProps} from '@primer/react/lib-esm/deprecated/ActionList/Item'` ,
111
- output : `import type { ActionListItemProps as ItemProps} from '@primer/react/deprecated'` ,
111
+ output : `import { type ActionListItemProps as ItemProps} from '@primer/react/deprecated'` ,
112
112
errors : [
113
113
{
114
114
messageId : 'wildcardMigration' ,
@@ -137,7 +137,8 @@ ruleTester.run('no-wildcard-imports', rule, {
137
137
{
138
138
code : `import {Box, type BoxProps} from '@primer/react'
139
139
import type {BetterSystemStyleObject} from '@primer/react/lib-esm/sx'` ,
140
- output : `import {Box, type BoxProps, type BetterSystemStyleObject} from '@primer/react'` ,
140
+ output : `import {Box, type BoxProps, type BetterSystemStyleObject} from '@primer/react'
141
+ ` ,
141
142
errors : [
142
143
{
143
144
messageId : 'wildcardMigration' ,
@@ -169,7 +170,7 @@ import type {BetterSystemStyleObject} from '@primer/react/lib-esm/sx'`,
169
170
code : `import {ButtonBase} from '@primer/react/lib-esm/Button/ButtonBase';
170
171
import type {ButtonBaseProps} from '@primer/react/lib-esm/Button/ButtonBase'` ,
171
172
output : `import {ButtonBase} from '@primer/react'
172
- import type { ButtonBaseProps} from '@primer/react'` ,
173
+ import { type ButtonBaseProps} from '@primer/react'` ,
173
174
errors : [
174
175
{
175
176
messageId : 'wildcardMigration' ,
@@ -187,7 +188,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
187
188
} ,
188
189
{
189
190
code : `import type {ButtonBaseProps} from '@primer/react/lib-esm/Button/types'` ,
190
- output : `import type { ButtonBaseProps} from '@primer/react'` ,
191
+ output : `import { type ButtonBaseProps} from '@primer/react'` ,
191
192
errors : [
192
193
{
193
194
messageId : 'wildcardMigration' ,
@@ -223,7 +224,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
223
224
} ,
224
225
{
225
226
code : `import type {SelectPanelProps} from '@primer/react/lib-esm/SelectPanel/SelectPanel'` ,
226
- output : `import type { SelectPanelProps} from '@primer/react'` ,
227
+ output : `import { type SelectPanelProps} from '@primer/react'` ,
227
228
errors : [
228
229
{
229
230
messageId : 'wildcardMigration' ,
@@ -235,7 +236,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
235
236
} ,
236
237
{
237
238
code : `import type {LabelColorOptions} from '@primer/react/lib-esm/Label/Label'` ,
238
- output : `import type { LabelColorOptions} from '@primer/react'` ,
239
+ output : `import { type LabelColorOptions} from '@primer/react'` ,
239
240
errors : [
240
241
{
241
242
messageId : 'wildcardMigration' ,
@@ -259,7 +260,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
259
260
} ,
260
261
{
261
262
code : `import type {IssueLabelTokenProps} from '@primer/react/lib-esm/Token/IssueLabelToken'` ,
262
- output : `import type { IssueLabelTokenProps} from '@primer/react'` ,
263
+ output : `import { type IssueLabelTokenProps} from '@primer/react'` ,
263
264
errors : [
264
265
{
265
266
messageId : 'wildcardMigration' ,
@@ -271,7 +272,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
271
272
} ,
272
273
{
273
274
code : `import type {TokenSizeKeys} from '@primer/react/lib-esm/Token/TokenBase'` ,
274
- output : `import type { TokenSizeKeys} from '@primer/react'` ,
275
+ output : `import { type TokenSizeKeys} from '@primer/react'` ,
275
276
errors : [
276
277
{
277
278
messageId : 'wildcardMigration' ,
@@ -283,7 +284,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
283
284
} ,
284
285
{
285
286
code : `import type {ItemProps} from '@primer/react/lib-esm/deprecated/ActionList'` ,
286
- output : `import type { ActionListItemProps as ItemProps} from '@primer/react/deprecated'` ,
287
+ output : `import { type ActionListItemProps as ItemProps} from '@primer/react/deprecated'` ,
287
288
errors : [
288
289
{
289
290
messageId : 'wildcardMigration' ,
@@ -295,7 +296,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
295
296
} ,
296
297
{
297
298
code : `import type {GroupedListProps} from '@primer/react/lib-esm/deprecated/ActionList/List'` ,
298
- output : `import type { ActionListGroupedListProps as GroupedListProps} from '@primer/react/deprecated'` ,
299
+ output : `import { type ActionListGroupedListProps as GroupedListProps} from '@primer/react/deprecated'` ,
299
300
errors : [
300
301
{
301
302
messageId : 'wildcardMigration' ,
@@ -319,7 +320,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
319
320
} ,
320
321
{
321
322
code : `import type {ItemProps} from '@primer/react/lib-esm/deprecated/ActionList/Item'` ,
322
- output : `import type { ActionListItemProps as ItemProps} from '@primer/react/deprecated'` ,
323
+ output : `import { type ActionListItemProps as ItemProps} from '@primer/react/deprecated'` ,
323
324
errors : [
324
325
{
325
326
messageId : 'wildcardMigration' ,
@@ -389,7 +390,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
389
390
} ,
390
391
{
391
392
code : `import type {ResponsiveValue} from '@primer/react/lib-esm/hooks/useResponsiveValue'` ,
392
- output : `import type { ResponsiveValue} from '@primer/react'` ,
393
+ output : `import { type ResponsiveValue} from '@primer/react'` ,
393
394
errors : [
394
395
{
395
396
messageId : 'wildcardMigration' ,
@@ -405,7 +406,7 @@ import type {ButtonBaseProps} from '@primer/react'`,
405
406
// @primer /react/lib-esm/sx
406
407
{
407
408
code : `import type {BetterSystemStyleObject, SxProp, BetterCssProperties} from '@primer/react/lib-esm/sx'` ,
408
- output : `import type { BetterSystemStyleObject, SxProp, BetterCssProperties} from '@primer/react'` ,
409
+ output : `import { type BetterSystemStyleObject, type SxProp, type BetterCssProperties} from '@primer/react'` ,
409
410
errors : [
410
411
{
411
412
messageId : 'wildcardMigration' ,
@@ -428,7 +429,5 @@ import type {ButtonBaseProps} from '@primer/react'`,
428
429
} ,
429
430
] ,
430
431
} ,
431
- ] . filter ( ( item , index ) => {
432
- return index === 7
433
- } ) ,
432
+ ] ,
434
433
} )
0 commit comments