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

📎 Accept files for --config-path and BIOME_CONFIG_PATH #2265

Closed
Conaclos opened this issue Apr 1, 2024 · 6 comments · Fixed by #2419 or #2414
Closed

📎 Accept files for --config-path and BIOME_CONFIG_PATH #2265

Conaclos opened this issue Apr 1, 2024 · 6 comments · Fixed by #2419 or #2414
Assignees
Labels
A-CLI Area: CLI A-Project Area: project

Comments

@Conaclos
Copy link
Member

Conaclos commented Apr 1, 2024

Description

See some context in #2240.

For now, the value of the CLI option -config-path and the env variable BIOME_CONFIG_PATH must be a directory that contains a Biome configuration file. This is confusing for users that expect to diretcly point to a configuration file.

To improve user experience, we should also accept a Biome configuration file as value. This change is backward compatible because a user can still specify a directory.

@Conaclos Conaclos added A-CLI Area: CLI A-Project Area: project labels Apr 1, 2024
@ematipico
Copy link
Member

Since this isn't clear enough, unless someone reads the original discussion, files must be biome.json or biome.jsonc. Other file names won't be accepted (even the old rome.json)

@Conaclos
Copy link
Member Author

Conaclos commented Apr 3, 2024

Since this isn't clear enough, unless someone reads the original discussion, files must be biome.json or biome.jsonc. Other file names won't be accepted (even the old rome.json)

Thanks for the clarification.
This makes me think a second time about that: Because we accept any filename in the extends field in a Biome configuration, this could make sense of accepting any filename as value of this option?

@ematipico ematipico changed the title 📎 Accept files for -config-path and BIOME_CONFIG_PATH 📎 Accept files for --config-path and BIOME_CONFIG_PATH Apr 3, 2024
@ematipico
Copy link
Member

Yeah I can see your point

@nhedger
Copy link
Member

nhedger commented Apr 3, 2024

I also think that we should allow any file name, as it would allow users to store multiple configuration variants in the same folder under different names.

@fb55
Copy link

fb55 commented Apr 11, 2024

To add to this, the error message for a bad --config-path still references a rome.json:

% pnpm biome check --apply-unsafe --config-path=asdf/biome.json src/generated 
asdf/biome.json/rome.json internalError/fs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Biome couldn't read the file
  
  ✖ Biome couldn't read the following file, maybe for permissions reasons or it doesn't exists: asdf/biome.json/rome.json

@Sec-ant
Copy link
Contributor

Sec-ant commented Apr 11, 2024

Unfortunately the rome.json is a fallback file Biome will search for if it cannot find biome.json or biome.jsonc in the provided directory. But I think I can improve the error message as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI A-Project Area: project
Projects
None yet
5 participants