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

feat: validate biome.json path config #32

Merged

Conversation

victor-teles
Copy link
Contributor

This PR closes #5.

  • Now the field has support for directory and file.
  • It now validates existence os biome.json file

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure how this is going to work, but users should just pass a file name, but only the directory where the configuration is. Biome will do the rest

Comment on lines 76 to 78
companion object {
const val configName = "biome.json"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this will work in the long run. Once we allow biome.jsonc as a configuration file format, this will be outdated and will require a new version.

I'm not sure it's worth it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I'll update to a more flexible approach

@victor-teles
Copy link
Contributor Author

victor-teles commented Jan 21, 2024

I'm still not sure how this is going to work, but users should just pass a file name, but only the directory where the configuration is. Biome will do the rest

@ematipico You mean there's no need to validate the input?

Just to give you some context:
Before this PR, if the user select the biome.json file in this field, the plugin will pass the value to CLI using --config-path flag and this will result in an error: Biome couldn't read the following file, maybe for permissions reasons or it doesn't exist: /path/project/biome.json/rome.json

To fix this i now just pass the parent path: /path/project instead of /path/project/biome.json

@ematipico
Copy link
Member

Thank you, it wasn't clear from the PR description

@victor-teles victor-teles marked this pull request as ready for review January 26, 2024 19:18
@victor-teles victor-teles merged commit 64e056f into biomejs:main Feb 2, 2024
1 check passed
@victor-teles victor-teles deleted the feature/improve-config-path-ux branch February 2, 2024 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The biome.json Directory Path setting accepts file paths
2 participants