dprint / dprint-plugin-prettier

Prettier wrapper plugin for dprint.
Other
98 stars 8 forks source link

New plugin system #55

Open dsherret opened 1 year ago

dsherret commented 1 year ago

The latest dprint 0.40 adds functionality that makes this possible. Essentially, I would like to add prettier plugins, which are available at urls.

{
  "prettier": {
    "plugins": [
      "https://prettier.dprint.dev/astro-0.11.0.js",
      "https://prettier.dprint.dev/svelte-3.0.3.js"
    ]
  },
  "plugins": [
    "https://plugins.dprint.dev/prettier-0.26.6.json@0118376786f37496e41bb19dbcfd1e7214e2dc859a55035c5e54d1107b4c9c57"
  ]
}
  1. These scripts run sandboxed and do not have access to the file system or network.
  2. They are automatically upgraded when someone runs dprint config update
  3. No need to specify file extensions or associations. The plugin will provide it.
  4. Probably each plugin needs to be a single bundled javascript file in order to reduce the complexity.
adaliszk commented 5 months ago

Are the plugins hand-selected few or would auto-bundle all prettier plugins?

RafaelKr commented 1 week ago

I would love to see support for https://github.com/tailwindlabs/prettier-plugin-tailwindcss

https://tailwindcss.com/blog/automatic-class-sorting-with-prettier

Edit: maybe we also would need this, to be able to run it for .html.twig files: https://github.com/ttskch/prettier-plugin-tailwindcss-anywhere