Skip to content

Commit 6edb0e2

Browse files
Address CodeRabbit suggestions
- Use globals package for ESLint browser/node globals instead of manual declaration - Pin volar-service-vetur to ^0.0.64 instead of wildcard version - Add missing globals (MediaStreamConstraints, RequestInit) not in standard set
1 parent c606034 commit 6edb0e2

File tree

3 files changed

+46
-88
lines changed

3 files changed

+46
-88
lines changed

package-lock.json

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

src/ui/eslint.config.js

Lines changed: 5 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import vueParser from "vue-eslint-parser";
55
import vuePlugin from "eslint-plugin-vue";
66
import prettierPlugin from "eslint-plugin-prettier";
77
import prettierConfig from "@vue/eslint-config-prettier";
8+
import globals from "globals";
89

910
export default [
1011
js.configs.recommended,
@@ -39,82 +40,11 @@ export default [
3940
sourceType: "module",
4041
},
4142
globals: {
42-
process: "readonly",
43-
__dirname: "readonly",
44-
__filename: "readonly",
45-
module: "readonly",
46-
require: "readonly",
47-
window: "readonly",
48-
document: "readonly",
49-
navigator: "readonly",
50-
console: "readonly",
51-
localStorage: "readonly",
52-
sessionStorage: "readonly",
53-
fetch: "readonly",
54-
Response: "readonly",
55-
Request: "readonly",
56-
FormData: "readonly",
57-
location: "readonly",
58-
setTimeout: "readonly",
59-
clearTimeout: "readonly",
60-
setInterval: "readonly",
61-
clearInterval: "readonly",
62-
requestAnimationFrame: "readonly",
63-
cancelAnimationFrame: "readonly",
64-
getComputedStyle: "readonly",
65-
self: "readonly",
66-
HTMLElement: "readonly",
67-
Element: "readonly",
68-
Node: "readonly",
69-
MouseEvent: "readonly",
70-
KeyboardEvent: "readonly",
71-
DragEvent: "readonly",
72-
PointerEvent: "readonly",
73-
Event: "readonly",
74-
AbortController: "readonly",
75-
ResizeObserver: "readonly",
76-
MutationObserver: "readonly",
77-
IntersectionObserver: "readonly",
78-
URL: "readonly",
79-
URLSearchParams: "readonly",
80-
Blob: "readonly",
81-
File: "readonly",
82-
FileReader: "readonly",
83-
TextDecoder: "readonly",
84-
TextEncoder: "readonly",
85-
Image: "readonly",
86-
atob: "readonly",
87-
btoa: "readonly",
88-
InputEvent: "readonly",
89-
CustomEvent: "readonly",
90-
HTMLInputElement: "readonly",
91-
HTMLLinkElement: "readonly",
92-
AbortSignal: "readonly",
93-
RequestInit: "readonly",
94-
structuredClone: "readonly",
95-
BeforeUnloadEvent: "readonly",
96-
WebSocket: "readonly",
97-
CloseEvent: "readonly",
98-
ErrorEvent: "readonly",
99-
PromiseRejectionEvent: "readonly",
100-
performance: "readonly",
101-
FileList: "readonly",
102-
alert: "readonly",
103-
confirm: "readonly",
104-
prompt: "readonly",
105-
HTMLDivElement: "readonly",
106-
HTMLButtonElement: "readonly",
107-
HTMLTextAreaElement: "readonly",
108-
HTMLImageElement: "readonly",
109-
WheelEvent: "readonly",
110-
FocusEvent: "readonly",
111-
DOMRect: "readonly",
112-
ClipboardEvent: "readonly",
113-
MediaDeviceInfo: "readonly",
43+
...globals.browser,
44+
...globals.node,
45+
// Additional browser APIs that may not be in globals.browser
11446
MediaStreamConstraints: "readonly",
115-
MediaStream: "readonly",
116-
Storage: "readonly",
117-
global: "readonly",
47+
RequestInit: "readonly",
11848
},
11949
},
12050

src/ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@
6363
"eslint": "^9.39.2",
6464
"eslint-plugin-prettier": "5.5.4",
6565
"eslint-plugin-vue": "^10.6.2",
66+
"globals": "^16.5.0",
6667
"jsdom": "^27.4.0",
6768
"postcss": "^8.5.6",
6869
"postcss-assign-layer": "^0.4.0",
6970
"prettier": "3.7.4",
7071
"vite": "^7.3.0",
7172
"vitest": "^4.0.16",
72-
"volar-service-vetur": "*"
73+
"volar-service-vetur": "^0.0.64"
7374
}
7475
}

0 commit comments

Comments
 (0)