diff --git a/.changeset/heavy-rings-hammer.md b/.changeset/heavy-rings-hammer.md new file mode 100644 index 00000000..eade3f6f --- /dev/null +++ b/.changeset/heavy-rings-hammer.md @@ -0,0 +1,5 @@ +--- +'eslint-plugin-primer-react': patch +--- + +Update no-wildcard-imports rule to move ButtonBase to `@primer/react/experimental` diff --git a/src/rules/__tests__/no-wildcard-imports.test.js b/src/rules/__tests__/no-wildcard-imports.test.js index a6de13a3..8c730e25 100644 --- a/src/rules/__tests__/no-wildcard-imports.test.js +++ b/src/rules/__tests__/no-wildcard-imports.test.js @@ -169,8 +169,8 @@ import type {BetterSystemStyleObject} from '@primer/react/lib-esm/sx'`, { code: `import {ButtonBase} from '@primer/react/lib-esm/Button/ButtonBase'; import type {ButtonBaseProps} from '@primer/react/lib-esm/Button/ButtonBase'`, - output: `import {ButtonBase} from '@primer/react' -import {type ButtonBaseProps} from '@primer/react'`, + output: `import {ButtonBase} from '@primer/react/experimental' +import {type ButtonBaseProps} from '@primer/react/experimental'`, errors: [ { messageId: 'wildcardMigration', @@ -188,7 +188,7 @@ import {type ButtonBaseProps} from '@primer/react'`, }, { code: `import type {ButtonBaseProps} from '@primer/react/lib-esm/Button/types'`, - output: `import {type ButtonBaseProps} from '@primer/react'`, + output: `import {type ButtonBaseProps} from '@primer/react/experimental'`, errors: [ { messageId: 'wildcardMigration', diff --git a/src/rules/no-wildcard-imports.js b/src/rules/no-wildcard-imports.js index 36425594..c9c7eba4 100644 --- a/src/rules/no-wildcard-imports.js +++ b/src/rules/no-wildcard-imports.js @@ -10,11 +10,11 @@ const wildcardImports = new Map([ { type: 'type', name: 'ButtonBaseProps', - from: '@primer/react', + from: '@primer/react/experimental', }, { name: 'ButtonBase', - from: '@primer/react', + from: '@primer/react/experimental', }, ], ], @@ -24,7 +24,7 @@ const wildcardImports = new Map([ { type: 'type', name: 'ButtonBaseProps', - from: '@primer/react', + from: '@primer/react/experimental', }, ], ],