Skip to content

Commit

Permalink
feat: add support for ResponsiveValue
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack committed Sep 24, 2024
1 parent 2f8281c commit 62e1ae8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/rules/__tests__/no-wildcard-imports.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,18 @@ import type {ButtonBaseProps} from '@primer/react'`,
},
],
},
{
code: `import type {ResponsiveValue} from '@primer/react/lib-esm/hooks/useResponsiveValue'`,
output: `import type {ResponsiveValue} from '@primer/react'`,
errors: [
{
messageId: 'wildcardMigration',
data: {
wildcardEntrypoint: '@primer/react/lib-esm/hooks/useResponsiveValue',
},
},
],
},

// Utilities ---------------------------------------------------------------

Expand Down
19 changes: 5 additions & 14 deletions src/rules/no-wildcard-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ const wildcardImports = new Map([
},
],
],
[
'@primer/react/lib-esm/Dialog',
[
{
name: 'Dialog',
from: '@primer/react/experimental',
},
{
name: 'DialogHeaderProps',
from: '@primer/react/experimental',
type: 'type',
},
],
],
[
'@primer/react/lib-esm/Dialog/Dialog',
[
Expand Down Expand Up @@ -195,6 +181,11 @@ const wildcardImports = new Map([
name: 'useResponsiveValue',
from: '@primer/react',
},
{
type: 'type',
name: 'ResponsiveValue',
from: '@primer/react',
},
],
],

Expand Down

0 comments on commit 62e1ae8

Please sign in to comment.