-
Notifications
You must be signed in to change notification settings - Fork 568
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
Handle Webpack and Prettier breaking changes #3103
Conversation
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
e269bab
to
68360e6
Compare
const config = await resolveConfig(path, { | ||
editorconfig: true, | ||
}); | ||
|
||
const formattedManifest = format(data, { | ||
...config, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-standalone version uses top-level await to import the ESM bundle, it seems. That unfortunately breaks unless we use an experimental Node.js flag. The easiest solution for now seems to be to remove support for a custom Prettier config.
68360e6
to
31870a7
Compare
|
||
const formattedManifest = format(data, { | ||
...config, | ||
const formattedManifest = await format(data, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should just use Prettier 2 instead since we are forced to keep it around for now anyways?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the ESLint 9 changes we need to bump to Prettier 3 as well. We could keep Prettier 2 around for this specifically, but I don't think it would be able to load Prettier 3 configs 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant since we are forced to keep it for Jest. What would the downside be of the CLI still using Prettier 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would the downside be of the CLI still using Prettier 2?
That it won't be able to load Prettier 3 configs 😅 I assume Snaps will want to update to ESLint 9, Prettier 3, etc. as well, so I'm not sure if there's a benefit to keeping Prettier 2 around.
This updates the CLI and Webpack plugin to handle breaking changes following the bump required for ESLint 9. Unfortunately Prettier 3 makes it very complicated to load configuration files with CJS, since it loads the ESM bundle using a top-level await, which is not supported by Node.js without additional experimental parameters. For now I've removed the functionality for custom Prettier configs, but we can reconsider this in the future (i.e., through specifying a Prettier path in the CLI config, or allowing to provide the options directly).
This updates the CLI and Webpack plugin to handle breaking changes following the bump required for ESLint 9.
Unfortunately Prettier 3 makes it very complicated to load configuration files with CJS, since it loads the ESM bundle using a top-level await, which is not supported by Node.js without additional experimental parameters. For now I've removed the functionality for custom Prettier configs, but we can reconsider this in the future (i.e., through specifying a Prettier path in the CLI config, or allowing to provide the options directly).