AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.04k stars 214 forks source link

[Typescript pack] support biome for linter and formatter #962

Open dannd4 opened 1 month ago

dannd4 commented 1 month ago

Is your feature related to a problem?

No response

Describe the new feature

Enable biome lsp for lspconfig and null-ls when project has @biomejs/biome dependency or has biome.json

Additional context

No response

Uzaaft commented 1 month ago

Great idea! Feel free to open up a PR. :)

willparsons commented 1 month ago

I'm running into this problem at the moment with biome and eslint+prettier bumping into each other. I'll try and sort out the config on my end and then contribute it back here.

willparsons commented 1 month ago

This is a bit annoying as the 95% of use cases is that you're either in a project that uses biome OR eslint+prettier, which is fine to configure, but it's possible that some people may want something like eslint with biome for formatting or some other configuration.

There's even the argument about HOW we run the LSP. I'd say we expect it to be in the projects dependencies and invoke it via npx/yarn/pnpm biome lsp-proxy, but they COULD use mason...

Do you guys want to cover all use cases or just go for the most common one?

ammuench commented 1 month ago

I'm in two projects currently where we're using biome as the formatter and eslint as the linter while migrating a bunch of stuff.

Could we check for the existence of a biome.json config and use that to make decisions? It might be short-sighted but in my head any project where biome has "formatter": { "enabled": true } turned on I think would be the true formatter even if prettier is still in node modules somewhere, since you have to manually opt-into Biome formatting by declaring it. Same thing in reverse for "linter": { "enabled": true } (thought I can't think of many scenarios where you'd use biome as a linter and prettier as a formatter)

Uzaaft commented 1 month ago

This is a bit annoying as the 95% of use cases is that you're either in a project that uses biome OR eslint+prettier, which is fine to configure, but it's possible that some people may want something like eslint with biome for formatting or some other configuration.

There's even the argument about HOW we run the LSP. I'd say we expect it to be in the projects dependencies and invoke it via npx/yarn/pnpm biome lsp-proxy, but they COULD use mason...

Do you guys want to cover all use cases or just go for the most common one?

Go for the most common one, and install it trough mason for now.

willparsons commented 1 month ago

I've started work on this here: https://github.com/AstroNvim/astrocommunity/pull/1006/files

Having everything supported is pretty finicky :/