-
Notifications
You must be signed in to change notification settings - Fork 129
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
Plugin is not loaded when using pnpm #51
Comments
Hey @brattonross thanks for reporting this. That is true, we did not test the setup with pnpm. Could you maybe send a PR to fix that issue? |
This is a valid issue. I also tried to integrate the plugin in the https://github.com/verdaccio/verdaccio. I could not manage it. We'll keep you updated if there is a solution. |
The reason is that the prettier plugins are picked automatically from the node_modules and the pnpm has a different architecture. I think this issue is out of scope of this plugin and requires discussion in the prettier project. |
Thank you for taking a look at the issue! I agree that it sounds like it is out of scope for this plugin. The prettier docs seem to suggest that you can manually specify plugins / directories to search for plugins, and although I haven't tried it myself I imagine that this could be a workaround for pnpm users. |
Inspired by simonhaenisch/prettier-plugin-organize-imports#34 (comment) module.exports = {
plugins: [
require.resolve("@trivago/prettier-plugin-sort-imports"),
],
}; |
For all, Who are using typescript. This will also work with .prettierrc.json {
"plugins": ["@trivago/prettier-plugin-sort-imports"]
} |
I can confirm this also works if the config is defined in package.json |
{
"plugins": ["@trivago/prettier-plugin-sort-imports"]
} It works ha ha. |
First, thanks for your hard work on this plugin!
When installing dependencies using pnpm and then running prettier I get the warning:
Ignored unknown option { importOrder: [...] }
.If I remove node_modules, install dependencies with npm, and then run prettier, the files are formatted as expected.
The text was updated successfully, but these errors were encountered: