-
Notifications
You must be signed in to change notification settings - Fork 10
use-styled-react-import: add theme components #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 4325bde The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Add ThemeProvider, BaseStyles, and useTheme to allow theme components to be imported from styled-react without sx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the use-styled-react-import
ESLint rule to handle theme-related components and utilities. The change allows ThemeProvider
and BaseStyles
components to always be imported from @primer/styled-react
regardless of whether they use the sx
prop, and adds useTheme
utility to the list of items that should be imported from styled-react.
- Added
ThemeProvider
,BaseStyles
, anduseTheme
to respective component/utility lists - Created exemption logic for theme components that should always come from styled-react
- Refactored the autofix logic to handle batch operations when moving multiple imports
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/rules/use-styled-react-import.js | Core rule implementation with new theme component handling and improved autofix logic |
src/rules/tests/use-styled-react-import.test.js | Comprehensive test cases covering new theme component behaviors |
.changeset/short-pumas-kneel.md | Changeset documentation for the minor version update |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.