-
Notifications
You must be signed in to change notification settings - Fork 19
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
refactor(EmptyState): extract helpers, fix(EmptyState): getElementChildText fix #602
refactor(EmptyState): extract helpers, fix(EmptyState): getElementChildText fix #602
Conversation
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.
Looking great 🔥
One question/suggestion then it should be good to go.
...ods/src/rules/v6/emptyStateHeaderMoveIntoEmptyState/emptyStateHeader-move-into-emptyState.ts
Outdated
Show resolved
Hide resolved
...rc/rules/v6/emptyStateHeaderMoveIntoEmptyState/emptyStateHeader-move-into-emptyState.test.ts
Show resolved
Hide resolved
- previously the switch would unintentionally handle most cases under JSXText, as the first few whitespaces count as JSXText of children
d884252
to
5e6ff93
Compare
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.
🚀
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.
Other than the nit LGTM! 🚀
packages/eslint-plugin-pf-codemods/src/rules/helpers/JSXAttributes.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Dominik Petřík <[email protected]>
6ae3450
to
0ec8130
Compare
Closes #594
Also applies a fix to a function which gets children text of EmptyStateHeader.
Previously, situations like this:
were caught in switch command under
JSXText
(because of the initial whitespaces before<h1>
).And if not, it ended up always being wrapped in
""
, which we don't want, if the children is not a singleJSXText
element.