chore(lint): allow DOM globals in runtime-vapor
This commit is contained in:
parent
5a62266e13
commit
01d6aa0d33
|
@ -106,7 +106,7 @@ export default tseslint.config(
|
|||
|
||||
// Packages targeting DOM
|
||||
{
|
||||
files: ['packages/{vue,vue-compat,runtime-dom}/**'],
|
||||
files: ['packages/{vue,vue-compat,runtime-dom,runtime-vapor}/**'],
|
||||
rules: {
|
||||
'no-restricted-globals': ['error', ...NodeGlobals],
|
||||
},
|
||||
|
|
|
@ -37,8 +37,7 @@ export class DynamicFragment extends Fragment {
|
|||
this.anchor =
|
||||
__DEV__ && anchorLabel
|
||||
? createComment(anchorLabel)
|
||||
: // eslint-disable-next-line no-restricted-globals
|
||||
document.createTextNode('')
|
||||
: document.createTextNode('')
|
||||
}
|
||||
|
||||
update(render?: BlockFn, key: any = render): void {
|
||||
|
|
|
@ -452,7 +452,6 @@ export function createComponentWithFallback(
|
|||
return createComponent(comp, rawProps, rawSlots, isSingleRoot)
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
const el = document.createElement(comp)
|
||||
// mark single root
|
||||
;(el as any).$root = isSingleRoot
|
||||
|
|
|
@ -76,7 +76,6 @@ export const delegateEvents = (...names: string[]): void => {
|
|||
for (const name of names) {
|
||||
if (!delegatedEvents[name]) {
|
||||
delegatedEvents[name] = true
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
document.addEventListener(name, delegatedEventHandler)
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +92,6 @@ const delegatedEventHandler = (e: Event) => {
|
|||
Object.defineProperty(e, 'currentTarget', {
|
||||
configurable: true,
|
||||
get() {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
return node || document
|
||||
},
|
||||
})
|
||||
|
|
|
@ -3,7 +3,6 @@ import { renderEffect } from '../renderEffect'
|
|||
import { setText } from './prop'
|
||||
|
||||
export function createTextNode(values?: any[] | (() => any[])): Text {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
const node = document.createTextNode('')
|
||||
if (values) {
|
||||
if (isArray(values)) {
|
||||
|
@ -17,12 +16,10 @@ export function createTextNode(values?: any[] | (() => any[])): Text {
|
|||
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
export function createComment(data: string): Comment {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
return document.createComment(data)
|
||||
}
|
||||
|
||||
/*! #__NO_SIDE_EFFECTS__ */
|
||||
export function querySelector(selectors: string): Element | null {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
return document.querySelector(selectors)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
export function template(html: string, root?: boolean) {
|
||||
let node: ChildNode
|
||||
const create = () => {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
const t = document.createElement('template')
|
||||
t.innerHTML = html
|
||||
return t.content.firstChild!
|
||||
|
|
Loading…
Reference in New Issue