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

CLI: Support TSX in storiesof-to-csf migration #11107

Closed
wants to merge 1 commit into from

Conversation

shilman
Copy link
Member

@shilman shilman commented Jun 9, 2020

Issue: #9669

What I did

Quick & dirty fix based on @Vanuan 's suggestion

How to test

Run storiesof-to-csf migration on TSX project (untested)

@@ -13,3 +13,6 @@ export const sanitizeName = (name) => {
}
return key;
};

export const prettierParser = (parser) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe jscodeshiftToPrettierParser.
And use a map:

const parserMap = {
  'babylon': 'babel',
  'flow': 'flow',
  'ts': 'typescript',
  'tsx': 'typescript'
};

return parserMap[parser] || 'babel';

@ndelangen
Copy link
Member

This doesn't add a test..

Can we add one and verify this actually works?

@shilman shilman closed this Jun 10, 2020
@ndelangen ndelangen deleted the 9669-tsx-storiesof-to-csf branch June 10, 2020 11:34
@Vanuan
Copy link
Contributor

Vanuan commented Jun 12, 2020

Is this merged? Is there a different PR?

@shilman
Copy link
Member Author

shilman commented Jun 12, 2020

@Vanuan no, i tried it out but there are more changes that need to happen and I don't have time to follow up

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

Successfully merging this pull request may close these issues.

None yet

3 participants