Add support for configuring global Prettier plugins via prettier.plugins
This PR introduces a new prettier.plugins setting in settings.json that allows for the automatic download and use of global Prettier plugins. This makes it easier to use Prettier with languages it doesn't support out of the box, without needing a package.json or local npm setup. It also simplifies quick one-off edits, allowing you to open a file, format it, and move on without additional configuration.
See #2828
- [x] Run tests
- [x] Update the
CHANGELOG.mdwith a summary of your changes
I tried installing a build of this PR but could not getting it to work properly. Plugins did not resolve as defined in the .prettierrc file for some reason.
What i am looking for is a way to use globally installed plugins. For example for non JS projects where we don't want a node_modules folder or package.json.
Ideally we could install prettier and plugins globally and then simply use them in the .prettierrc file. So far i could not get this to work properly. I can define the prettier.prettierPath to point to my globally installed prettier but the plugins are not resolved. Event with prettier.resolveGlobalModules set it does not load the plugins.
One workaround i found is to define the absolute paths to the plugins but that is ugly and does not work well across different OSes.
plugins:
- "/Users/foo/.local/share/mise/installs/node/latest/lib/node_modules/prettier-plugin-java/dist/index.js"