Skip to content

Commit f61f40d

Browse files
authored
docs: Update globals examples (#18805)
* docs: Update globals examples fixes #18803 * Fix example
1 parent e112642 commit f61f40d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/src/use/configure/language-options.md

+18
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,21 @@ export default [
143143
}
144144
];
145145
```
146+
147+
You can include multiple different collections of globals in the same way. The following example includes globals both for web browsers and for [Jest](https://jestjs.io/):
148+
149+
```js
150+
// eslint.config.js
151+
import globals from "globals";
152+
153+
export default [
154+
{
155+
languageOptions: {
156+
globals: {
157+
...globals.browser,
158+
...globals.jest
159+
}
160+
}
161+
}
162+
];
163+
```

docs/src/use/configure/migration-guide.md

+2
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ For example, here's an eslintrc file with language options:
314314
module.exports = {
315315
env: {
316316
browser: true,
317+
node: true
317318
},
318319
globals: {
319320
myCustomGlobal: "readonly",
@@ -340,6 +341,7 @@ export default [
340341
sourceType: "module",
341342
globals: {
342343
...globals.browser,
344+
...globals.node,
343345
myCustomGlobal: "readonly"
344346
}
345347
}

0 commit comments

Comments
 (0)