From 62e1ae8979e826f2a73f13acbacdc6bbca13ec5a Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 24 Sep 2024 16:54:36 -0500 Subject: [PATCH] feat: add support for ResponsiveValue --- .../__tests__/no-wildcard-imports.test.js | 12 ++++++++++++ src/rules/no-wildcard-imports.js | 19 +++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/rules/__tests__/no-wildcard-imports.test.js b/src/rules/__tests__/no-wildcard-imports.test.js index 11c8d6b..db11f07 100644 --- a/src/rules/__tests__/no-wildcard-imports.test.js +++ b/src/rules/__tests__/no-wildcard-imports.test.js @@ -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 --------------------------------------------------------------- diff --git a/src/rules/no-wildcard-imports.js b/src/rules/no-wildcard-imports.js index b052603..e1c36b0 100644 --- a/src/rules/no-wildcard-imports.js +++ b/src/rules/no-wildcard-imports.js @@ -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', [ @@ -195,6 +181,11 @@ const wildcardImports = new Map([ name: 'useResponsiveValue', from: '@primer/react', }, + { + type: 'type', + name: 'ResponsiveValue', + from: '@primer/react', + }, ], ],