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

@@ -30,7 +30,7 @@ import {
KEEP_ALIVE,
BASE_TRANSITION
} from './runtimeHelpers'
import { isString, isObject, hyphenate } from '@vue/shared'
import { isString, isObject, hyphenate, extend } from '@vue/shared'
import { parse } from '@babel/parser'
import { walk } from 'estree-walker'
import { Node } from '@babel/types'
@@ -119,7 +119,11 @@ export function advancePositionWithClone(
source: string,
numberOfCharacters: number = source.length
): Position {
return advancePositionWithMutation({ ...pos }, source, numberOfCharacters)
return advancePositionWithMutation(
extend({}, pos),
source,
numberOfCharacters
)
}
// advance by mutation without cloning (for performance reasons), since this