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.requireConfiguration config in VSCode is missing #1943

Closed
1 task done
piotrkulpinski opened this issue Feb 29, 2024 · 12 comments · Fixed by #1946
Closed
1 task done

🐛 biome.requireConfiguration config in VSCode is missing #1943

piotrkulpinski opened this issue Feb 29, 2024 · 12 comments · Fixed by #1946
Assignees
Labels
A-Documentation Area: documentation good first issue Good for newcomers S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@piotrkulpinski
Copy link

Environment information

CLI:
  Version:                      1.5.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.9.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "bun/1.0.23"

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0

What happened?

I'm using VSCode Biome extension and I'm running some work projects that still require me to use Prettier/ESLint. I have to disable the biome extension every time I need to switch the project, otherwise they get conflicted as Biome runs even if there's no config file in the project.

This configuration seems to be missing from the latest extension version.
https://biomejs.dev/reference/vscode/#biomerequireconfiguration

CleanShot 2024-02-29 at 09 51 36

Expected result

I should not see Biome errors and biome formatter should not be working if there's no Biome config file in the workspace.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico added S-Bug-confirmed Status: report has been confirmed as a valid bug A-Documentation Area: documentation labels Feb 29, 2024
@ematipico
Copy link
Member

That's outdate. cc @nhedger

@nhedger
Copy link
Member

nhedger commented Feb 29, 2024

The requireConfiguration option was removed a while back. We’ll be introducing a new enabled option to allow you to disable the extension at the project level. Shipping it in the next version of the extension.

@piotrkulpinski
Copy link
Author

You might want to update the docs in the meantime then. Is there any other option I could use at the moment?

@ematipico
Copy link
Member

PRs are welcome :)

@nhedger
Copy link
Member

nhedger commented Feb 29, 2024

@piotrkulpinski I've just published a new pre-release (v2024.2.292020) of the extension which includes the enabled option if you want to give it a go.

@piotrkulpinski
Copy link
Author

@nhedger I can see the option, thanks! From what I understand, this is something else though. It just enable/disable the extension just like if I would enable/disable from the Extensions tab.

The old option would let me keep the ext enabled globally but disable it conditionally when no config file was found. I think Prettier has both options available.

Thanks for looking into this!

@connebs
Copy link

connebs commented Sep 3, 2024

I think an opt-in makes a lot more sense than an opt-out. Projects which support Biome formatting have a biome.json, and therefore when a file is saved or whatnot you can automatically format.

Projects which don't concern themselves with Biome shouldn't need to add a "biome.enabled": false to a VSCode config just to avoid annoyances when Biome is installed.

Is there an explanation somewhere for why this was removed?

@lgarron
Copy link

lgarron commented Dec 2, 2024

I've been super confused by this for months, and I'm just now finding this issue. I agree with @acnebs that the current behaviour is bewildering. I keep finding that Biome is causing huge unexpected diffs in projects that I never created a biome.json in, particularly since almost all projects I work on use double-spaces for indentation instead of tabs (Biome's default). These diffs can mess up PRs, history, rebasing, etc. If I'm lucky, I catch it before it ends up deep in git history.

I don't think it's reasonable to ask every project to add a .vscode/settings.json file. In particular, I don't think it's reasonable to propose adding such a file to large open-source projects. The alternative that you have to carefully juggle settings if you want to avoid committing such a config and avoid committing huge accidental changes.

I do think there's value in allowing Biome to run files without configuration, but the potential to mess up existing projects is high and requireConfiguration is the best solution for someone like me who works on a variety of projects.

@wtchnm
Copy link

wtchnm commented Dec 18, 2024

I agree with @lgarron. The requireConfiguration option should be reinstated in the VSCode extension for consistency, as it's still present in the Zed extension (see documentation). This would help streamline configuration across IDEs.

@lgarron
Copy link

lgarron commented Jan 8, 2025

This keeps catching me out. I really, really like Biome but this is becoming uncomfortable to work around.

I'm going to file a new issue with a request to reinstate this.

@lgarron
Copy link

lgarron commented Jan 8, 2025

@nhedger informed me at biomejs/biome-vscode#464 (comment) that this is resolved in the latest pre-release.

After installing it, I see a biome.requireConfigFile which does indeed prevent formatting in unconfigured workspaces for me! 🤩

@diminutivesloop
Copy link

When is this going to be promoted from pre-release? There have already been several releases since this issue was last updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Documentation Area: documentation good first issue Good for newcomers S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants