Skip to content

Commit 808e702

Browse files
committed
fix(docs): update JavaScript setup instructions to include globals for ESLint
1 parent 80f636e commit 808e702

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apps/website/content/docs/getting-started/javascript.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ description: Getting started with JavaScript setup
66
## Install
77

88
```package-install copy
9-
npm install --save-dev eslint @eslint/js @eslint-react/eslint-plugin
9+
npm install --save-dev globals eslint @eslint/js @eslint-react/eslint-plugin
1010
```
1111

1212
## Setup
1313

1414
```js title="eslint.config.js"
15+
import globals from "globals";
1516
import eslintJs from "@eslint/js";
1617
import eslintReact from "@eslint-react/eslint-plugin";
1718
import { defineConfig } from "eslint/config";
@@ -24,15 +25,16 @@ export default defineConfig([
2425
eslintReact.configs.recommended,
2526
],
2627
languageOptions: {
28+
globals: {
29+
...globals.browser
30+
}
2731
parserOptions: {
2832
ecmaFeatures: {
2933
jsx: true,
3034
},
3135
},
3236
},
3337
rules: {
34-
// Add `globals` if you need this rule
35-
"no-undef": "off",
3638
// Put rules you want to override here
3739
"@eslint-react/prefer-shorthand-boolean": "warn",
3840
},

0 commit comments

Comments
 (0)