-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC: Disable Prettier snapshot formatting (#1220)
The other option would be to revert to Prettier 2.
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
'skuba': patch | ||
--- | ||
|
||
test: Disable Prettier snapshot formatting | ||
|
||
Jest is not yet compatible with Prettier 3, causing snapshot updates to fail with the following error: | ||
|
||
```typescript | ||
TypeError: prettier.resolveConfig.sync is not a function | ||
at runPrettier (node_modules/jest-snapshot/build/InlineSnapshots.js:308:30) | ||
``` | ||
|
||
We have disabled Prettier snapshot formatting in our Jest preset as a temporary workaround. If you do not use the preset, you can manually modify your `jest.config.ts` like so: | ||
|
||
```diff | ||
export default { | ||
+ prettierPath: null, | ||
} | ||
``` | ||
|
||
You may have to run `skuba format` manually after updating snapshots until [jestjs/jest#14305](https://github.com/jestjs/jest/issues/14305) is resolved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters