-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
ignores shared biome config in git hook commands in monorepo
#47
Comments
re the first issue: I'm not getting it. The shared config suggests spaces should be used for indentation and |
Right... Then it really boils down to pre-commit git hook And now when I'm testing it, I'm even more confused: I'm not really sure why the Here is a commit that fails the Reproduction
|
Now that I'm re-reading the reproduction steps... I think I know what is happening 🤔
|
I saw biomejs/biome#2080 the other day so waited for Based on the comments it looks like there is a common misconception that I think should be mentioned in the docs. I will allow myself to summon @ematipico due to this comment: biomejs/biome#2080 (comment)
This sentence is quite concerning because that indicates that with the setup above you can't have biome (that respects your rules) in git hooks - am I reading it correctly? And if so, contrary to eslint/prettier setups, |
biome ci
ignore shared config formatter rules?biome
ignores shared biome config in git hook commands in monorepo
To address my comment, should my understanding be correct:
If I could propose a change (happy to contribute), it would involve splitting the big projects page into two categories: one for projects that don't have git hooks (as per the current version of the docs) and one for those that do. For this, we would need to make a small change in the docs to reflect the tree structure. Current tree:
Proposed tree for category with git hooks:
|
It is exactly this. There are some related discussions on the topic, like biomejs/biome#1573 . It seems that it isn't entirely trivial to solve given the current code structure (due to potential performance tradeoffs, among other details), so it needs some thinking and discussion. |
Edit: Referencing this issue for visibility in biomejs/biome#2228 in order to help track down any related issues should this be resolved/supported.
Environment information
What happened?
It's a little bit hard to replicate my setup with the playground links due to the shared config package and
ci
nature.Example run in ci: https://github.com/exile-watch/nucleus/actions/runs/8441346324/job/23120305017#step:2:252
Here is the shared config: https://github.com/exile-watch/splinters/blob/main/packages/biome-config/biome.json#L30-L34
Here is how it's utilized: https://github.com/exile-watch/nucleus/blob/main/packages/encounter-data/biome.json
And here is a package json that has tabs instead of spaces: https://github.com/exile-watch/nucleus/blob/main/packages/encounter-data/package.json
Locally everything is passing when i go with
npm run format
ornpm run lint
but for some reason theci
command failsAnother potential issue I've noticed, though this one is with pre-commit git hooks, is that the recipe command in biomejs.dev site is resetting any
format
/lint --apply
changes (which also gives an indication of somewhat ignoring some rules from shared config)this one in particular, but I can "easily" bypass that by changing the run script to
npm run lint
so it can respect my shared configExpected result
I wouldn't expect indent errors to appear in
ci
.Code of Conduct
The text was updated successfully, but these errors were encountered: