Skip to content

isPrimerComponent excludes components imported from @primer/styled-react #468

@iansan5653

Description

@iansan5653

The no-unnecessary-components rule, which is an autofixable rule that discourages unnecessary uses of Box and Text, does not work when those components are imported from @primer/styled-react. This is because the common isPrimerComponent utility only looks for @primer/react and @primer/react/**.

When all uses of Box in a file are migrated to CSS modules, the use-styled-react-import rule will update the import and then finally the no-unnecessary-components will catch and autofix the component usage. But this means that if a file has some uses of Box with sx and some with className, they won't get the autofix to div for the migrated boxes.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions