Skip to content

Commit b502c07

Browse files
grostorickhanlonii
authored andcommitted
Fix: prettierPath not working via config file (jestjs#7412)
* removed default value of prettierPath from argv * updated snapshot for show_config * updated changelog * fixed wrong package name in changelog
1 parent 7a047f4 commit b502c07

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
- `[jest-haste-map]` [**BREAKING**] Recover files correctly after haste name collisions are fixed ([#7329](https://github.com/facebook/jest/pull/7329))
7676
- `[jest-haste-map]` Remove legacy condition for duplicate module detection ([#7333](https://github.com/facebook/jest/pull/7333))
7777
- `[jest-haste-map]` Fix `require` detection with trailing commas and ignore `import typeof` modules ([#7385](https://github.com/facebook/jest/pull/7385))
78+
- `[jest-cli]` Fix to set prettierPath via config file ([#7412](https://github.com/facebook/jest/pull/7412))
7879

7980
### Chore & Maintenance
8081

e2e/__tests__/__snapshots__/show_config.test.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
3636
\\"moduleNameMapper\\": {},
3737
\\"modulePathIgnorePatterns\\": [],
3838
\\"name\\": \\"[md5 hash]\\",
39-
\\"prettierPath\\": null,
39+
\\"prettierPath\\": \\"prettier\\",
4040
\\"resetMocks\\": false,
4141
\\"resetModules\\": false,
4242
\\"resolver\\": null,

packages/jest-cli/src/cli/args.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ export const options = {
425425
type: 'string',
426426
},
427427
prettierPath: {
428-
default: 'prettier',
428+
default: undefined,
429429
description: 'The path to the "prettier" module used for inline snapshots.',
430430
type: 'string',
431431
},

types/Argv.js

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export type Argv = {|
6262
outputFile: string,
6363
preset: ?string,
6464
projects: Array<string>,
65+
prettierPath: ?string,
6566
replname: ?string,
6667
resetMocks: boolean,
6768
resetModules: boolean,

0 commit comments

Comments
 (0)