diff --git a/README.md b/README.md index 8e2fb3c..6e3e1bd 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ For Node versions that support it (version 16 and above), the `es2022` environme - [Test configuration](#test-configuration) - [Typed react configuration](#typed-react-configuration) - [Global ignores](#global-ignores) + - [Globals](#globals) - [Migrating from 1.X to 2.X](#migrating-from-1x-to-2x) - [Running eslint](#running-eslint) - [Usage in an existing project](#usage-in-an-existing-project) @@ -115,6 +116,21 @@ module.exports = [ ]; ``` +### Globals + +Globals for browsers, etc. that may be needed. + +```javascript +"use strict"; + +const globals = require("@bonniernews/eslint-config/globals"); + +module.exports = [ + ...allYourGoodConfigs, + { files: "assets/scripts", languageOptions: { globals: globals.browser } } +]; +``` + ## Migrating from 1.X to 2.X 2.X introduces eslint 9 which has a different configuration format. It is recommended to read the [eslint migration guide](https://eslint.org/docs/latest/use/configure/migration-guide).