workflow: setup eslint for prohibited syntax and globals

fix #1285
This commit is contained in:
Evan You
2020-06-10 16:54:23 -04:00
parent e4dc03a8b1
commit 80c868aefe
20 changed files with 697 additions and 149 deletions

View File

@@ -1,9 +1,11 @@
/* eslint-disable no-restricted-globals */
import {
ComponentInternalInstance,
ComponentOptions,
InternalRenderFunction
} from './component'
import { queueJob, queuePostFlushCb } from './scheduler'
import { extend } from '@vue/shared'
export interface HMRRuntime {
createRecord: typeof createRecord
@@ -85,7 +87,7 @@ function reload(id: string, newComp: ComponentOptions) {
const comp = instance.type
if (!comp.__hmrUpdated) {
// 1. Update existing comp definition to match new one
Object.assign(comp, newComp)
extend(comp, newComp)
for (const key in comp) {
if (!(key in newComp)) {
delete (comp as any)[key]