mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2026-02-04 07:53:11 +00:00
config(eslint): 添加浏览器和Web API全局变量配置
- 添加浏览器全局变量如window、document、navigator等 - 添加Vite相关全局变量如import、process等 - 添加Service Worker全局变量如self、caches等 - 添加Web API全局变量如Notification、ServiceWorker等 - 添加Web Storage API全局变量如Storage、StorageEvent等 - 添加WebSocket和Web Workers相关全局变量
This commit is contained in:
parent
fb4da655c6
commit
46570636df
@ -19,5 +19,48 @@ export default [
|
|||||||
rules: {
|
rules: {
|
||||||
'vue/multi-word-component-names': 'off',
|
'vue/multi-word-component-names': 'off',
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
// Browser globals
|
||||||
|
window: 'readonly',
|
||||||
|
document: 'readonly',
|
||||||
|
navigator: 'readonly',
|
||||||
|
localStorage: 'readonly',
|
||||||
|
sessionStorage: 'readonly',
|
||||||
|
console: 'readonly',
|
||||||
|
alert: 'readonly',
|
||||||
|
confirm: 'readonly',
|
||||||
|
prompt: 'readonly',
|
||||||
|
setTimeout: 'readonly',
|
||||||
|
setInterval: 'readonly',
|
||||||
|
fetch: 'readonly',
|
||||||
|
XMLHttpRequest: 'readonly',
|
||||||
|
URL: 'readonly',
|
||||||
|
URLSearchParams: 'readonly',
|
||||||
|
atob: 'readonly',
|
||||||
|
btoa: 'readonly',
|
||||||
|
// Vite globals
|
||||||
|
import: 'readonly',
|
||||||
|
process: 'readonly',
|
||||||
|
// Service Worker globals
|
||||||
|
self: 'readonly',
|
||||||
|
caches: 'readonly',
|
||||||
|
// Web API
|
||||||
|
Notification: 'readonly',
|
||||||
|
ServiceWorker: 'readonly',
|
||||||
|
PushManager: 'readonly',
|
||||||
|
PushSubscription: 'readonly',
|
||||||
|
// Web Storage API
|
||||||
|
Storage: 'readonly',
|
||||||
|
StorageEvent: 'readonly',
|
||||||
|
// Web Socket
|
||||||
|
WebSocket: 'readonly',
|
||||||
|
// Web Workers
|
||||||
|
Worker: 'readonly',
|
||||||
|
SharedWorker: 'readonly',
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user