-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Add code action to format with prettier in codeActionsOnSave in VS Code #1555
Comments
This would be great as my current workaround hangs a little when working on bigger projects. |
Please, can we have this feature ? See related API: https://code.visualstudio.com/api/references/vscode-api#CodeActionProvider |
I'm using https://marketplace.visualstudio.com/items?itemName=rohit-gohri.format-code-action to work around this in the meantime. |
@jtanner This is what I've been using too for a while and it's working well. |
Is there any update on this issue? |
Currently, this issue has the most thumbs-up emojis: https://github.com/prettier/prettier-vscode/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc If @ntotten or any other developer of the project could please share their thoughts on this request, then others in this thread can appreciate a two way conversation |
I'm not going to work on this any time soon, but happy to accept a PR. |
@bhajneet I have an one question. Which an action do you want?
I have a feeling you are requesting about 1, but I have a feeling the commenters are requesting about 2. BTW, a code action like "Prettier: Format Document" exists in this extension. prettier-vscode/package.nls.json Line 3 in 991a53f
|
@roottool What you are mentioning is the definition of the command exposed on the command palette.
|
Thank you for teaching me! I was able to create PR for this issue by your comment. |
Mark up |
Originally posted by @rohit-gohri in #1277 (comment) is a working solution for running prettier before eslint.
The above solution runs the default formatter (which can be set to Prettier) then uses the code action for eslint afterwards.
There is already one example of a code action to create a config file in this extension.
Could a code action be added for formatting? Such that if a user were to hit ctrl+shift+p in VS Code it would show something like "Prettier: Format Document"
Here are examples from Microsoft
The text was updated successfully, but these errors were encountered: