-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
External binary formatter docs for Prettier sets up wrong formatter for TSX #5689
Comments
I could make the change if maintainers agree. |
I was the person who made the Helix Prettier WIKI. I think the My main concern is:
So Prettier does not support I am open to being convinced of your changes, but I don't see they are a good idea yet... |
Except they do specifically handle this case for TSX. I'm not sure what the proper way to achieve it is, but they do seem to have a TSX parser that is undocumented. |
Is there a way in the language configs to tell helix to pass the filename as an arg? |
Not yet, there is a pull request I think. I have changed the WIKI to add information about I had a quick search and nobody seems to be talking about |
That note in the wiki looks good, thanks for updating it 👍 I'll close this in favor of the issue about exposing the filename for the formatter command: #3596 Until we have that, I think the current entries ( |
In the wiki for the prettier section, the configs are listed with using the
--parser
arg to let prettier know what kind of parser to use. However, when adding an additional config for TSX, I had set upLooking through the Prettier docs there doesn't seem to be a TSX specific parser and the
typescript
parser worked well enough, except it formats the following wrongly.The trailing comma, which is required for the generic function declaration, is removed. The fix was was to instead configure prettier with the
--stdin-filename
arg instead to let Prettier decide on a parser based on the file extension.Would like to suggest the wiki page to be updated to this as it would avoid a hiccup for what I would think is a common usecase for web dev. The additional
tsx
configuration doesn't need to be included even, just having the wiki docs showing the use of--stdin-filename
would help lead readers down a path that would avoid the above issue.The text was updated successfully, but these errors were encountered: