Skip to content

Commit 01d6aa0

Browse files
committed
chore(lint): allow DOM globals in runtime-vapor
1 parent 5a62266 commit 01d6aa0

File tree

6 files changed

+2
-10
lines changed

6 files changed

+2
-10
lines changed

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default tseslint.config(
106106

107107
// Packages targeting DOM
108108
{
109-
files: ['packages/{vue,vue-compat,runtime-dom}/**'],
109+
files: ['packages/{vue,vue-compat,runtime-dom,runtime-vapor}/**'],
110110
rules: {
111111
'no-restricted-globals': ['error', ...NodeGlobals],
112112
},

packages/runtime-vapor/src/block.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export class DynamicFragment extends Fragment {
3737
this.anchor =
3838
__DEV__ && anchorLabel
3939
? createComment(anchorLabel)
40-
: // eslint-disable-next-line no-restricted-globals
41-
document.createTextNode('')
40+
: document.createTextNode('')
4241
}
4342

4443
update(render?: BlockFn, key: any = render): void {

packages/runtime-vapor/src/component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ export function createComponentWithFallback(
452452
return createComponent(comp, rawProps, rawSlots, isSingleRoot)
453453
}
454454

455-
// eslint-disable-next-line no-restricted-globals
456455
const el = document.createElement(comp)
457456
// mark single root
458457
;(el as any).$root = isSingleRoot

packages/runtime-vapor/src/dom/event.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export const delegateEvents = (...names: string[]): void => {
7676
for (const name of names) {
7777
if (!delegatedEvents[name]) {
7878
delegatedEvents[name] = true
79-
// eslint-disable-next-line no-restricted-globals
8079
document.addEventListener(name, delegatedEventHandler)
8180
}
8281
}
@@ -93,7 +92,6 @@ const delegatedEventHandler = (e: Event) => {
9392
Object.defineProperty(e, 'currentTarget', {
9493
configurable: true,
9594
get() {
96-
// eslint-disable-next-line no-restricted-globals
9795
return node || document
9896
},
9997
})

packages/runtime-vapor/src/dom/node.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { renderEffect } from '../renderEffect'
33
import { setText } from './prop'
44

55
export function createTextNode(values?: any[] | (() => any[])): Text {
6-
// eslint-disable-next-line no-restricted-globals
76
const node = document.createTextNode('')
87
if (values) {
98
if (isArray(values)) {
@@ -17,12 +16,10 @@ export function createTextNode(values?: any[] | (() => any[])): Text {
1716

1817
/*! #__NO_SIDE_EFFECTS__ */
1918
export function createComment(data: string): Comment {
20-
// eslint-disable-next-line no-restricted-globals
2119
return document.createComment(data)
2220
}
2321

2422
/*! #__NO_SIDE_EFFECTS__ */
2523
export function querySelector(selectors: string): Element | null {
26-
// eslint-disable-next-line no-restricted-globals
2724
return document.querySelector(selectors)
2825
}

packages/runtime-vapor/src/dom/template.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
export function template(html: string, root?: boolean) {
33
let node: ChildNode
44
const create = () => {
5-
// eslint-disable-next-line no-restricted-globals
65
const t = document.createElement('template')
76
t.innerHTML = html
87
return t.content.firstChild!

0 commit comments

Comments
 (0)