-
-
Notifications
You must be signed in to change notification settings - Fork 498
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 check" result differs according to path depth #2080
Comments
I am not sure what the issue is. Can you please provide more information? The playground alone doesn't really help |
Thanks for your fast response. I try it with a step-by-step example... Step 1: I have a file with following content: const getWrapper = (options: GetWrapperProps = {}) => {
const { entry, activeDialog, multiSelection } = options;
return ({ children }): ReactElement => (
<TestBaseProvider>
<DialogContext.Provider value={{ closeDialog: closeDialogMock, activeDialog }}>
{multiSelection ? (
children
) : (
<EntryContext.Provider value={{ entry, setEntry: vi.fn() }}>{children}</EntryContext.Provider>
)}
</DialogContext.Provider>
</TestBaseProvider>
);
}; Step 2: Using "biome check ./src --apply" the file was changes to: const getWrapper2 = (options: GetWrapperProps = {}) => {
const { entry, activeDialog, multiSelection } = options;
return ({ children }): ReactElement => (
<TestBaseProvider>
<DialogContext.Provider value={{ closeDialog: closeDialogMock, activeDialog }}>
{multiSelection
? children
: <EntryContext.Provider value={{ entry, setEntry: vi.fn() }}>{children}</EntryContext.Provider>}
</DialogContext.Provider>
</TestBaseProvider>
);
}; Step 3: Using "biome check ./src/subdir --apply" or "biome check ./src/path/to/file.tsx" (also used by JetBrains IntellJ Biome-plugin on save) the files changes back to: const getWrapper = (options: GetWrapperProps = {}) => {
const { entry, activeDialog, multiSelection } = options;
return ({ children }): ReactElement => (
<TestBaseProvider>
<DialogContext.Provider value={{ closeDialog: closeDialogMock, activeDialog }}>
{multiSelection ? (
children
) : (
<EntryContext.Provider value={{ entry, setEntry: vi.fn() }}>{children}</EntryContext.Provider>
)}
</DialogContext.Provider>
</TestBaseProvider>
);
}; Its looks like "biome check ./src/subdir" prefers: {multiSelection ? (
children
) : (
<EntryContext.Provider value={{ entry, setEntry: vi.fn() }}>{children}</EntryContext.Provider>
)} while "biome check ./src" prefers: {multiSelection
? children
: <EntryContext.Provider value={{ entry, setEntry: vi.fn() }}>{children}</EntryContext.Provider>} Edit: Adjusted examples based on new knowledge from #2080 (comment) |
Running into the same issue 😅 |
Thank you @bc-m! That's definitely a weird issue |
It gets even stranger... When i execute {multiSelection
? children
: <EntryContext.Provider value={{ entry, setEntry: vi.fn() }}>{children}</EntryContext.Provider>} When i execute {multiSelection ? (
children
) : (
<EntryContext.Provider value={{ entry, setEntry: vi.fn() }}>{children}</EntryContext.Provider>
)} This is why our git-commit-hook and the intellj biome-plugin change the file to the second format. Then our CI fails because it expects the first format. |
When dealing with monorepos, it seems that the command Regarding the issue you’re experiencing, may I assume that you aren’t utilizing a monorepo or multiple configuration files? Could you please share your biome configuration with us? |
@mrljsh Biome doesn't support child configurations. Feel free to check the discussions to add your take about monorepos. |
Really? What is this guide about then? https://biomejs.dev/guides/big-projects/ |
The guide explains to have a command in each package, NOT in the root. You can't do both, which is what you're trying to do. I am not sure how your project is set up, but if each package has its own We have some planned tasks to improve LSP workspaces (they aren't package manager workspaces/monorepos). For package manager workspaces/monorepos, we still need to design few things in order to make things working both in the CLI and LSP. |
We experience the same issue, with a single
Code is a jsx ternary every time. Like this: - {AppWrapper
- ? <AppWrapper>
- <App {... product} />
- </AppWrapper>}
- : <AppWrapper {...product} />
+ {AppWrapper ? (
+ <AppWrapper>
+ <App {... product} />
+ </AppWrapper>
+ ) : (
+ <App {... product) />
+ )} |
Is there any chance someone who experiences the issue can share a minimal reproduction? It suspect the cause of the issue is caused by how we use |
Can anyone check if |
Still an issue. I try to create an minimal reproduction for you. |
Here you go:
|
Environment information
Playground link
https://biomejs.dev/playground/?lineWidth=120&code=LwAvACAAcgBlAHMAdQBsAHQAIABhAGYAdABlAHIAIABiAGkAbwBtAGUAIABmAG8AcgBtAGEAdAAKAGMAbwBuAHMAdAAgAGcAZQB0AFcAcgBhAHAAcABlAHIAIAA9ACAAKABvAHAAdABpAG8AbgBzADoAIABHAGUAdABXAHIAYQBwAHAAZQByAFAA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ByACAAdgBhAGwAdQBlAD0AewB7ACAAZQBuAHQAcgB5ACwAIABzAGUAdABFAG4AdAByAHkAOgAgAHYAaQAuAGYAbgAoACkAIAB9AH0APgB7AGMAaABpAGwAZAByAGUAbgB9ADwALwBFAG4AdAByAHkAQwBvAG4AdABlAHgAdAAuAFAAcgBvAHYAaQBkAGUAcgA%2BAH0ACgAgACAAIAAgACAAIAA8AC8ARABpAGEAbABvAGcAQwBvAG4AdABlAHgAdAAuAFAAcgBvAHYAaQBkAGUAcgA%2BAAoAIAAgACAAIAA8AC8AVABlAHMAdABCAGEAcwBlAFAAcgBvAHYAaQBkAGUAcgA%2BAAoAIAAgACkAOwAKAH0AOwA%3D
Expected result
biome check
should format file likebiome format
.Code of Conduct
The text was updated successfully, but these errors were encountered: