Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: explain how to include predefined globals #17114

Merged
merged 4 commits into from Apr 24, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/src/use/configure/configuration-files-new.md
Expand Up @@ -328,6 +328,24 @@ export default [

For historical reasons, the boolean value `false` and the string value `"readable"` are equivalent to `"readonly"`. Similarly, the boolean value `true` and the string value `"writeable"` are equivalent to `"writable"`. However, the use of older values is deprecated.

#### Using native globals variables

To enable native variables, like `console` (browser) or `$` (jQuery), you must use the `globals` package directly. For example, here is how you can add `console`, amongst other browser globals, into your configuration.
mlwyatt marked this conversation as resolved.
Show resolved Hide resolved

```js
import globals from "globals";

export default [
{
languageOptions: {
globals: {
...globals.browser,
mlwyatt marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
];
```

### Using plugins in your configuration

Plugins are used to share rules, processors, configurations, parsers, and more across ESLint projects.
Expand Down