Skip to content

Commit d8799be

Browse files
davidurcoantfu
andauthored
fix(eslint-plugin): add browse + node globals (#361)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
1 parent 1caed24 commit d8799be

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

packages/eslint-config/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@typescript-eslint/eslint-plugin": "^7.3.1",
3535
"@typescript-eslint/parser": "^7.3.1",
3636
"eslint-plugin-vue": "^9.23.0",
37+
"globals": "^14.0.0",
3738
"pathe": "^1.1.2",
3839
"vue-eslint-parser": "^9.4.2"
3940
},

packages/eslint-config/src/flat/configs/javascript.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
// @ts-expect-error missing types
22
import pluginESLint from '@eslint/js'
33
import type { Linter } from 'eslint'
4+
import globals from 'globals'
45

56
export default function javascript(): Linter.FlatConfig[] {
67
return [
78
{
89
name: 'eslint:recommended',
10+
languageOptions: {
11+
globals: {
12+
...globals.browser,
13+
...globals.es2021,
14+
...globals.node,
15+
document: 'readonly',
16+
navigator: 'readonly',
17+
window: 'readonly',
18+
},
19+
},
920
...pluginESLint.configs.recommended,
1021
},
1122
]

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)