Skip to content

Commit

Permalink
chore(deps): update lint (#9627)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] and autofix-ci[bot] committed Nov 18, 2023
1 parent 9b634cb commit 16a6438
Show file tree
Hide file tree
Showing 39 changed files with 264 additions and 264 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,27 @@
"@rollup/plugin-terser": "^0.4.4",
"@types/hash-sum": "^1.0.2",
"@types/node": "^20.9.0",
"@typescript-eslint/parser": "^6.10.0",
"@typescript-eslint/parser": "^6.11.0",
"@vitest/coverage-istanbul": "^0.34.6",
"@vue/consolidate": "0.17.3",
"conventional-changelog-cli": "^4.1.0",
"enquirer": "^2.4.1",
"esbuild": "^0.19.5",
"esbuild-plugin-polyfill-node": "^0.3.0",
"eslint": "^8.53.0",
"eslint": "^8.54.0",
"eslint-plugin-jest": "^27.6.0",
"estree-walker": "^2.0.2",
"execa": "^8.0.1",
"jsdom": "^22.1.0",
"lint-staged": "^15.0.2",
"lint-staged": "^15.1.0",
"lodash": "^4.17.21",
"magic-string": "^0.30.5",
"markdown-table": "^3.0.3",
"marked": "^9.1.6",
"minimist": "^1.2.8",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"pretty-bytes": "^6.1.1",
"pug": "^3.0.2",
"puppeteer": "~21.5.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-core/__tests__/transforms/vFor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,8 @@ describe('compiler: v-for', () => {
patchFlag: !disableTracking
? genFlagText(PatchFlags.STABLE_FRAGMENT)
: keyed
? genFlagText(PatchFlags.KEYED_FRAGMENT)
: genFlagText(PatchFlags.UNKEYED_FRAGMENT),
? genFlagText(PatchFlags.KEYED_FRAGMENT)
: genFlagText(PatchFlags.UNKEYED_FRAGMENT),
children: {
type: NodeTypes.JS_CALL_EXPRESSION,
callee: RENDER_LIST,
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-core/src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ function genAssets(
__COMPAT__ && type === 'filter'
? RESOLVE_FILTER
: type === 'component'
? RESOLVE_COMPONENT
: RESOLVE_DIRECTIVE
? RESOLVE_COMPONENT
: RESOLVE_DIRECTIVE
)
for (let i = 0; i < assets.length; i++) {
let id = assets[i]
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-core/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export function getBaseTransformPreset(
transformExpression
]
: __BROWSER__ && __DEV__
? [transformExpression]
: []),
? [transformExpression]
: []),
transformSlotOutlet,
transformElement,
trackSlotScopes,
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-core/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,8 @@ function parseAttribute(
(isPropShorthand || startsWith(name, ':')
? 'bind'
: startsWith(name, '@')
? 'on'
: 'slot')
? 'on'
: 'slot')
let arg: ExpressionNode | undefined

if (match[2]) {
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-core/src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ export function createTransformContext(
const removalIndex = node
? list.indexOf(node)
: context.currentNode
? context.childIndex
: -1
? context.childIndex
: -1
/* istanbul ignore if */
if (__DEV__ && removalIndex < 0) {
throw new Error(`node being removed is not a child of current parent`)
Expand Down
12 changes: 6 additions & 6 deletions packages/compiler-core/src/transforms/vFor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ export const transformFor = createStructuralDirectiveTransform(
const fragmentFlag = isStableFragment
? PatchFlags.STABLE_FRAGMENT
: keyProp
? PatchFlags.KEYED_FRAGMENT
: PatchFlags.UNKEYED_FRAGMENT
? PatchFlags.KEYED_FRAGMENT
: PatchFlags.UNKEYED_FRAGMENT

forNode.codegenNode = createVNodeCall(
context,
Expand Down Expand Up @@ -141,10 +141,10 @@ export const transformFor = createStructuralDirectiveTransform(
const slotOutlet = isSlotOutlet(node)
? node
: isTemplate &&
node.children.length === 1 &&
isSlotOutlet(node.children[0])
? (node.children[0] as SlotOutletNode) // api-extractor somehow fails to infer this
: null
node.children.length === 1 &&
isSlotOutlet(node.children[0])
? (node.children[0] as SlotOutletNode) // api-extractor somehow fails to infer this
: null

if (slotOutlet) {
// <slot v-for="..."> or <template v-for="..."><slot/></template>
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-core/src/transforms/vSlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ export function buildSlots(
const slotFlag = hasDynamicSlots
? SlotFlags.DYNAMIC
: hasForwardedSlots(node.children)
? SlotFlags.FORWARDED
: SlotFlags.STABLE
? SlotFlags.FORWARDED
: SlotFlags.STABLE

let slots = createObjectExpression(
slotsProperties.concat(
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-dom/src/transforms/stringifyStatic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ const isStringifiableAttr = (name: string, ns: DOMNamespaces) => {
(ns === DOMNamespaces.HTML
? isKnownHtmlAttr(name)
: ns === DOMNamespaces.SVG
? isKnownSvgAttr(name)
: false) || dataAriaRE.test(name)
? isKnownSvgAttr(name)
: false) || dataAriaRE.test(name)
)
}

Expand Down
16 changes: 8 additions & 8 deletions packages/compiler-dom/src/transforms/vOn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ const transformClick = (key: ExpressionNode, event: string) => {
return isStaticClick
? createSimpleExpression(event, true)
: key.type !== NodeTypes.SIMPLE_EXPRESSION
? createCompoundExpression([
`(`,
key,
`) === "onClick" ? "${event}" : (`,
key,
`)`
])
: key
? createCompoundExpression([
`(`,
key,
`) === "onClick" ? "${event}" : (`,
key,
`)`
])
: key
}

export const transformOn: DirectiveTransform = (dir, node, context) => {
Expand Down
12 changes: 6 additions & 6 deletions packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1172,8 +1172,8 @@ function walkObjectPattern(
const type = isDefineCall
? BindingTypes.SETUP_CONST
: isConst
? BindingTypes.SETUP_MAYBE_REF
: BindingTypes.SETUP_LET
? BindingTypes.SETUP_MAYBE_REF
: BindingTypes.SETUP_LET
registerBinding(bindings, p.key, type)
} else {
walkPattern(p.value, bindings, isConst, isDefineCall)
Expand Down Expand Up @@ -1208,8 +1208,8 @@ function walkPattern(
const type = isDefineCall
? BindingTypes.SETUP_CONST
: isConst
? BindingTypes.SETUP_MAYBE_REF
: BindingTypes.SETUP_LET
? BindingTypes.SETUP_MAYBE_REF
: BindingTypes.SETUP_LET
registerBinding(bindings, node, type)
} else if (node.type === 'RestElement') {
// argument can only be identifier when destructuring
Expand All @@ -1224,8 +1224,8 @@ function walkPattern(
const type = isDefineCall
? BindingTypes.SETUP_CONST
: isConst
? BindingTypes.SETUP_MAYBE_REF
: BindingTypes.SETUP_LET
? BindingTypes.SETUP_MAYBE_REF
: BindingTypes.SETUP_LET
registerBinding(bindings, node.left, type)
} else {
walkPattern(node.left, bindings, isConst)
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-sfc/src/compileTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export function compileTemplate(
? preprocessCustomRequire
? preprocessCustomRequire(preprocessLang)
: __ESM_BROWSER__
? undefined
: consolidate[preprocessLang as keyof typeof consolidate]
? undefined
: consolidate[preprocessLang as keyof typeof consolidate]
: false
if (preprocessor) {
try {
Expand Down
16 changes: 8 additions & 8 deletions packages/compiler-sfc/src/script/resolveType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ function innerResolveTypeReference(
? scope.exportedDeclares
: scope.declares
: onlyExported
? scope.exportedTypes
: scope.types
? scope.exportedTypes
: scope.types
if (lookupSource[name]) {
return lookupSource[name]
} else {
Expand Down Expand Up @@ -679,10 +679,10 @@ function getReferenceName(node: ReferenceTypes): string | string[] {
node.type === 'TSTypeReference'
? node.typeName
: node.type === 'TSExpressionWithTypeArguments'
? node.expression
: node.type === 'TSImportType'
? node.qualifier
: node.exprName
? node.expression
: node.type === 'TSImportType'
? node.qualifier
: node.exprName
if (ref?.type === 'Identifier') {
return ref.name
} else if (ref?.type === 'TSQualifiedName') {
Expand Down Expand Up @@ -1056,8 +1056,8 @@ function ctxToScope(ctx: TypeResolveContext): TypeScope {
'ast' in ctx
? ctx.ast
: ctx.scriptAst
? [...ctx.scriptAst.body, ...ctx.scriptSetupAst!.body]
: ctx.scriptSetupAst!.body
? [...ctx.scriptAst.body, ...ctx.scriptSetupAst!.body]
: ctx.scriptSetupAst!.body

const scope = new TypeScope(
ctx.filename,
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-sfc/src/script/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export function getId(node: Expression) {
return node.type === 'Identifier'
? node.name
: node.type === 'StringLiteral'
? node.value
: null
? node.value
: null
}

const identity = (str: string) => str
Expand Down
4 changes: 2 additions & 2 deletions packages/reactivity-transform/src/reactivityTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ export function transformAST(
const keyStr = isString(key)
? `'${key}'`
: key
? snip(key)
: `'${nameId.name}'`
? snip(key)
: `'${nameId.name}'`
const defaultStr = defaultValue ? `, ${snip(defaultValue)}` : ``
s.appendLeft(
call.end! + offset,
Expand Down
4 changes: 2 additions & 2 deletions packages/reactivity/src/baseHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class BaseReactiveHandler implements ProxyHandler<Target> {
? shallowReadonlyMap
: readonlyMap
: shallow
? shallowReactiveMap
: reactiveMap
? shallowReactiveMap
: reactiveMap
).get(target)
) {
return target
Expand Down
8 changes: 4 additions & 4 deletions packages/reactivity/src/collectionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ function createReadonlyMethod(type: TriggerOpTypes): Function {
return type === TriggerOpTypes.DELETE
? false
: type === TriggerOpTypes.CLEAR
? undefined
: this
? undefined
: this
}
}

Expand Down Expand Up @@ -341,8 +341,8 @@ function createInstrumentationGetter(isReadonly: boolean, shallow: boolean) {
? shallowReadonlyInstrumentations
: shallowInstrumentations
: isReadonly
? readonlyInstrumentations
: mutableInstrumentations
? readonlyInstrumentations
: mutableInstrumentations

return (
target: CollectionTypes,
Expand Down
36 changes: 18 additions & 18 deletions packages/reactivity/src/reactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,24 @@ type Builtin = Primitive | Function | Date | Error | RegExp
export type DeepReadonly<T> = T extends Builtin
? T
: T extends Map<infer K, infer V>
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends ReadonlyMap<infer K, infer V>
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends WeakMap<infer K, infer V>
? WeakMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends Set<infer U>
? ReadonlySet<DeepReadonly<U>>
: T extends ReadonlySet<infer U>
? ReadonlySet<DeepReadonly<U>>
: T extends WeakSet<infer U>
? WeakSet<DeepReadonly<U>>
: T extends Promise<infer U>
? Promise<DeepReadonly<U>>
: T extends Ref<infer U>
? Readonly<Ref<DeepReadonly<U>>>
: T extends {}
? { readonly [K in keyof T]: DeepReadonly<T[K]> }
: Readonly<T>
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends ReadonlyMap<infer K, infer V>
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends WeakMap<infer K, infer V>
? WeakMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends Set<infer U>
? ReadonlySet<DeepReadonly<U>>
: T extends ReadonlySet<infer U>
? ReadonlySet<DeepReadonly<U>>
: T extends WeakSet<infer U>
? WeakSet<DeepReadonly<U>>
: T extends Promise<infer U>
? Promise<DeepReadonly<U>>
: T extends Ref<infer U>
? Readonly<Ref<DeepReadonly<U>>>
: T extends {}
? { readonly [K in keyof T]: DeepReadonly<T[K]> }
: Readonly<T>

/**
* Takes an object (reactive or plain) or a ref and returns a readonly proxy to
Expand Down
28 changes: 14 additions & 14 deletions packages/reactivity/src/ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ export function toRef<T>(
): T extends () => infer R
? Readonly<Ref<R>>
: T extends Ref
? T
: Ref<UnwrapRef<T>>
? T
: Ref<UnwrapRef<T>>
export function toRef<T extends object, K extends keyof T>(
object: T,
key: K
Expand Down Expand Up @@ -478,17 +478,17 @@ export type ShallowUnwrapRef<T> = {
[K in keyof T]: T[K] extends Ref<infer V>
? V // if `V` is `unknown` that means it does not extend `Ref` and is undefined
: T[K] extends Ref<infer V> | undefined
? unknown extends V
? undefined
: V | undefined
: T[K]
? unknown extends V
? undefined
: V | undefined
: T[K]
}

export type UnwrapRef<T> = T extends ShallowRef<infer V>
? V
: T extends Ref<infer V>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>
? UnwrapRefSimple<V>
: UnwrapRefSimple<T>

export type UnwrapRefSimple<T> = T extends
| Function
Expand All @@ -499,9 +499,9 @@ export type UnwrapRefSimple<T> = T extends
| { [RawSymbol]?: true }
? T
: T extends ReadonlyArray<any>
? { [K in keyof T]: UnwrapRefSimple<T[K]> }
: T extends object & { [ShallowReactiveMarker]?: never }
? {
[P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]>
}
: T
? { [K in keyof T]: UnwrapRefSimple<T[K]> }
: T extends object & { [ShallowReactiveMarker]?: never }
? {
[P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]>
}
: T

0 comments on commit 16a6438

Please sign in to comment.