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,7 +1,14 @@
import { reactive, readonly, toRaw, ReactiveFlags } from './reactive'
import { TrackOpTypes, TriggerOpTypes } from './operations'
import { track, trigger, ITERATE_KEY } from './effect'
import { isObject, hasOwn, isSymbol, hasChanged, isArray } from '@vue/shared'
import {
isObject,
hasOwn,
isSymbol,
hasChanged,
isArray,
extend
} from '@vue/shared'
import { isRef } from './ref'
const builtInSymbols = new Set(
@@ -167,16 +174,22 @@ export const readonlyHandlers: ProxyHandler<object> = {
}
}
export const shallowReactiveHandlers: ProxyHandler<object> = {
...mutableHandlers,
get: shallowGet,
set: shallowSet
}
export const shallowReactiveHandlers: ProxyHandler<object> = extend(
{},
mutableHandlers,
{
get: shallowGet,
set: shallowSet
}
)
// Props handlers are special in the sense that it should not unwrap top-level
// refs (in order to allow refs to be explicitly passed down), but should
// retain the reactivity of the normal readonly object.
export const shallowReadonlyHandlers: ProxyHandler<object> = {
...readonlyHandlers,
get: shallowReadonlyGet
}
export const shallowReadonlyHandlers: ProxyHandler<object> = extend(
{},
readonlyHandlers,
{
get: shallowReadonlyGet
}
)