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.requireConfigFile Ignored When Opening Single File in VSCode #390

Open
1 of 3 tasks
LucasOe opened this issue Oct 9, 2024 · 3 comments
Open
1 of 3 tasks
Labels

Comments

@LucasOe
Copy link

LucasOe commented Oct 9, 2024

VS Code version

1.94.1

Extension version

2024.10.40751 (pre-release)

Biome version

1.9.3

Operating system

  • Windows
  • macOS
  • Linux

Description

When biome.requireConfigFile is set to true, it is expected that Biome (linter/formatter) should only be activated if a valid configuration file is present. However, this behavior is inconsistent when opening a single file in VSCode. Biome appears to be enabled automatically, even if no configuration file is present, contrary to the setting. This issue does not occur when opening a directory, where Biome correctly respects the biome.requireConfigFile setting.

I only tested this issue on the pre-release version of the Biome Extension.

Steps to reproduce

  1. Set "biome.requireConfigFile": true in your VSCode settings.
  2. Open a single file in VSCode that does not have a Biome configuration file in the current directory or any parent directories.
  3. Observe that Biome is enabled

Expected behavior

Biome should not be activated when opening a single file if no configuration file is present, respecting the "biome.requireConfigFile": true setting.

Does this issue occur when using the CLI directly?

Not sure / Not applicable

Link to a minimal reproduction

No response

Logs

No response

@nhedger
Copy link
Member

nhedger commented Oct 10, 2024

In single-file mode, there won't be a biome.json in your workspace because there is no workspace by definition. Would you expect the extension to check for a configuration file in the file's parent folder?

@LucasOe
Copy link
Author

LucasOe commented Oct 10, 2024

Would you expect the extension to check for a configuration file in the file's parent folder?

Yes, I would expect Biome to behave the same whether a file is open in a workspace or in single file mode. I think most users who enable biome.requireConfigFile only want to see Biome's lints in a project that uses it, so having the file be linted if opened in single-file mode would probably be confusing.

@ematipico
Copy link
Member

@nhedger i think we can move this issue in the main repo.

Biome LSP already accepts this configuration from the client, so Biome LSP should behave consistently, as long as the client sends this settings when reading the client configuration

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

No branches or pull requests

3 participants