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

[Biome] Only attach if the folder contains a biome.json #2980

Closed
willparsons opened this issue Jan 22, 2024 · 7 comments · Fixed by #2984
Closed

[Biome] Only attach if the folder contains a biome.json #2980

willparsons opened this issue Jan 22, 2024 · 7 comments · Fixed by #2984
Labels
enhancement New feature or request

Comments

@willparsons
Copy link
Contributor

Language server

biome

Requested feature

The default config for biome lets it run in any node/git folder which leads to situations where an eslint project is conflicting with biome since they're both producing lints or trying to format.

I think it makes more sense that the default configuration of biome expects that the project is actually configured to use biome, similar to how eslint works.

E.g.

return {
  root_dir = util.root_pattern "biome.json",
  single_file_support = false,
}

Other clients which have this feature

No response

@willparsons willparsons added the enhancement New feature or request label Jan 22, 2024
@justinmk
Copy link
Member

Thanks for your report. The configs in this repo are unsupported and provided only as a starting point. We depend on users (like you) to troubleshoot issues with their specific LSP setups and send improvements.

If you found a bug in the core Nvim vim.lsp module (not part of this repo), the best way to get it fixed is to report to Nvim (not nvim-lspconfig) with:

  • steps to reproduce it without the particular LSP server and other factors particular to your environment
  • (optional, but very helpful): by adding a failing test case to lsp_spec.lua, which has code to setup a fake LSP server to simulate various scenarios

@justinmk justinmk closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
@willparsons
Copy link
Contributor Author

We depend on users (like you) to troubleshoot issues with their specific LSP setups and send improvements.

I'm happy to create a PR for this, I thought I'd raise the suggestion first to see if the current behaviour was preferred.

@willparsons
Copy link
Contributor Author

#2984

I made a PR in case you're happy to include this change.

justinmk pushed a commit that referenced this issue Jan 29, 2024
)

Closes #2980

This PR adjusts the configuration for the biome LSP to only attach if there is an existing biome.json found.

This helps prevent conflicts in ESLint projects since biome would attach and start providing diagnostics and would format files which could conflict with the ESLint/Prettier rules that are defined.
@acheong08
Copy link

Is it possible to make this configurable? I don't use eslint and I would rather not have to bring javascript configuration hell to my projects which only have a tiny bit of plain javascript embedded.

@willparsons
Copy link
Contributor Author

just override it to fit your use case, it's always configurable

@kotasudhakar
Copy link

There is still an issue i am facing when there is an biome extension installed but no biome json file is there in the repo, still the biome is showing those as errors. I dont want it as in this repo i have already prettier and eslint configured

@kotasudhakar
Copy link

I am using biome extension version 1.9.2

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

Successfully merging a pull request may close this issue.

4 participants