Skip to content

Commit 4c3643c

Browse files
authored
docs: JS type hinting for the configuration (#11110)
1 parent 64d5983 commit 4c3643c

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

docs/Configuration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ Or through JavaScript:
1919
```js
2020
// jest.config.js
2121
// Sync object
22-
module.exports = {
22+
/** @type {import('@jest/types').Config.InitialOptions} */
23+
const config = {
2324
verbose: true,
2425
};
2526

27+
module.exports = config;
28+
2629
// Or async function
2730
module.exports = async () => {
2831
return {

website/versioned_docs/version-25.x/Configuration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ Or through JavaScript:
1818

1919
```js
2020
// jest.config.js
21-
module.exports = {
21+
/** @type {import('@jest/types').Config.InitialOptions} */
22+
const config = {
2223
verbose: true,
2324
};
25+
26+
module.exports = config;
2427
```
2528

2629
Please keep in mind that the resulting configuration must be JSON-serializable.

website/versioned_docs/version-26.x/Configuration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ Or through JavaScript:
1919
```js
2020
// jest.config.js
2121
// Sync object
22-
module.exports = {
22+
/** @type {import('@jest/types').Config.InitialOptions} */
23+
const config = {
2324
verbose: true,
2425
};
2526

27+
module.exports = config;
28+
2629
// Or async function
2730
module.exports = async () => {
2831
return {

0 commit comments

Comments
 (0)