diff --git a/docs/src/use/configure/language-options.md b/docs/src/use/configure/language-options.md index 9b0b661cbb15..687cbbf285c0 100644 --- a/docs/src/use/configure/language-options.md +++ b/docs/src/use/configure/language-options.md @@ -143,3 +143,21 @@ export default [ } ]; ``` + +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/): + +```js +// eslint.config.js +import globals from "globals"; + +export default [ + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.jest + } + } + } +]; +``` diff --git a/docs/src/use/configure/migration-guide.md b/docs/src/use/configure/migration-guide.md index f1701e8483b2..ced485f351e8 100644 --- a/docs/src/use/configure/migration-guide.md +++ b/docs/src/use/configure/migration-guide.md @@ -314,6 +314,7 @@ For example, here's an eslintrc file with language options: module.exports = { env: { browser: true, + node: true }, globals: { myCustomGlobal: "readonly", @@ -340,6 +341,7 @@ export default [ sourceType: "module", globals: { ...globals.browser, + ...globals.node, myCustomGlobal: "readonly" } }