Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
Interesting! CI is unhappy, but exciting nonetheless 😃 This does essentially what https://github.com/prettier/prettier-synchronized does, right? I tried to use it in #14311, but hit prettier/prettier-synchronized#4 (comment) |
Yes! (Except for a little non-public API🤦♂️) cc @fisker Do you have any suggestions? Also I found out that the E2E tests are using Prettier 3, which means as long as the CI is green, everything should be fine. |
bedb87e to
ce00c5b
Compare
ce00c5b to
a1ce469
Compare
Since we removed custom parser support in v3, yes, it's difficult to modify ast. I don't have a better idea. |
| writeFiles(DIR, { | ||
| 'jest.config.js': ` | ||
| module.exports = {prettierPath: require.resolve('prettier-2')}; | ||
| module.exports = {prettierPath: require.resolve('prettier')}; |
There was a problem hiding this comment.
This test should running against the prettier/index.cjs, maybe better run against prettier/index.mjs too.
There was a problem hiding this comment.
Since require will be called on the main thread anyway, I will use index.cjs.
| writeFiles(DIR, { | ||
| 'jest.config.js': ` | ||
| module.exports = {prettierPath: require.resolve('prettier-2')}; | ||
| module.exports = {prettierPath: require.resolve('prettier/index.cjs')}; |
There was a problem hiding this comment.
This is @fisker 's suggestion, perhaps to avoid unexpected use of Prettier 2?
There was a problem hiding this comment.
Actually I mean both index.cjs and index.mjs both should be tested, since user can pass prettier path.
There was a problem hiding this comment.
We use require to load it, so ESM will fail
There was a problem hiding this comment.
The debug apis was actually missing in commonjs version at first, I added in prettier/prettier#13731
There was a problem hiding this comment.
We use
requireto load it, so ESM will fail
Al right, didn't know.
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Support Prettier 3
Fixes: #14305
Closes #14311
Test plan
CI green
I tried adding tests, but I failed when importing ESM's prettier.
In addition, the
importinworker_threadsmay be complicated.