Closed iamwxq closed 10 months ago
What's the contents of d:\dev\vite-project\.eslintrc.cjs
? Does it work if you ignore that file? Due to the error message, it seems like it might be a bug in Biome.
Oh wait, I just realized this is happening for all the files for you. I will look into it.
@dsherret I have tried to ignore this file, and then it will say dprint.json
error formatting, then biome.json
error formatting, and then...
I haven't been able to reproduce this on a bunch of repos with that config. Initially I thought maybe there was an issue in the config causing the plugin to panic, but that doesn't seem to be the case.
Sorry to bother, but do you have a reproduction repo I could try out?
Also, perhaps this command might show some insight as to what's happening:
> DPRINT_MAX_THREADS=1 dprint fmt --incremental=false --log-level=debug
Should there both two exeutable CLIs in my environment? Or just only dprint enough.
You only need dprint. Dprint will run dprint-plugin-biome sandboxed in a Wasm runtime (so it has no access to the file system).
I also want to know that if I use dprint-biome-config, should I add dprint-json-config etc. too?
I'm guessing what you mean here, but if you have biome then you don't need dprint-plugin-json because biome formats json files.
@dsherret
Ok, thank you!!!
You only need dprint. Dprint will run dprint-plugin-biome sandboxed in a Wasm runtime (so it has no access to the file system).
So is there need a biome.json
in my project?
By the way, I find the reason that if I set both lineWidth
and biome
, there will be errors
Sorry to bother, but do you have a reproduction repo I could try out?
if you need, here comes: https://github.com/iamwxq/dprint-biome-repo
In fact, you just need set both lineWidth
and biome
in the dprint.json
Thanks for the information that helped to reproduce this, @iamwxq!
I have published a new version (0.2.2) with the fix and if you run dprint config update
it should automatically update your configuration file for you. It was a silly mistake I made.
So is there need a biome.json in my project?
No, since dprint runs dprint-plugin-biome in a sandboxed environment, the plugin doesn't have access to read from the file system in order to access the config. The config must be specified in the dprint.json file so that the dprint CLI can pass the configuration to the plugin. You only need to specify the url in the plugins array and then a "biome" config in the dprint.json file and everything should just work.
when I try to format with
biome
, I met some errors:shell outputs: `dprint fmt`
```shell ❯ dprint fmt Critical error formatting D:\dev\vite-project\.eslintrc.cjs. Cannot continue. Message: Originally panicked in dprint-plugin-biome, then failed reinitialize. This may be a bug in the plugin, the dprint cli is out of date, or the plugin is out of date. Original error: RuntimeError: unreachable at __rust_start_panic (dprint
andbiome
, so that they can work together. Should there both two exeutable CLIs in my environment? Or just onlydprint
enough.here comes my
dprint-biome-plugin
settings:my
dprint
version: 0.43.2 mybiome
version: 1.4.1dprint-biome-config
, should I adddprint-json-config
etc. too?Appreciate any reply!