Skip to content

Commit

Permalink
fix(eslint-plugin): add browse + node globals (#361)
Browse files Browse the repository at this point in the history
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
davidurco and antfu committed Mar 25, 2024
1 parent 1caed24 commit d8799be
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"eslint-plugin-vue": "^9.23.0",
"globals": "^14.0.0",
"pathe": "^1.1.2",
"vue-eslint-parser": "^9.4.2"
},
Expand Down
11 changes: 11 additions & 0 deletions packages/eslint-config/src/flat/configs/javascript.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
// @ts-expect-error missing types
import pluginESLint from '@eslint/js'
import type { Linter } from 'eslint'
import globals from 'globals'

export default function javascript(): Linter.FlatConfig[] {
return [
{
name: 'eslint:recommended',
languageOptions: {
globals: {
...globals.browser,
...globals.es2021,
...globals.node,
document: 'readonly',
navigator: 'readonly',
window: 'readonly',
},
},
...pluginESLint.configs.recommended,
},
]
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d8799be

Please sign in to comment.