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.
The
no-unnecessary-componentsrule, which is an autofixable rule that discourages unnecessary uses ofBoxandText, does not work when those components are imported from@primer/styled-react. This is because the commonisPrimerComponentutility only looks for@primer/reactand@primer/react/**.When all uses of
Boxin a file are migrated to CSS modules, theuse-styled-react-importrule will update the import and then finally theno-unnecessary-componentswill catch and autofix the component usage. But this means that if a file has some uses ofBoxwithsxand some withclassName, they won't get the autofix todivfor the migrated boxes.