-
Notifications
You must be signed in to change notification settings - Fork 23
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
Colors codemod types #396
Colors codemod types #396
Conversation
src/codemods/__testfixtures__/colors-to-css-vars/color-as-type.output.tsx
Outdated
Show resolved
Hide resolved
I've created the colors-codemod-add-eslint-comment branch with some tries on how to add the eslint disable comment to usages of I'll have to park this for a bit due to other priorities and I've created that branch in case we want to move forward with the current solution without the comments. EDIT: I've finally had some time to implement this, the solution is in this branch/PR, so I've deleted the other one |
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.
Nice! I've added the type cleanup step to the migration guide
What:
Make the colors-to-css-vars codemod take into account
Colors
being used as a type instead of as a constant
Why:
When
Colors
was used as a type the codemod was not transforming it, which made the resulting file invalidshould be transformed to
How:
colors-to-css-vars
codemod, find usages ofColors
as a type, replace them for theReadCssColorVariable
type and add it as an importColors
is imported, so that in case it isn't we stop executing the codemodReadCssColorVariable
, I've exported the type from aessentials/index.ts
Checklist:
Closes #394