Skip to content
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

fix(TextReplaceWithContent): update dist import path #797

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adamviktora
Copy link
Contributor

Closes #791

@@ -71,11 +71,28 @@ module.exports = {
const specifierName = specifierToReplace.imported.name;
const newText = getNewText(specifierName);

const importPath = node.source.value?.toString() as string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to do this without the type assertion? If not is this type assertion truly safe?

It seems like importPath could potentially resolve as undefined here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, technically it should always be a string starting with "@patternfly/react-core", but I'll update it so there is not the casting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Text -> Content codemod seems to not update dist import paths appropriately
3 participants