Skip to content

Commit 8c765a9

Browse files
committed
Refactor the ESLint configuration.
1 parent d7c4fe6 commit 8c765a9

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

eslint.config.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import js from '@eslint/js'
22
import vue from 'eslint-plugin-vue'
33
import vueParser from 'vue-eslint-parser'
44
import prettierConfig from 'eslint-config-prettier'
5+
import globals from 'globals'
56

67
export default [
78
// Base ESLint recommended rules
@@ -57,15 +58,7 @@ export default [
5758
{
5859
languageOptions: {
5960
globals: {
60-
document: 'readonly',
61-
window: 'readonly',
62-
FileReader: 'readonly',
63-
FormData: 'readonly',
64-
URLSearchParams: 'readonly',
65-
localStorage: 'readonly',
66-
fetch: 'readonly',
67-
alert: 'readonly',
68-
console: 'readonly',
61+
...globals.browser,
6962
route: 'readonly'
7063
}
7164
},
@@ -76,6 +69,6 @@ export default [
7669

7770
// Ignore patterns
7871
{
79-
ignores: ['node_modules/*', 'vendor/*', 'public/*']
72+
ignores: ['node_modules/*', 'vendor/*']
8073
}
8174
]

stubs/stack-configs/eslint.config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import js from '@eslint/js'
22
import vue from 'eslint-plugin-vue'
33
import vueParser from 'vue-eslint-parser'
44
import prettierConfig from 'eslint-config-prettier'
5+
import globals from 'globals'
56

67
export default [
78
// Base ESLint recommended rules
@@ -57,15 +58,7 @@ export default [
5758
{
5859
languageOptions: {
5960
globals: {
60-
document: 'readonly',
61-
window: 'readonly',
62-
FileReader: 'readonly',
63-
FormData: 'readonly',
64-
URLSearchParams: 'readonly',
65-
localStorage: 'readonly',
66-
fetch: 'readonly',
67-
alert: 'readonly',
68-
console: 'readonly',
61+
...globals.browser,
6962
route: 'readonly'
7063
}
7164
},

0 commit comments

Comments
 (0)