Skip to content
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

fix: handle more cases of plugin config #2119

Merged
merged 4 commits into from
Aug 10, 2023

Conversation

jasonlyu123
Copy link
Member

@jasonlyu123 jasonlyu123 commented Aug 5, 2023

#2106

Fix cases where plugins: [require('prettier-plugin-svelte')] and where plugins ['prettier-plugin-svelte'] but never installed.

There're still some cases where it would fail, like plugins: [require.resolve('prettier-plugin-svelte')] or plugins: [path.join(prcess.cwd(), 'node_modules/prettier-plugin-svelte'], but the plugin isn't installed, likely when people copy a prettier config but never pay attention to what the config actually does. Wondering if we should just show a message alert like #1763 suggested. Likely only detect errors with "Cannot find module". Or should we try to detect these two cases and fallback to using bundled version?

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
I think we should hold off from the error modal for now. Let's see if more cases come up where people see it doesn't work as expected. If there's sufficient evidence that there are still many cases which we can't detect, then yes we can do something like that - but maybe through an icon similar to prettier that turns red or sth.

@dummdidumm dummdidumm merged commit fc538b6 into sveltejs:master Aug 10, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants