Skip to content

Commit

Permalink
document globals
Browse files Browse the repository at this point in the history
  • Loading branch information
markusn committed Feb 19, 2025
1 parent 818562a commit 8af55bc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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).
Expand Down

0 comments on commit 8af55bc

Please sign in to comment.