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

Astro Language Server and Prettier #11313

Open
matadaniel opened this issue Mar 27, 2025 · 1 comment
Open

Astro Language Server and Prettier #11313

matadaniel opened this issue Mar 27, 2025 · 1 comment

Comments

@matadaniel
Copy link

📚 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

Prettier is a popular formatter for JavaScript, HTML, CSS, and more. If you’re using the Astro VS Code Extension or the Astro language server within another editor, code formatting with Prettier is included.

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 in Neovim until I installed prettier and prettier-plugin-astro as dependencies.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

@gsong
Copy link

gsong commented Apr 1, 2025

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 prettier and biome (both of which can format .astro files), so you can be sure to use the exact version for that specific project.

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

No branches or pull requests

2 participants