dprint / dprint-plugin-biome

Adapter plugin to use Biome in dprint's CLI and with JavaScript via Wasm
Other
8 stars 4 forks source link

Support for organizing imports #10

Open rubiesonthesky opened 7 months ago

rubiesonthesky commented 7 months ago

I'd like to be able to use biome's import oganizing while also formatting code otherwise. https://biomejs.dev/analyzer/

The way currently to do it, is to install biome to npm project and call it separately with npm script. Another way is to use exec plugin. I got it working with below setup. However, this does not feel optimal way. It needs to call npx to install biome and then run it through node, when biome plugin is already added to dprint setup.

  "exec": {
    "commands": [{
      "associations": [
        "src/**/*.{ts,js}"
      ],
      "command": "npx @biomejs/biome check --apply --formatter-enabled=true --linter-enabled=false --organize-imports-enabled=true {{file_path}}",
      "stdin": false
    }]
  }