From 7831acf4f7dea0b9ff9daad1a4ce5991d93bf0d3 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Mon, 9 May 2022 10:34:30 -0400 Subject: [PATCH 1/3] fix: makes referenced js files actually js --- docs/Configuration.md | 14 ++++++++------ .../versioned_docs/version-28.0/Configuration.md | 14 ++++++++------ .../versioned_docs/version-28.1/Configuration.md | 14 ++++++++------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index 466e1a55c899..2879593e39dc 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -761,17 +761,19 @@ A preset that is used as a base for Jest's configuration. A preset should point For example, this preset `foo-bar/jest-preset.js` will be configured as follows: -```json -{ - "preset": "foo-bar" +```js +/** @type { import('@jest/types').Config.InitialOptions } */ +module.exports = { + preset: 'foo-bar', } ``` Presets may also be relative to filesystem paths. -```json -{ - "preset": "./node_modules/foo-bar/jest-preset.js" +```js +/** @type { import('@jest/types').Config.InitialOptions } */ +module.exports = { + preset: './node_modules/foo-bar/jest-preset.js', } ``` diff --git a/website/versioned_docs/version-28.0/Configuration.md b/website/versioned_docs/version-28.0/Configuration.md index a8b148154fb1..7979ee9036d3 100644 --- a/website/versioned_docs/version-28.0/Configuration.md +++ b/website/versioned_docs/version-28.0/Configuration.md @@ -761,17 +761,19 @@ A preset that is used as a base for Jest's configuration. A preset should point For example, this preset `foo-bar/jest-preset.js` will be configured as follows: -```json -{ - "preset": "foo-bar" +```js +/** @type { import('@jest/types').Config.InitialOptions } */ +module.exports = { + preset: 'foo-bar', } ``` Presets may also be relative to filesystem paths. -```json -{ - "preset": "./node_modules/foo-bar/jest-preset.js" +```js +/** @type { import('@jest/types').Config.InitialOptions } */ +module.exports = { + preset: './node_modules/foo-bar/jest-preset.js', } ``` diff --git a/website/versioned_docs/version-28.1/Configuration.md b/website/versioned_docs/version-28.1/Configuration.md index 466e1a55c899..2879593e39dc 100644 --- a/website/versioned_docs/version-28.1/Configuration.md +++ b/website/versioned_docs/version-28.1/Configuration.md @@ -761,17 +761,19 @@ A preset that is used as a base for Jest's configuration. A preset should point For example, this preset `foo-bar/jest-preset.js` will be configured as follows: -```json -{ - "preset": "foo-bar" +```js +/** @type { import('@jest/types').Config.InitialOptions } */ +module.exports = { + preset: 'foo-bar', } ``` Presets may also be relative to filesystem paths. -```json -{ - "preset": "./node_modules/foo-bar/jest-preset.js" +```js +/** @type { import('@jest/types').Config.InitialOptions } */ +module.exports = { + preset: './node_modules/foo-bar/jest-preset.js', } ``` From 49a5861440da94c817163cdf8e15255cdfc8073e Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Fri, 6 May 2022 10:00:08 -0400 Subject: [PATCH 2/3] adds infobox for rootdir affecting preset resolution --- docs/Configuration.md | 6 ++++++ website/versioned_docs/version-28.0/Configuration.md | 6 ++++++ website/versioned_docs/version-28.1/Configuration.md | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/docs/Configuration.md b/docs/Configuration.md index 2879593e39dc..0b829bfeb1db 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -777,6 +777,12 @@ module.exports = { } ``` +:::info + +Note that if you also have specified [`rootDir`](#rootdir-string) that the resolution of this file will be relative to that root directory. + +::: + ### `prettierPath` \[string] Default: `'prettier'` diff --git a/website/versioned_docs/version-28.0/Configuration.md b/website/versioned_docs/version-28.0/Configuration.md index 7979ee9036d3..f930abb49536 100644 --- a/website/versioned_docs/version-28.0/Configuration.md +++ b/website/versioned_docs/version-28.0/Configuration.md @@ -777,6 +777,12 @@ module.exports = { } ``` +:::info + +Note that if you also have specified [`rootDir`](#rootdir-string) that the resolution of this file will be relative to that root directory. + +::: + ### `prettierPath` \[string] Default: `'prettier'` diff --git a/website/versioned_docs/version-28.1/Configuration.md b/website/versioned_docs/version-28.1/Configuration.md index 2879593e39dc..0b829bfeb1db 100644 --- a/website/versioned_docs/version-28.1/Configuration.md +++ b/website/versioned_docs/version-28.1/Configuration.md @@ -777,6 +777,12 @@ module.exports = { } ``` +:::info + +Note that if you also have specified [`rootDir`](#rootdir-string) that the resolution of this file will be relative to that root directory. + +::: + ### `prettierPath` \[string] Default: `'prettier'` From e0e676fa3e4baed9c95f8fa97385b704aea5a11e Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Fri, 13 May 2022 09:28:45 +0200 Subject: [PATCH 3/3] prettier --- docs/Configuration.md | 4 ++-- website/versioned_docs/version-28.0/Configuration.md | 4 ++-- website/versioned_docs/version-28.1/Configuration.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index 0b829bfeb1db..d0e451c508f1 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -765,7 +765,7 @@ For example, this preset `foo-bar/jest-preset.js` will be configured as follows: /** @type { import('@jest/types').Config.InitialOptions } */ module.exports = { preset: 'foo-bar', -} +}; ``` Presets may also be relative to filesystem paths. @@ -774,7 +774,7 @@ Presets may also be relative to filesystem paths. /** @type { import('@jest/types').Config.InitialOptions } */ module.exports = { preset: './node_modules/foo-bar/jest-preset.js', -} +}; ``` :::info diff --git a/website/versioned_docs/version-28.0/Configuration.md b/website/versioned_docs/version-28.0/Configuration.md index f930abb49536..bedcb2b75463 100644 --- a/website/versioned_docs/version-28.0/Configuration.md +++ b/website/versioned_docs/version-28.0/Configuration.md @@ -765,7 +765,7 @@ For example, this preset `foo-bar/jest-preset.js` will be configured as follows: /** @type { import('@jest/types').Config.InitialOptions } */ module.exports = { preset: 'foo-bar', -} +}; ``` Presets may also be relative to filesystem paths. @@ -774,7 +774,7 @@ Presets may also be relative to filesystem paths. /** @type { import('@jest/types').Config.InitialOptions } */ module.exports = { preset: './node_modules/foo-bar/jest-preset.js', -} +}; ``` :::info diff --git a/website/versioned_docs/version-28.1/Configuration.md b/website/versioned_docs/version-28.1/Configuration.md index 0b829bfeb1db..d0e451c508f1 100644 --- a/website/versioned_docs/version-28.1/Configuration.md +++ b/website/versioned_docs/version-28.1/Configuration.md @@ -765,7 +765,7 @@ For example, this preset `foo-bar/jest-preset.js` will be configured as follows: /** @type { import('@jest/types').Config.InitialOptions } */ module.exports = { preset: 'foo-bar', -} +}; ``` Presets may also be relative to filesystem paths. @@ -774,7 +774,7 @@ Presets may also be relative to filesystem paths. /** @type { import('@jest/types').Config.InitialOptions } */ module.exports = { preset: './node_modules/foo-bar/jest-preset.js', -} +}; ``` :::info