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 spacing for TS trick in TSX to define generics #107

Open
havenchyk opened this issue Jan 14, 2020 · 2 comments
Open

Fix spacing for TS trick in TSX to define generics #107

havenchyk opened this issue Jan 14, 2020 · 2 comments
Labels

Comments

@havenchyk
Copy link
Contributor

There is a trick how to force parser to think it's a generic and not TSX code in .tsx file
typescript-eslint/typescript-eslint#1457

prettierx removes space after comma at <T,>: const MyComponent = <T, >({x, y, z}: Props<T>) => {…}, eslint standard config on the other hand expects this space.

Probably it can be an issue at prettier-standard instead, but I don't see an option to configure having this space only for generics

@brodybits
Copy link
Owner

Thanks. I think this should also be tracked on prettier-standard.

According to microsoft/TypeScript#15713 (comment), that trick should not be needed on Babylon (Babel) or Flow parsers. I am actually planning to switch prettierx to use Babel's parser for TypeScript by default (see #54) once they are finished with prettier/prettier#6400.

@havenchyk
Copy link
Contributor Author

havenchyk commented Apr 30, 2020

this one is done actually prettier/prettier#6400

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

No branches or pull requests

2 participants