-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Astro Language Server and Prettier #11313
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
Comments
I think this depends on how you set up Neovim. For example, if you're using LazyVim, I believe if you install prettier extra, it would ensure that prettier is installed via mason. That said, I always feel it's best to explicitly include dev dependencies such as |
I agree that it is best to explicitly add them as dependencies. The page content makes it sound like formatting could be provided by the language server before |
Related, I just came across this article: https://cosmicthemes.com/blog/astro-eslint-prettier-setup/ I would love for our advice to be better, but we do have to make sure that we account for everyone's setup in whatever advice we give (or at least don't make something sound like it should work for everyone, when it won't work in certain situations). I really appreciate everyone sharing here, and would like to know what people think is the right advice to give in docs! |
I personally think it's best to explicitly include Coupled with an explicit prettier config in whatever flavor you choose: https://github.com/gsong/personal-site/blob/main/.prettierrc.mjs |
📚 Subject area/topic
Astro language server
📋 Page(s) affected (or suggested, for new content)
https://docs.astro.build/en/editor-setup/
📋 Description of content that is out-of-date or incorrect
This contradicts https://github.com/withastro/language-tools/tree/df90fe5f79978b567387cc1b0cedcc23a43bd156/packages/language-server#formatting-does-not-work.
I was not able to format
Astro
files inNeovim
until I installedprettier
andprettier-plugin-astro
as dependencies.🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
No response
The text was updated successfully, but these errors were encountered: