]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: run updated prettier
authorEvan You <yyx990803@gmail.com>
Mon, 19 Jul 2021 22:24:18 +0000 (18:24 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 19 Jul 2021 22:24:18 +0000 (18:24 -0400)
110 files changed:
packages/compiler-core/__tests__/codegen.spec.ts
packages/compiler-core/__tests__/parse.spec.ts
packages/compiler-core/__tests__/transforms/hoistStatic.spec.ts
packages/compiler-core/__tests__/transforms/vFor.spec.ts
packages/compiler-core/__tests__/transforms/vModel.spec.ts
packages/compiler-core/__tests__/transforms/vOn.spec.ts
packages/compiler-core/src/ast.ts
packages/compiler-core/src/codegen.ts
packages/compiler-core/src/compile.ts
packages/compiler-core/src/parse.ts
packages/compiler-core/src/transform.ts
packages/compiler-core/src/transforms/vFor.ts
packages/compiler-core/src/transforms/vIf.ts
packages/compiler-core/src/transforms/vSlot.ts
packages/compiler-core/src/utils.ts
packages/compiler-core/src/validateExpression.ts
packages/compiler-dom/__tests__/transforms/vOn.spec.ts
packages/compiler-dom/src/transforms/vOn.ts
packages/compiler-sfc/__tests__/templateTransformAssetUrl.spec.ts
packages/compiler-sfc/src/compileScript.ts
packages/compiler-sfc/src/compileStyle.ts
packages/compiler-sfc/src/compileTemplate.ts
packages/compiler-sfc/src/cssVars.ts
packages/compiler-sfc/src/rewriteDefault.ts
packages/compiler-ssr/__tests__/ssrElement.spec.ts
packages/compiler-ssr/src/ssrCodegenTransform.ts
packages/compiler-ssr/src/transforms/ssrTransformComponent.ts
packages/global.d.ts
packages/reactivity/__tests__/collections/Set.spec.ts
packages/reactivity/__tests__/readonly.spec.ts
packages/reactivity/src/baseHandlers.ts
packages/reactivity/src/collectionHandlers.ts
packages/reactivity/src/computed.ts
packages/reactivity/src/reactive.ts
packages/reactivity/src/ref.ts
packages/runtime-core/__tests__/apiSetupHelpers.spec.ts
packages/runtime-core/__tests__/apiTemplateRef.spec.ts
packages/runtime-core/__tests__/apiWatch.spec.ts
packages/runtime-core/__tests__/componentPublicInstance.spec.ts
packages/runtime-core/__tests__/components/BaseTransition.spec.ts
packages/runtime-core/__tests__/components/KeepAlive.spec.ts
packages/runtime-core/__tests__/components/Teleport.spec.ts
packages/runtime-core/__tests__/helpers/createSlots.spec.ts
packages/runtime-core/__tests__/helpers/renderList.spec.ts
packages/runtime-core/__tests__/hydration.spec.ts
packages/runtime-core/__tests__/rendererChildren.spec.ts
packages/runtime-core/__tests__/rendererComponent.spec.ts
packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts
packages/runtime-core/__tests__/scopeId.spec.ts
packages/runtime-core/__tests__/vnode.spec.ts
packages/runtime-core/src/apiAsyncComponent.ts
packages/runtime-core/src/apiCreateApp.ts
packages/runtime-core/src/apiLifecycle.ts
packages/runtime-core/src/apiSetupHelpers.ts
packages/runtime-core/src/apiWatch.ts
packages/runtime-core/src/compat/compatConfig.ts
packages/runtime-core/src/compat/global.ts
packages/runtime-core/src/compat/renderFn.ts
packages/runtime-core/src/compat/renderHelpers.ts
packages/runtime-core/src/component.ts
packages/runtime-core/src/componentProps.ts
packages/runtime-core/src/componentPublicInstance.ts
packages/runtime-core/src/components/BaseTransition.ts
packages/runtime-core/src/components/KeepAlive.ts
packages/runtime-core/src/components/Suspense.ts
packages/runtime-core/src/components/Teleport.ts
packages/runtime-core/src/devtools.ts
packages/runtime-core/src/helpers/createSlots.ts
packages/runtime-core/src/helpers/typeUtils.ts
packages/runtime-core/src/hmr.ts
packages/runtime-core/src/hydration.ts
packages/runtime-core/src/index.ts
packages/runtime-core/src/renderer.ts
packages/runtime-core/src/vnode.ts
packages/runtime-dom/__tests__/directives/vModel.spec.ts
packages/runtime-dom/__tests__/directives/vOn.spec.ts
packages/runtime-dom/__tests__/helpers/useCssVars.spec.ts
packages/runtime-dom/src/apiCustomElement.ts
packages/runtime-dom/src/components/Transition.ts
packages/runtime-dom/src/components/TransitionGroup.ts
packages/runtime-dom/src/directives/vModel.ts
packages/runtime-dom/src/directives/vOn.ts
packages/runtime-dom/src/modules/attrs.ts
packages/runtime-dom/src/modules/class.ts
packages/runtime-dom/src/patchProp.ts
packages/runtime-test/src/serialize.ts
packages/server-renderer/__tests__/render.spec.ts
packages/server-renderer/__tests__/ssrRenderList.spec.ts
packages/server-renderer/src/helpers/ssrCompile.ts
packages/server-renderer/src/helpers/ssrVModelHelpers.ts
packages/server-renderer/src/renderToString.ts
packages/sfc-playground/src/sfcCompiler.ts
packages/shared/__tests__/looseEqual.spec.ts
packages/shared/__tests__/normalizeProp.spec.ts
packages/shared/src/index.ts
packages/shared/src/toDisplayString.ts
packages/template-explorer/src/index.ts
packages/template-explorer/src/options.ts
packages/vue-compat/__tests__/componentFunctional.spec.ts
packages/vue-compat/__tests__/filters.spec.ts
packages/vue-compat/__tests__/global.spec.ts
packages/vue-compat/__tests__/instance.spec.ts
packages/vue-compat/__tests__/misc.spec.ts
packages/vue-compat/src/index.ts
packages/vue-compat/src/runtime.ts
packages/vue/__tests__/Transition.spec.ts
packages/vue/__tests__/TransitionGroup.spec.ts
packages/vue/examples/__tests__/commits.mock.ts
packages/vue/src/index.ts
packages/vue/src/runtime.ts

index 61908a9105bf4ec1d9f7ce715a90f3aa06c43cc7..b51ca132836f2dcc7d7734c9ad3f13a697ed2ca1 100644 (file)
@@ -61,11 +61,7 @@ describe('compiler: codegen', () => {
     })
     const { code } = generate(root, { mode: 'module' })
     expect(code).toMatch(
-      `import { ${helperNameMap[CREATE_VNODE]} as _${
-        helperNameMap[CREATE_VNODE]
-      }, ${helperNameMap[RESOLVE_DIRECTIVE]} as _${
-        helperNameMap[RESOLVE_DIRECTIVE]
-      } } from "vue"`
+      `import { ${helperNameMap[CREATE_VNODE]} as _${helperNameMap[CREATE_VNODE]}, ${helperNameMap[RESOLVE_DIRECTIVE]} as _${helperNameMap[RESOLVE_DIRECTIVE]} } from "vue"`
     )
     expect(code).toMatchSnapshot()
   })
@@ -76,16 +72,10 @@ describe('compiler: codegen', () => {
     })
     const { code } = generate(root, { mode: 'module', optimizeImports: true })
     expect(code).toMatch(
-      `import { ${helperNameMap[CREATE_VNODE]}, ${
-        helperNameMap[RESOLVE_DIRECTIVE]
-      } } from "vue"`
+      `import { ${helperNameMap[CREATE_VNODE]}, ${helperNameMap[RESOLVE_DIRECTIVE]} } from "vue"`
     )
     expect(code).toMatch(
-      `const _${helperNameMap[CREATE_VNODE]} = ${
-        helperNameMap[CREATE_VNODE]
-      }, _${helperNameMap[RESOLVE_DIRECTIVE]} = ${
-        helperNameMap[RESOLVE_DIRECTIVE]
-      }`
+      `const _${helperNameMap[CREATE_VNODE]} = ${helperNameMap[CREATE_VNODE]}, _${helperNameMap[RESOLVE_DIRECTIVE]} = ${helperNameMap[RESOLVE_DIRECTIVE]}`
     )
     expect(code).toMatchSnapshot()
   })
@@ -97,11 +87,7 @@ describe('compiler: codegen', () => {
     const { code } = generate(root, { mode: 'function' })
     expect(code).toMatch(`const _Vue = Vue`)
     expect(code).toMatch(
-      `const { ${helperNameMap[CREATE_VNODE]}: _${
-        helperNameMap[CREATE_VNODE]
-      }, ${helperNameMap[RESOLVE_DIRECTIVE]}: _${
-        helperNameMap[RESOLVE_DIRECTIVE]
-      } } = _Vue`
+      `const { ${helperNameMap[CREATE_VNODE]}: _${helperNameMap[CREATE_VNODE]}, ${helperNameMap[RESOLVE_DIRECTIVE]}: _${helperNameMap[RESOLVE_DIRECTIVE]} } = _Vue`
     )
     expect(code).toMatchSnapshot()
   })
@@ -116,11 +102,7 @@ describe('compiler: codegen', () => {
     })
     expect(code).not.toMatch(`const _Vue = Vue`)
     expect(code).toMatch(
-      `const { ${helperNameMap[CREATE_VNODE]}: _${
-        helperNameMap[CREATE_VNODE]
-      }, ${helperNameMap[RESOLVE_DIRECTIVE]}: _${
-        helperNameMap[RESOLVE_DIRECTIVE]
-      } } = Vue`
+      `const { ${helperNameMap[CREATE_VNODE]}: _${helperNameMap[CREATE_VNODE]}, ${helperNameMap[RESOLVE_DIRECTIVE]}: _${helperNameMap[RESOLVE_DIRECTIVE]} } = Vue`
     )
     expect(code).toMatchSnapshot()
   })
@@ -136,30 +118,20 @@ describe('compiler: codegen', () => {
       `const _component_Foo = _${helperNameMap[RESOLVE_COMPONENT]}("Foo")\n`
     )
     expect(code).toMatch(
-      `const _component_bar_baz = _${
-        helperNameMap[RESOLVE_COMPONENT]
-      }("bar-baz")\n`
+      `const _component_bar_baz = _${helperNameMap[RESOLVE_COMPONENT]}("bar-baz")\n`
     )
     expect(code).toMatch(
-      `const _component_barbaz = _${
-        helperNameMap[RESOLVE_COMPONENT]
-      }("barbaz")\n`
+      `const _component_barbaz = _${helperNameMap[RESOLVE_COMPONENT]}("barbaz")\n`
     )
     // implicit self reference from SFC filename
     expect(code).toMatch(
-      `const _component_Qux = _${
-        helperNameMap[RESOLVE_COMPONENT]
-      }("Qux", true)\n`
+      `const _component_Qux = _${helperNameMap[RESOLVE_COMPONENT]}("Qux", true)\n`
     )
     expect(code).toMatch(
-      `const _directive_my_dir_0 = _${
-        helperNameMap[RESOLVE_DIRECTIVE]
-      }("my_dir_0")\n`
+      `const _directive_my_dir_0 = _${helperNameMap[RESOLVE_DIRECTIVE]}("my_dir_0")\n`
     )
     expect(code).toMatch(
-      `const _directive_my_dir_1 = _${
-        helperNameMap[RESOLVE_DIRECTIVE]
-      }("my_dir_1")\n`
+      `const _directive_my_dir_1 = _${helperNameMap[RESOLVE_DIRECTIVE]}("my_dir_1")\n`
     )
     expect(code).toMatch(`let _temp0, _temp1, _temp2`)
     expect(code).toMatchSnapshot()
index 84c3d538bbe9f104bda4430754768378fe23449b..dbc982b9c1e35dda89eef9d161bab27481e99239 100644 (file)
@@ -2871,7 +2871,7 @@ foo
       ]
     }
 
-    for (const key of Object.keys(patterns) as (keyof (typeof patterns))[]) {
+    for (const key of Object.keys(patterns) as (keyof typeof patterns)[]) {
       describe(key, () => {
         for (const { code, errors, options } of patterns[key]) {
           test(
index 04363431b9d0fa5ee2e6291d1e1671dcd3dfbb9f..e21fe7459cd8a5829724914f1fe60e10c895af16 100644 (file)
@@ -355,8 +355,9 @@ describe('compiler: hoistStatic transform', () => {
       },
       hoistedChildrenArrayMatcher(2)
     ])
-    const forBlockCodegen = ((root.children[0] as ElementNode)
-      .children[0] as ForNode).codegenNode
+    const forBlockCodegen = (
+      (root.children[0] as ElementNode).children[0] as ForNode
+    ).codegenNode
     expect(forBlockCodegen).toMatchObject({
       type: NodeTypes.VNODE_CALL,
       tag: FRAGMENT,
index 50d8d625d6557788da91f3d549095f7ad176970a..b677ca58a36e84fb311d631c04f486d1e01f157d 100644 (file)
@@ -654,8 +654,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,
index fd611cddfe9947fd899414da771bf8233a718aa3..92051b7671786bdaef965cb3d0350b01d09ba17e 100644 (file)
@@ -290,8 +290,8 @@ describe('compiler: transform v-model', () => {
   test('with dynamic argument', () => {
     const root = parseWithVModel('<input v-model:[value]="model" />')
     const node = root.children[0] as ElementNode
-    const props = ((node.codegenNode as VNodeCall)
-      .props as unknown) as CallExpression
+    const props = (node.codegenNode as VNodeCall)
+      .props as unknown as CallExpression
 
     expect(props).toMatchObject({
       type: NodeTypes.JS_CALL_EXPRESSION,
@@ -344,8 +344,8 @@ describe('compiler: transform v-model', () => {
       prefixIdentifiers: true
     })
     const node = root.children[0] as ElementNode
-    const props = ((node.codegenNode as VNodeCall)
-      .props as unknown) as CallExpression
+    const props = (node.codegenNode as VNodeCall)
+      .props as unknown as CallExpression
 
     expect(props).toMatchObject({
       type: NodeTypes.JS_CALL_EXPRESSION,
@@ -417,8 +417,9 @@ describe('compiler: transform v-model', () => {
       }
     )
     expect(root.cached).toBe(0)
-    const codegen = ((root.children[0] as ForNode)
-      .children[0] as PlainElementNode).codegenNode as VNodeCall
+    const codegen = (
+      (root.children[0] as ForNode).children[0] as PlainElementNode
+    ).codegenNode as VNodeCall
     expect(codegen.dynamicProps).toBe(`["modelValue", "onUpdate:modelValue"]`)
     expect(
       (codegen.props as ObjectExpression).properties[1].value.type
@@ -426,13 +427,10 @@ describe('compiler: transform v-model', () => {
   })
 
   test('should not cache update handler if it inside v-once', () => {
-    const root = parseWithVModel(
-      '<div v-once><input v-model="foo" /></div>',
-      {
-        prefixIdentifiers: true,
-        cacheHandlers: true
-      }
-    )
+    const root = parseWithVModel('<div v-once><input v-model="foo" /></div>', {
+      prefixIdentifiers: true,
+      cacheHandlers: true
+    })
     expect(root.cached).not.toBe(2)
     expect(root.cached).toBe(1)
   })
@@ -444,8 +442,9 @@ describe('compiler: transform v-model', () => {
         prefixIdentifiers: true
       }
     )
-    const codegen = ((root.children[0] as ComponentNode)
-      .children[0] as PlainElementNode).codegenNode as VNodeCall
+    const codegen = (
+      (root.children[0] as ComponentNode).children[0] as PlainElementNode
+    ).codegenNode as VNodeCall
     expect(codegen.dynamicProps).toBe(`["modelValue", "onUpdate:modelValue"]`)
   })
 
index fe2f6be78cea50832e5bf227cca57f35f16de798..7a8fba9c6418a7314bb3c9cde907e51abc3c964a 100644 (file)
@@ -531,10 +531,13 @@ describe('compiler: transform v-on', () => {
     })
 
     test('should not be cached inside v-once', () => {
-      const { root } = parseWithVOn(`<div v-once><div v-on:click="foo"/></div>`, {
-        prefixIdentifiers: true,
-        cacheHandlers: true
-      })
+      const { root } = parseWithVOn(
+        `<div v-once><div v-on:click="foo"/></div>`,
+        {
+          prefixIdentifiers: true,
+          cacheHandlers: true
+        }
+      )
       expect(root.cached).not.toBe(2)
       expect(root.cached).toBe(1)
     })
index 0694b4220d144c7c59f8ac6829b042f8228f7ef5..58fa76abe7ffcfe8cd4f6f4bf906acf2ff247f51 100644 (file)
@@ -237,7 +237,8 @@ export interface CompoundExpressionNode extends Node {
     | InterpolationNode
     | TextNode
     | string
-    | symbol)[]
+    | symbol
+  )[]
 
   /**
    * an expression parsed as the params of a function will track
@@ -328,7 +329,8 @@ export interface CallExpression extends Node {
     | JSChildNode
     | SSRCodegenNode
     | TemplateChildNode
-    | TemplateChildNode[])[]
+    | TemplateChildNode[]
+  )[]
 }
 
 export interface ObjectExpression extends Node {
@@ -439,8 +441,8 @@ export interface DirectiveArguments extends ArrayExpression {
 }
 
 export interface DirectiveArgumentNode extends ArrayExpression {
-  elements:  // dir, exp, arg, modifiers
-    | [string]
+  elements: // dir, exp, arg, modifiers
+  | [string]
     | [string, ExpressionNode]
     | [string, ExpressionNode, ExpressionNode]
     | [string, ExpressionNode, ExpressionNode, ObjectExpression]
@@ -449,8 +451,8 @@ export interface DirectiveArgumentNode extends ArrayExpression {
 // renderSlot(...)
 export interface RenderSlotCall extends CallExpression {
   callee: typeof RENDER_SLOT
-  arguments:  // $slots, name, props, fallback
-    | [string, string | ExpressionNode]
+  arguments: // $slots, name, props, fallback
+  | [string, string | ExpressionNode]
     | [string, string | ExpressionNode, PropsExpression]
     | [
         string,
index f37e72951464ccc4b1980ee418c258ffb7b6562f..56774e31b84d36e24b089af37668abcba66317e3 100644 (file)
@@ -444,8 +444,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]
index fa2dcfbe4604a5cef645065ec2f28d1061f6e1e6..a3442fc8a03c81448da19cf20de318416d94c26a 100644 (file)
@@ -41,8 +41,8 @@ export function getBaseTransformPreset(
             transformExpression
           ]
         : __BROWSER__ && __DEV__
-          ? [transformExpression]
-          : []),
+        ? [transformExpression]
+        : []),
       transformSlotOutlet,
       transformElement,
       trackSlotScopes,
@@ -83,9 +83,8 @@ export function baseCompile(
   }
 
   const ast = isString(template) ? baseParse(template, options) : template
-  const [nodeTransforms, directiveTransforms] = getBaseTransformPreset(
-    prefixIdentifiers
-  )
+  const [nodeTransforms, directiveTransforms] =
+    getBaseTransformPreset(prefixIdentifiers)
   transform(
     ast,
     extend({}, options, {
index 96aec726686534c82a90493da3a729222a662279..d48f93c189ac35d5a79cf22f7d85e8c4b0e5e34c 100644 (file)
@@ -774,9 +774,10 @@ function parseAttribute(
   const loc = getSelection(context, start)
 
   if (!context.inVPre && /^(v-|:|\.|@|#)/.test(name)) {
-    const match = /(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(
-      name
-    )!
+    const match =
+      /(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(
+        name
+      )!
 
     let isPropShorthand = startsWith(name, '.')
     let dirName =
@@ -784,8 +785,8 @@ function parseAttribute(
       (isPropShorthand || startsWith(name, ':')
         ? 'bind'
         : startsWith(name, '@')
-          ? 'on'
-          : 'slot')
+        ? 'on'
+        : 'slot')
     let arg: ExpressionNode | undefined
 
     if (match[2]) {
index 77164f90aeedf74a414b69d8fd320853a608f2d0..29a04bc77d568c41b268f6f9ad6717ebbeb85dc6 100644 (file)
@@ -235,8 +235,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`)
index e4b02eaab81bd24639d9624b76f9488cc2a66a65..5d3049f0c956dc0a933961a6d6c1e421173e925a 100644 (file)
@@ -86,8 +86,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,
@@ -135,8 +135,8 @@ export const transformFor = createStructuralDirectiveTransform(
           : isTemplate &&
             node.children.length === 1 &&
             isSlotOutlet(node.children[0])
-            ? (node.children[0] as SlotOutletNode) // api-extractor somehow fails to infer this
-            : null
+          ? (node.children[0] as SlotOutletNode) // api-extractor somehow fails to infer this
+          : null
 
         if (slotOutlet) {
           // <slot v-for="..."> or <template v-for="..."><slot/></template>
@@ -221,11 +221,13 @@ export const transformFor = createStructuralDirectiveTransform(
             createSimpleExpression(String(context.cached++))
           )
         } else {
-          renderExp.arguments.push(createFunctionExpression(
-            createForLoopParams(forNode.parseResult),
-            childBlock,
-            true /* force newline */
-          ) as ForIteratorExpression)
+          renderExp.arguments.push(
+            createFunctionExpression(
+              createForLoopParams(forNode.parseResult),
+              childBlock,
+              true /* force newline */
+            ) as ForIteratorExpression
+          )
         }
       }
     })
@@ -343,9 +345,7 @@ export function parseForExpression(
     validateBrowserExpression(result.source as SimpleExpressionNode, context)
   }
 
-  let valueContent = LHS.trim()
-    .replace(stripParensRE, '')
-    .trim()
+  let valueContent = LHS.trim().replace(stripParensRE, '').trim()
   const trimmedOffset = LHS.indexOf(valueContent)
 
   const iteratorMatch = valueContent.match(forIteratorRE)
index 01810090c4436715bb0133f6dc281221478ae8bb..0c18597d2ebb75e80b7121b7be33f7e52f38c34e 100644 (file)
@@ -319,8 +319,8 @@ function isSameKey(
     }
     if (
       exp.type !== NodeTypes.SIMPLE_EXPRESSION ||
-      (exp.isStatic !== (branchExp as SimpleExpressionNode).isStatic ||
-        exp.content !== (branchExp as SimpleExpressionNode).content)
+      exp.isStatic !== (branchExp as SimpleExpressionNode).isStatic ||
+      exp.content !== (branchExp as SimpleExpressionNode).content
     ) {
       return false
     }
index 1e784c82b6a28d5a5d8de45d5dfc63cd2afe21df..68aa1f67ccd523055667fcc12f470ff897c8b695 100644 (file)
@@ -337,8 +337,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(
index b02379178df3a7931c83f47adc4305fc32bd2dd9..88e91d6c9be48d1846d9224aa6e7c35323728ea2 100644 (file)
@@ -273,7 +273,7 @@ export function hasDynamicKeyVBind(node: ElementNode): boolean {
       p.type === NodeTypes.DIRECTIVE &&
       p.name === 'bind' &&
       (!p.arg || // v-bind="obj"
-      p.arg.type !== NodeTypes.SIMPLE_EXPRESSION || // v-bind:[_ctx.foo]
+        p.arg.type !== NodeTypes.SIMPLE_EXPRESSION || // v-bind:[_ctx.foo]
         !p.arg.isStatic) // v-bind:[foo]
   )
 }
index 3ba985727186697d0b6dc5bcc984c7440e6d60aa..fce56773b27d1063980425a98fd5cc9371d8bed8 100644 (file)
@@ -18,7 +18,8 @@ const prohibitedKeywordRE = new RegExp(
 )
 
 // strip strings in expressions
-const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g
+const stripStringRE =
+  /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g
 
 /**
  * Validate a non-prefixed expression.
@@ -51,9 +52,7 @@ export function validateBrowserExpression(
       .replace(stripStringRE, '')
       .match(prohibitedKeywordRE)
     if (keywordMatch) {
-      message = `avoid using JavaScript keyword as property name: "${
-        keywordMatch[0]
-      }"`
+      message = `avoid using JavaScript keyword as property name: "${keywordMatch[0]}"`
     }
     context.onError(
       createCompilerError(
index b148422b8b2b2717e88b4c563ce8e5a319ba853f..efc7fee374f7f321c48b4d81b565c74e556f5721 100644 (file)
@@ -27,8 +27,10 @@ function parseWithVOn(template: string, options: CompilerOptions = {}) {
   })
   return {
     root: ast,
-    props: (((ast.children[0] as ElementNode).codegenNode as VNodeCall)
-      .props as ObjectExpression).properties
+    props: (
+      ((ast.children[0] as ElementNode).codegenNode as VNodeCall)
+        .props as ObjectExpression
+    ).properties
   }
 }
 
index d2207b3fc80e7485b7d08684c8a9bea9c9581ea1..660003b4839202ed773f398dda8d6bf3eafe7cfc 100644 (file)
@@ -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) => {
@@ -112,11 +112,8 @@ export const transformOn: DirectiveTransform = (dir, node, context) => {
     if (!modifiers.length) return baseResult
 
     let { key, value: handlerExp } = baseResult.props[0]
-    const {
-      keyModifiers,
-      nonKeyModifiers,
-      eventOptionModifiers
-    } = resolveModifiers(key, modifiers, context, dir.loc)
+    const { keyModifiers, nonKeyModifiers, eventOptionModifiers } =
+      resolveModifiers(key, modifiers, context, dir.loc)
 
     // normalize click.right and click.middle since they don't actually fire
     if (nonKeyModifiers.includes('right')) {
index 6dbb7680baf55db88af3670d3a9c53184ff2a3be..ba25358371cb4cb58e7339bda77d18a05cfe7cd4 100644 (file)
@@ -59,8 +59,8 @@ describe('compiler sfc: transform asset url', () => {
   test('with explicit base', () => {
     const { code } = compileWithAssetUrls(
       `<img src="./bar.png"></img>` + // -> /foo/bar.png
-      `<img src="bar.png"></img>` + // -> bar.png (untouched)
-      `<img src="~bar.png"></img>` + // -> still converts to import
+        `<img src="bar.png"></img>` + // -> bar.png (untouched)
+        `<img src="~bar.png"></img>` + // -> still converts to import
         `<img src="@theme/bar.png"></img>`, // -> still converts to import
       {
         base: '/foo'
index 9999bcc7a72045038fd06d9a4db24baecb01fe9a..432d977fa341179f224ef1f9412c4e92e7bee4e6 100644 (file)
@@ -678,7 +678,9 @@ export function compileScript(
       .map(key => {
         let defaultString: string | undefined
         if (hasStaticDefaults) {
-          const prop = (propsRuntimeDefaults as ObjectExpression).properties.find(
+          const prop = (
+            propsRuntimeDefaults as ObjectExpression
+          ).properties.find(
             (node: any) => node.key.name === key
           ) as ObjectProperty
           if (prop) {
@@ -776,9 +778,7 @@ export function compileScript(
             // rewrite to `import { x as __default__ } from './x'` and
             // add to top
             s.prepend(
-              `import { ${
-                defaultSpecifier.local.name
-              } as ${defaultTempVar} } from '${node.source.value}'\n`
+              `import { ${defaultSpecifier.local.name} as ${defaultTempVar} } from '${node.source.value}'\n`
             )
           } else {
             // export { x as default }
@@ -1376,11 +1376,11 @@ export function compileScript(
     ...scriptSetup,
     bindings: bindingMetadata,
     content: s.toString(),
-    map: (s.generateMap({
+    map: s.generateMap({
       source: filename,
       hires: true,
       includeContent: true
-    }) as unknown) as RawSourceMap,
+    }) as unknown as RawSourceMap,
     scriptAst,
     scriptSetupAst
   }
@@ -1470,8 +1470,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)
@@ -1507,8 +1507,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 identifer when destructuring
@@ -1523,8 +1523,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)
@@ -1651,9 +1651,9 @@ function inferRuntimeType(
     case 'TSUnionType':
       return [
         ...new Set(
-          [].concat(node.types.map(t =>
-            inferRuntimeType(t, declaredTypes)
-          ) as any)
+          [].concat(
+            node.types.map(t => inferRuntimeType(t, declaredTypes)) as any
+          )
         )
       ]
     case 'TSIntersectionType':
@@ -1668,8 +1668,8 @@ function toRuntimeTypeString(types: string[]) {
   return types.some(t => t === 'null')
     ? `null`
     : types.length > 1
-      ? `[${types.join(', ')}]`
-      : types[0]
+    ? `[${types.join(', ')}]`
+    : types[0]
 }
 
 function extractRuntimeEmits(
index 7da2713c4a095709a0862745edf95bcb59b4e148..4a87a2b0339c70664426a273c86b82f3ad8de9a6 100644 (file)
@@ -79,9 +79,10 @@ export function compileStyle(
 export function compileStyleAsync(
   options: SFCAsyncStyleCompileOptions
 ): Promise<SFCStyleCompileResults> {
-  return doCompileStyle({ ...options, isAsync: true }) as Promise<
-    SFCStyleCompileResults
-  >
+  return doCompileStyle({
+    ...options,
+    isAsync: true
+  }) as Promise<SFCStyleCompileResults>
 }
 
 export function doCompileStyle(
index 9fa099a30793d1242b634fab3a425c3664ffe29b..b980cc3c154117c710d41b690e68ac280b552c1b 100644 (file)
@@ -140,14 +140,10 @@ export function compileTemplate(
       code: `export default function render() {}`,
       source: options.source,
       tips: [
-        `Component ${
-          options.filename
-        } uses lang ${preprocessLang} for template. Please install the language preprocessor.`
+        `Component ${options.filename} uses lang ${preprocessLang} for template. Please install the language preprocessor.`
       ],
       errors: [
-        `Component ${
-          options.filename
-        } uses lang ${preprocessLang} for template, however it is not installed.`
+        `Component ${options.filename} uses lang ${preprocessLang} for template, however it is not installed.`
       ]
     }
   } else {
index 884742f2978956b13880666d542d325cab999963..853db99f7fe506f4052029854650cdc51f712c24 100644 (file)
@@ -12,7 +12,8 @@ import { PluginCreator } from 'postcss'
 import hash from 'hash-sum'
 
 export const CSS_VARS_HELPER = `useCssVars`
-export const cssVarRE = /\bv-bind\(\s*(?:'([^']+)'|"([^"]+)"|([^'"][^)]*))\s*\)/g
+export const cssVarRE =
+  /\bv-bind\(\s*(?:'([^']+)'|"([^"]+)"|([^'"][^)]*))\s*\)/g
 
 export function genCssVarsFromList(
   vars: string[],
index 44a7d41ad44d5b79f7459b49ee9f6cf540861b80..f4b2f2e87ae889e0e5000d991dccb4a1b5166ed9 100644 (file)
@@ -3,7 +3,8 @@ import MagicString from 'magic-string'
 
 const defaultExportRE = /((?:^|\n|;)\s*)export(\s*)default/
 const namedDefaultExportRE = /((?:^|\n|;)\s*)export(.+)as(\s*)default/s
-const exportDefaultClassRE = /((?:^|\n|;)\s*)export\s+default\s+class\s+([\w$]+)/
+const exportDefaultClassRE =
+  /((?:^|\n|;)\s*)export\s+default\s+class\s+([\w$]+)/
 
 /**
  * Utility for rewriting `export default` in a script block into a variable
index 796fd41f70bfc9c8625940ed786462806b09ff70..d77b607a296d98c32b8c35a427e38bf5fece720d 100644 (file)
@@ -71,9 +71,10 @@ describe('ssr: element', () => {
       `)
     })
 
-    test("multiple _ssrInterpolate at parent and child import dependency once", () => {
-      expect( compile(`<div>{{ hello }}<textarea v-bind="a"></textarea></div>`).code)
-      .toMatchInlineSnapshot(`
+    test('multiple _ssrInterpolate at parent and child import dependency once', () => {
+      expect(
+        compile(`<div>{{ hello }}<textarea v-bind="a"></textarea></div>`).code
+      ).toMatchInlineSnapshot(`
         "const { ssrRenderAttrs: _ssrRenderAttrs, ssrInterpolate: _ssrInterpolate } = require(\\"@vue/server-renderer\\")
 
         return function ssrRender(_ctx, _push, _parent, _attrs) {
@@ -89,8 +90,8 @@ describe('ssr: element', () => {
             _ssrInterpolate((\\"value\\" in _temp0) ? _temp0.value : \\"\\")
           }</textarea></div>\`)
         }"
-      `);
-    });
+      `)
+    })
 
     test('should pass tag to custom elements w/ dynamic v-bind', () => {
       expect(
index 7f53ee62c4eade3129d8a61ab8262817b6bdf957..c30b90aa1313d5cc7d485a8758e41caa28dfba1b 100644 (file)
@@ -56,11 +56,10 @@ export function ssrCodegenTransform(ast: RootNode, options: CompilerOptions) {
 
   // Finalize helpers.
   // We need to separate helpers imported from 'vue' vs. '@vue/server-renderer'
-  ast.ssrHelpers = Array.from(new Set([  
-    ...ast.helpers.filter(h => h in ssrHelpers),
-    ...context.helpers
-  ]))
-  
+  ast.ssrHelpers = Array.from(
+    new Set([...ast.helpers.filter(h => h in ssrHelpers), ...context.helpers])
+  )
+
   ast.helpers = ast.helpers.filter(h => !(h in ssrHelpers))
 }
 
index ecc1379b107eaed5567346c9e08032750756a589..ccbca9fdc7a8dd97cdf7ef63fe4c1afbfa1fcd3c 100644 (file)
@@ -225,9 +225,8 @@ export function ssrProcessComponent(
 
 export const rawOptionsMap = new WeakMap<RootNode, CompilerOptions>()
 
-const [baseNodeTransforms, baseDirectiveTransforms] = getBaseTransformPreset(
-  true
-)
+const [baseNodeTransforms, baseDirectiveTransforms] =
+  getBaseTransformPreset(true)
 const vnodeNodeTransforms = [...baseNodeTransforms, ...DOMNodeTransforms]
 const vnodeDirectiveTransforms = {
   ...baseDirectiveTransforms,
index 72ab2fe93b2972f9d172dfc957592e4b7f6941e8..9b7e3795e69283b82e7e93a2db2aa6a746e6748b 100644 (file)
@@ -24,9 +24,7 @@ declare namespace jest {
   }
 }
 
-declare module '*.vue' {
-
-}
+declare module '*.vue' {}
 declare module '*?raw' {
   const content: string
   export default content
index b5936c07101776d8e2af9fe06d31a28a1e75eec0..5bd5f24640b8004331aeba01e642cc6df452df3e 100644 (file)
@@ -422,7 +422,7 @@ describe('reactivity/collections', () => {
       const proxy = reactive(raw)
       const thisArg = {}
       let count = 0
-      proxy.forEach(function(this: {}, value, _, set) {
+      proxy.forEach(function (this: {}, value, _, set) {
         ++count
         expect(this).toBe(thisArg)
         expect(value).toBe('value')
index c8bf65b3876c191ed06febb9b944579891158019..63426bb5e9c1a701aacac175973a1ca84c50571c 100644 (file)
@@ -178,7 +178,10 @@ describe('reactivity/readonly', () => {
       test('should make nested values readonly', () => {
         const key1 = {}
         const key2 = {}
-        const original = new Collection([[key1, {}], [key2, {}]])
+        const original = new Collection([
+          [key1, {}],
+          [key2, {}]
+        ])
         const wrapped = readonly(original)
         expect(wrapped).not.toBe(original)
         expect(isProxy(wrapped)).toBe(true)
@@ -228,7 +231,10 @@ describe('reactivity/readonly', () => {
         test('should retrieve readonly values on iteration', () => {
           const key1 = {}
           const key2 = {}
-          const original = new Map([[key1, {}], [key2, {}]])
+          const original = new Map([
+            [key1, {}],
+            [key2, {}]
+          ])
           const wrapped: any = readonly(original)
           expect(wrapped.size).toBe(2)
           for (const [key, value] of wrapped) {
@@ -246,7 +252,12 @@ describe('reactivity/readonly', () => {
         test('should retrieve reactive + readonly values on iteration', () => {
           const key1 = {}
           const key2 = {}
-          const original = reactive(new Map([[key1, {}], [key2, {}]]))
+          const original = reactive(
+            new Map([
+              [key1, {}],
+              [key2, {}]
+            ])
+          )
           const wrapped: any = readonly(original)
           expect(wrapped.size).toBe(2)
           for (const [key, value] of wrapped) {
index 8ce7f756e1349018fd999b84acb18c7f702dc0ed..29367007c1381bded8f8ca97794090d785171ac5 100644 (file)
@@ -49,7 +49,7 @@ function createArrayInstrumentations() {
   // instrument identity-sensitive Array methods to account for possible reactive
   // values
   ;(['includes', 'indexOf', 'lastIndexOf'] as const).forEach(key => {
-    instrumentations[key] = function(this: unknown[], ...args: unknown[]) {
+    instrumentations[key] = function (this: unknown[], ...args: unknown[]) {
       const arr = toRaw(this) as any
       for (let i = 0, l = this.length; i < l; i++) {
         track(arr, TrackOpTypes.GET, i + '')
@@ -67,7 +67,7 @@ function createArrayInstrumentations() {
   // instrument length-altering mutation methods to avoid length being tracked
   // which leads to infinite loops in some cases (#2137)
   ;(['push', 'pop', 'shift', 'unshift', 'splice'] as const).forEach(key => {
-    instrumentations[key] = function(this: unknown[], ...args: unknown[]) {
+    instrumentations[key] = function (this: unknown[], ...args: unknown[]) {
       pauseTracking()
       const res = (toRaw(this) as any)[key].apply(this, args)
       resetTracking()
@@ -91,8 +91,8 @@ function createGetter(isReadonly = false, shallow = false) {
             ? shallowReadonlyMap
             : readonlyMap
           : shallow
-            ? shallowReactiveMap
-            : reactiveMap
+          ? shallowReactiveMap
+          : reactiveMap
         ).get(target)
     ) {
       return target
index 0d62ba57812fff0d4500f878f6e0287a1f2bde97..fe79ad9e66c4e3b70f58107b4412c833223e4ddb 100644 (file)
@@ -184,7 +184,7 @@ function createIterableMethod(
   isReadonly: boolean,
   isShallow: boolean
 ) {
-  return function(
+  return function (
     this: IterableCollections,
     ...args: unknown[]
   ): Iterable & Iterator {
@@ -224,7 +224,7 @@ function createIterableMethod(
 }
 
 function createReadonlyMethod(type: TriggerOpTypes): Function {
-  return function(this: CollectionTypes, ...args: unknown[]) {
+  return function (this: CollectionTypes, ...args: unknown[]) {
     if (__DEV__) {
       const key = args[0] ? `on key "${args[0]}" ` : ``
       console.warn(
@@ -242,7 +242,7 @@ function createInstrumentations() {
       return get(this, key)
     },
     get size() {
-      return size((this as unknown) as IterableCollections)
+      return size(this as unknown as IterableCollections)
     },
     has,
     add,
@@ -257,7 +257,7 @@ function createInstrumentations() {
       return get(this, key, false, true)
     },
     get size() {
-      return size((this as unknown) as IterableCollections)
+      return size(this as unknown as IterableCollections)
     },
     has,
     add,
@@ -272,7 +272,7 @@ function createInstrumentations() {
       return get(this, key, true)
     },
     get size() {
-      return size((this as unknown) as IterableCollections, true)
+      return size(this as unknown as IterableCollections, true)
     },
     has(this: MapTypes, key: unknown) {
       return has.call(this, key, true)
@@ -289,7 +289,7 @@ function createInstrumentations() {
       return get(this, key, true, true)
     },
     get size() {
-      return size((this as unknown) as IterableCollections, true)
+      return size(this as unknown as IterableCollections, true)
     },
     has(this: MapTypes, key: unknown) {
       return has.call(this, key, true)
@@ -346,8 +346,8 @@ function createInstrumentationGetter(isReadonly: boolean, shallow: boolean) {
       ? shallowReadonlyInstrumentations
       : shallowInstrumentations
     : isReadonly
-      ? readonlyInstrumentations
-      : mutableInstrumentations
+    ? readonlyInstrumentations
+    : mutableInstrumentations
 
   return (
     target: CollectionTypes,
@@ -384,11 +384,10 @@ export const readonlyCollectionHandlers: ProxyHandler<CollectionTypes> = {
   get: /*#__PURE__*/ createInstrumentationGetter(true, false)
 }
 
-export const shallowReadonlyCollectionHandlers: ProxyHandler<
-  CollectionTypes
-> = {
-  get: /*#__PURE__*/ createInstrumentationGetter(true, true)
-}
+export const shallowReadonlyCollectionHandlers: ProxyHandler<CollectionTypes> =
+  {
+    get: /*#__PURE__*/ createInstrumentationGetter(true, true)
+  }
 
 function checkIdentityKeys(
   target: CollectionTypes,
index fdc5c58f8082bebdbbe3a586f256fa8ad0eaa5a4..dec3a833c57acdf2a05b079d82a3312829e070ec 100644 (file)
@@ -37,7 +37,7 @@ class ComputedRefImpl<T> {
   private _dirty = true
   public readonly effect: ReactiveEffect<T>
 
-  public readonly __v_isRef = true;
+  public readonly __v_isRef = true
   public readonly [ReactiveFlags.IS_READONLY]: boolean
 
   constructor(
index 2137e7cfb67aa0f74e69f441a5c8f00c3c4d16ce..148a583c06f4a2518e6333b39f7a6cf992ccc7ab 100644 (file)
@@ -119,22 +119,22 @@ 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 {}
-                  ? { 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 {}
+  ? { readonly [K in keyof T]: DeepReadonly<T[K]> }
+  : Readonly<T>
 
 /**
  * Creates a readonly copy of the original object. Note the returned copy is not
index 5648bb264ca47faacdfd024ca3d8929b4a24f76c..010fb8d85bd236a2f984fec44d6e71f5bf7ec287 100644 (file)
@@ -259,8 +259,10 @@ export type ShallowUnwrapRef<T> = {
   [K in keyof T]: T[K] extends Ref<infer V>
     ? V
     : T[K] extends Ref<infer V> | undefined // if `V` is `unknown` that means it does not extend `Ref` and is undefined
-      ? unknown extends V ? undefined : V | undefined
-      : T[K]
+    ? unknown extends V
+      ? undefined
+      : V | undefined
+    : T[K]
 }
 
 export type UnwrapRef<T> = T extends Ref<infer V>
@@ -275,8 +277,10 @@ type UnwrapRefSimple<T> = T extends
   | RefUnwrapBailTypes[keyof RefUnwrapBailTypes]
   ? T
   : T extends Array<any>
-    ? { [K in keyof T]: UnwrapRefSimple<T[K]> }
-    : T extends object ? UnwrappedObject<T> : T
+  ? { [K in keyof T]: UnwrapRefSimple<T[K]> }
+  : T extends object
+  ? UnwrappedObject<T>
+  : T
 
 // Extract all known symbols from an object
 // when unwrapping Object the symbols are not `in keyof`, this should cover all the
index 3dc22e67ce5b459b5694cdc5687361ffe59569de..1f2852d5a490cebdc907e1ed9aad8c80a2eeb73c 100644 (file)
@@ -123,15 +123,16 @@ describe('SFC <script setup> helpers', () => {
 
           beforeInstance = getCurrentInstance()
 
-          const msg = (([__temp, __restore] = withAsyncContext(
-            () =>
-              new Promise(r => {
-                resolve = r
-              })
-          )),
-          (__temp = await __temp),
-          __restore(),
-          __temp)
+          const msg =
+            (([__temp, __restore] = withAsyncContext(
+              () =>
+                new Promise(r => {
+                  resolve = r
+                })
+            )),
+            (__temp = await __temp),
+            __restore(),
+            __temp)
 
           // register the lifecycle after an await statement
           onMounted(spy)
@@ -141,7 +142,10 @@ describe('SFC <script setup> helpers', () => {
       })
 
       const root = nodeOps.createElement('div')
-      render(h(() => h(Suspense, () => h(Comp))), root)
+      render(
+        h(() => h(Suspense, () => h(Comp))),
+        root
+      )
 
       expect(spy).not.toHaveBeenCalled()
       resolve!('hello')
@@ -186,7 +190,10 @@ describe('SFC <script setup> helpers', () => {
       })
 
       const root = nodeOps.createElement('div')
-      render(h(() => h(Suspense, () => h(Comp))), root)
+      render(
+        h(() => h(Suspense, () => h(Comp))),
+        root
+      )
 
       expect(spy).not.toHaveBeenCalled()
       reject!()
@@ -242,7 +249,10 @@ describe('SFC <script setup> helpers', () => {
       })
 
       const root = nodeOps.createElement('div')
-      render(h(() => h(Suspense, () => h(Comp))), root)
+      render(
+        h(() => h(Suspense, () => h(Comp))),
+        root
+      )
 
       await ready
       expect(inBandInstance).toBe(beforeInstance)
index 1c82d20ec42913da4fe9f103d6cdf610a0ae67e5..2c30b58add3dd21615be203806755543b945abb6 100644 (file)
@@ -115,8 +115,8 @@ describe('api: template refs', () => {
     const fn = jest.fn()
     const toggle = ref(true)
 
-    const Comp = defineComponent(() => () =>
-      toggle.value ? h('div', { ref: fn }) : null
+    const Comp = defineComponent(
+      () => () => toggle.value ? h('div', { ref: fn }) : null
     )
     render(h(Comp), root)
     expect(fn.mock.calls[0][0]).toBe(root.children[0])
index 87644742cca320c3c38d5b1b23d326c2e2869110..1fa946c3e05a24dcba51c233895c911a6322c050 100644 (file)
@@ -168,7 +168,10 @@ describe('api: watch', () => {
     state.count++
     count.value++
     await nextTick()
-    expect(dummy).toMatchObject([[2, 2, 3], [1, 1, 2]])
+    expect(dummy).toMatchObject([
+      [2, 2, 3],
+      [1, 1, 2]
+    ])
   })
 
   it('watching multiple sources: readonly array', async () => {
@@ -188,7 +191,10 @@ describe('api: watch', () => {
     state.count++
     status.value = true
     await nextTick()
-    expect(dummy).toMatchObject([[2, true], [1, false]])
+    expect(dummy).toMatchObject([
+      [2, true],
+      [1, false]
+    ])
   })
 
   it('watching multiple sources: reactive object (with automatic deep: true)', async () => {
@@ -568,7 +574,10 @@ describe('api: watch', () => {
         count: ref(0)
       },
       array: [1, 2, 3],
-      map: new Map([['a', 1], ['b', 2]]),
+      map: new Map([
+        ['a', 1],
+        ['b', 2]
+      ]),
       set: new Set([1, 2, 3])
     })
 
@@ -868,7 +877,10 @@ describe('api: watch', () => {
       mounted() {
         // this call runs while Comp is currentInstance, but
         // the effect for this `$watch` should nontheless be registered with Child
-        this.comp!.$watch(() => this.show, () => void 0)
+        this.comp!.$watch(
+          () => this.show,
+          () => void 0
+        )
       }
     })
 
@@ -895,7 +907,7 @@ describe('api: watch', () => {
       render() {},
       created(this: any) {
         instance = this
-        this.$watch(source, function() {})
+        this.$watch(source, function () {})
       }
     })
 
index 4411771ae39b55a0bbfe7a2afec708cb49df5c29..c4c456b5f7ae8b180187ace0db4201fe2344b837 100644 (file)
@@ -97,7 +97,7 @@ describe('component: proxy', () => {
     expect(() => (instanceProxy.$data = {})).toThrow(TypeError)
     expect(`Attempting to mutate public property "$data"`).toHaveBeenWarned()
 
-    const nextTickThis = await instanceProxy.$nextTick(function(this: any) {
+    const nextTickThis = await instanceProxy.$nextTick(function (this: any) {
       return this
     })
     expect(nextTickThis).toBe(instanceProxy)
index dcc8105bfecee1b8519b26f28d7444aa2c32a273..ade8fffa7d72da1c6b29a5b2cf96d35265bc3af7 100644 (file)
@@ -258,9 +258,8 @@ describe('BaseTransition', () => {
     ) {
       const toggle = ref(true)
       const { props, cbs } = mockProps({ mode })
-      const root = mount(
-        props,
-        () => (toggle.value ? trueBranch() : falseBranch())
+      const root = mount(props, () =>
+        toggle.value ? trueBranch() : falseBranch()
       )
 
       // without appear: true, enter hooks should not be called on mount
@@ -348,9 +347,8 @@ describe('BaseTransition', () => {
     }: ToggleOptions) {
       const toggle = ref(false)
       const { props, cbs } = mockProps()
-      const root = mount(
-        props,
-        () => (toggle.value ? trueBranch() : falseBranch())
+      const root = mount(props, () =>
+        toggle.value ? trueBranch() : falseBranch()
       )
 
       // start enter
index 062c0e0a8ba28745e43ab3dcf2c51865beb4f738..4dce5d144cfdff8afa8d008013217614faab6151 100644 (file)
@@ -841,10 +841,8 @@ describe('KeepAlive', () => {
     const instanceRef = ref<any>(null)
     const App = {
       render: () => {
-        return h(
-          KeepAlive,
-          { include: 'Foo' },
-          () => (toggle.value ? h(AsyncComp, { ref: instanceRef }) : null)
+        return h(KeepAlive, { include: 'Foo' }, () =>
+          toggle.value ? h(AsyncComp, { ref: instanceRef }) : null
         )
       }
     }
index e0a50b140c98aeca7a7a732d1790a3475763e968..e5f76e307002abf8f302e759d0ef64a88e1cd74a 100644 (file)
@@ -106,7 +106,10 @@ describe('renderer: teleport', () => {
     const root = nodeOps.createElement('div')
     const children = ref([h('div', 'teleported')])
 
-    render(h(() => h(Teleport, { to: target }, children.value)), root)
+    render(
+      h(() => h(Teleport, { to: target }, children.value)),
+      root
+    )
     expect(serializeInner(target)).toMatchInlineSnapshot(
       `"<div>teleported</div>"`
     )
index 7f1de631ad8a9af800e9942f1b29f814192a3796..8c6d76997b36b400c8d5fcd4091ee4990c1e3433 100644 (file)
@@ -42,7 +42,10 @@ describe('createSlot', () => {
   it('should add each slot to the record when given slot is an array', () => {
     const dynamicSlot = [
       { name: 'descriptor', fn: slot },
-      [{ name: 'descriptor2', fn: slot }, { name: 'descriptor3', fn: slot }]
+      [
+        { name: 'descriptor2', fn: slot },
+        { name: 'descriptor3', fn: slot }
+      ]
     ]
 
     const actual = createSlots(record, dynamicSlot)
index 48b2930c11f1d7ad3a87b36fa602270dea2e566f..06d2825df3683f009711aa5cb643c40963db5c61 100644 (file)
@@ -38,7 +38,7 @@ describe('renderList', () => {
   })
 
   it('should render an item for entry in an iterable', () => {
-    const iterable = function*() {
+    const iterable = function* () {
       yield 1
       yield 2
       yield 3
index ffe54882b5208fe7d8a3c475a941fcb53fbbdf91..80258554b03d56449de86be6ff07531777de682d 100644 (file)
@@ -759,9 +759,11 @@ describe('SSR hydration', () => {
     })
 
     expect(
-      (app.mount(svgContainer).$.subTree as VNode<Node, Element> & {
-        el: Element
-      }).el instanceof SVGElement
+      (
+        app.mount(svgContainer).$.subTree as VNode<Node, Element> & {
+          el: Element
+        }
+      ).el instanceof SVGElement
     )
   })
 
index 90e88c4b06b93ed7b2b0099f7e8b058dc392e7b4..a8edbe72c9b8e3f6612004fa0fb491fe1ff64d2d 100644 (file)
@@ -321,21 +321,28 @@ describe('renderer: keyed children', () => {
     }
 
     for (let n = 0; n < samples; ++n) {
-      render(h('span', arr.map(n => spanNumWithOpacity(n, '1'))), root)
+      render(
+        h(
+          'span',
+          arr.map(n => spanNumWithOpacity(n, '1'))
+        ),
+        root
+      )
       elm = root.children[0] as TestElement
 
       for (let i = 0; i < elms; ++i) {
         expect(serializeInner(elm.children[i] as TestElement)).toBe(
           i.toString()
         )
-        opacities[i] = Math.random()
-          .toFixed(5)
-          .toString()
+        opacities[i] = Math.random().toFixed(5).toString()
       }
 
       const shufArr = shuffle(arr.slice(0))
       render(
-        h('span', arr.map(n => spanNumWithOpacity(shufArr[n], opacities[n]))),
+        h(
+          'span',
+          arr.map(n => spanNumWithOpacity(shufArr[n], opacities[n]))
+        ),
         root
       )
       elm = root.children[0] as TestElement
index 889ec05131ca957448778b4f2be2422a2da1762c..09e3cb997e321927e0c7c3181dba70a09476000b 100644 (file)
@@ -217,7 +217,10 @@ describe('renderer: component', () => {
     const Child = {
       props: ['value'],
       setup(props: any, { emit }: SetupContext) {
-        watch(() => props.value, (val: number) => emit('update', val))
+        watch(
+          () => props.value,
+          (val: number) => emit('update', val)
+        )
 
         return () => {
           return h('div', props.value)
index 59deb5a00e2d3a48156b7214919f81ca838e154a..90e3e28b88ae683415e3af9bc3d73834b6ebb862 100644 (file)
@@ -417,11 +417,12 @@ describe('renderer: optimized mode', () => {
     const Comp = defineComponent({
       setup(_props, { slots }) {
         return () => {
-          const vnode = (openBlock(),
-          (block = createBlock('div', null, {
-            default: withCtx(() => [renderSlot(slots, 'default')]),
-            _: SlotFlags.FORWARDED
-          })))
+          const vnode =
+            (openBlock(),
+            (block = createBlock('div', null, {
+              default: withCtx(() => [renderSlot(slots, 'default')]),
+              _: SlotFlags.FORWARDED
+            })))
 
           return vnode
         }
@@ -449,8 +450,9 @@ describe('renderer: optimized mode', () => {
     expect(block!.dynamicChildren![0].type).toBe(Fragment)
     expect(block!.dynamicChildren![0].dynamicChildren!.length).toBe(1)
     expect(
-      serialize(block!.dynamicChildren![0].dynamicChildren![0]
-        .el as TestElement)
+      serialize(
+        block!.dynamicChildren![0].dynamicChildren![0].el as TestElement
+      )
     ).toBe('<p>0</p>')
 
     foo.value++
index c3c64970629a993612daa7cbb3a021170cf9f20c..606da2887cf95138f94cfd27b530b8080493348f 100644 (file)
@@ -226,7 +226,7 @@ describe('backwards compat with <=3.0.7', () => {
   test('should work on slots', () => {
     const Child = {
       __scopeId: 'child',
-      render: withChildId(function(this: any) {
+      render: withChildId(function (this: any) {
         return h('div', renderSlot(this.$slots, 'default'))
       })
     }
index b5a501053174fb3b5e4b83b7ba3835dbc0f5a851..3aae17ca0d882cb8226e2eb2f2d620bc8dd80a50 100644 (file)
@@ -411,9 +411,9 @@ describe('vnode', () => {
     })
 
     test('handlers', () => {
-      let clickHandler1 = function() {}
-      let clickHandler2 = function() {}
-      let focusHandler2 = function() {}
+      let clickHandler1 = function () {}
+      let clickHandler2 = function () {}
+      let focusHandler2 = function () {}
 
       let props1: Data = { onClick: clickHandler1 }
       let props2: Data = { onClick: clickHandler2, onFocus: focusHandler2 }
@@ -439,37 +439,41 @@ describe('vnode', () => {
     test('with patchFlags', () => {
       const hoist = createVNode('div')
       let vnode1
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        hoist,
-        (vnode1 = createVNode('div', null, 'text', PatchFlags.TEXT))
-      ]))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, [
+          hoist,
+          (vnode1 = createVNode('div', null, 'text', PatchFlags.TEXT))
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([vnode1])
     })
 
     test('should not track vnodes with only HYDRATE_EVENTS flag', () => {
       const hoist = createVNode('div')
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        hoist,
-        createVNode('div', null, 'text', PatchFlags.HYDRATE_EVENTS)
-      ]))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, [
+          hoist,
+          createVNode('div', null, 'text', PatchFlags.HYDRATE_EVENTS)
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([])
     })
 
     test('many times call openBlock', () => {
       const hoist = createVNode('div')
       let vnode1, vnode2, vnode3
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        hoist,
-        (vnode1 = createVNode('div', null, 'text', PatchFlags.TEXT)),
-        (vnode2 = (openBlock(),
+      const vnode =
+        (openBlock(),
         createBlock('div', null, [
           hoist,
-          (vnode3 = createVNode('div', null, 'text', PatchFlags.TEXT))
-        ])))
-      ]))
+          (vnode1 = createVNode('div', null, 'text', PatchFlags.TEXT)),
+          (vnode2 =
+            (openBlock(),
+            createBlock('div', null, [
+              hoist,
+              (vnode3 = createVNode('div', null, 'text', PatchFlags.TEXT))
+            ])))
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([vnode1, vnode2])
       expect(vnode2.dynamicChildren).toStrictEqual([vnode3])
     })
@@ -477,33 +481,36 @@ describe('vnode', () => {
     test('with stateful component', () => {
       const hoist = createVNode('div')
       let vnode1
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        hoist,
-        (vnode1 = createVNode({}, null, 'text'))
-      ]))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, [
+          hoist,
+          (vnode1 = createVNode({}, null, 'text'))
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([vnode1])
     })
 
     test('with functional component', () => {
       const hoist = createVNode('div')
       let vnode1
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        hoist,
-        (vnode1 = createVNode(() => {}, null, 'text'))
-      ]))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, [
+          hoist,
+          (vnode1 = createVNode(() => {}, null, 'text'))
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([vnode1])
     })
 
     test('with suspense', () => {
       const hoist = createVNode('div')
       let vnode1
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        hoist,
-        (vnode1 = createVNode(() => {}, null, 'text'))
-      ]))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, [
+          hoist,
+          (vnode1 = createVNode(() => {}, null, 'text'))
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([vnode1])
     })
 
@@ -516,32 +523,35 @@ describe('vnode', () => {
     test('element block should track normalized slot children', () => {
       const hoist = createVNode('div')
       let vnode1: any
-      const vnode = (openBlock(),
-      createBlock('div', null, {
-        default: () => {
-          return [
-            hoist,
-            (vnode1 = createVNode('div', null, 'text', PatchFlags.TEXT))
-          ]
-        }
-      }))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, {
+          default: () => {
+            return [
+              hoist,
+              (vnode1 = createVNode('div', null, 'text', PatchFlags.TEXT))
+            ]
+          }
+        }))
       expect(vnode.dynamicChildren).toStrictEqual([vnode1])
     })
 
     test('openBlock w/ disableTracking: true', () => {
       const hoist = createVNode('div')
       let vnode1
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        // a v-for fragment block generated by the compiler
-        // disables tracking because it always diffs its
-        // children.
-        (vnode1 = (openBlock(true),
-        createBlock(Fragment, null, [
-          hoist,
-          /*vnode2*/ createVNode(() => {}, null, 'text')
-        ])))
-      ]))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, [
+          // a v-for fragment block generated by the compiler
+          // disables tracking because it always diffs its
+          // children.
+          (vnode1 =
+            (openBlock(true),
+            createBlock(Fragment, null, [
+              hoist,
+              /*vnode2*/ createVNode(() => {}, null, 'text')
+            ])))
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([vnode1])
       expect(vnode1.dynamicChildren).toStrictEqual([])
     })
@@ -549,27 +559,30 @@ describe('vnode', () => {
     test('openBlock without disableTracking: true', () => {
       const hoist = createVNode('div')
       let vnode1, vnode2
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        (vnode1 = (openBlock(),
-        createBlock(Fragment, null, [
-          hoist,
-          (vnode2 = createVNode(() => {}, null, 'text'))
-        ])))
-      ]))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, [
+          (vnode1 =
+            (openBlock(),
+            createBlock(Fragment, null, [
+              hoist,
+              (vnode2 = createVNode(() => {}, null, 'text'))
+            ])))
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([vnode1])
       expect(vnode1.dynamicChildren).toStrictEqual([vnode2])
     })
 
     test('should not track openBlock() when tracking is disabled', () => {
       let vnode1
-      const vnode = (openBlock(),
-      createBlock('div', null, [
-        setBlockTracking(-1),
-        (vnode1 = (openBlock(), createBlock('div'))),
-        setBlockTracking(1),
-        vnode1
-      ]))
+      const vnode =
+        (openBlock(),
+        createBlock('div', null, [
+          setBlockTracking(-1),
+          (vnode1 = (openBlock(), createBlock('div'))),
+          setBlockTracking(1),
+          vnode1
+        ]))
       expect(vnode.dynamicChildren).toStrictEqual([])
     })
   })
index e705bf52a6a485ad4652835fe52b81a715770fd0..8cd27b84a4d43215f11253b8c100d433aa241d45 100644 (file)
@@ -71,42 +71,43 @@ export function defineAsyncComponent<
     let thisRequest: Promise<ConcreteComponent>
     return (
       pendingRequest ||
-      (thisRequest = pendingRequest = loader()
-        .catch(err => {
-          err = err instanceof Error ? err : new Error(String(err))
-          if (userOnError) {
-            return new Promise((resolve, reject) => {
-              const userRetry = () => resolve(retry())
-              const userFail = () => reject(err)
-              userOnError(err, userRetry, userFail, retries + 1)
-            })
-          } else {
-            throw err
-          }
-        })
-        .then((comp: any) => {
-          if (thisRequest !== pendingRequest && pendingRequest) {
-            return pendingRequest
-          }
-          if (__DEV__ && !comp) {
-            warn(
-              `Async component loader resolved to undefined. ` +
-                `If you are using retry(), make sure to return its return value.`
-            )
-          }
-          // interop module default
-          if (
-            comp &&
-            (comp.__esModule || comp[Symbol.toStringTag] === 'Module')
-          ) {
-            comp = comp.default
-          }
-          if (__DEV__ && comp && !isObject(comp) && !isFunction(comp)) {
-            throw new Error(`Invalid async component load result: ${comp}`)
-          }
-          resolvedComp = comp
-          return comp
-        }))
+      (thisRequest = pendingRequest =
+        loader()
+          .catch(err => {
+            err = err instanceof Error ? err : new Error(String(err))
+            if (userOnError) {
+              return new Promise((resolve, reject) => {
+                const userRetry = () => resolve(retry())
+                const userFail = () => reject(err)
+                userOnError(err, userRetry, userFail, retries + 1)
+              })
+            } else {
+              throw err
+            }
+          })
+          .then((comp: any) => {
+            if (thisRequest !== pendingRequest && pendingRequest) {
+              return pendingRequest
+            }
+            if (__DEV__ && !comp) {
+              warn(
+                `Async component loader resolved to undefined. ` +
+                  `If you are using retry(), make sure to return its return value.`
+              )
+            }
+            // interop module default
+            if (
+              comp &&
+              (comp.__esModule || comp[Symbol.toStringTag] === 'Module')
+            ) {
+              comp = comp.default
+            }
+            if (__DEV__ && comp && !isObject(comp) && !isFunction(comp)) {
+              throw new Error(`Invalid async component load result: ${comp}`)
+            }
+            resolvedComp = comp
+            return comp
+          }))
     )
   }
 
index 01b2af82adca84e654fe0ba7200f66c52f5ec9d8..a22ec8c0d7f280720c251d8193fb4e929c86f8a2 100644 (file)
@@ -133,7 +133,7 @@ export interface AppContext {
 type PluginInstallFunction = (app: App, ...options: any[]) => any
 
 export type Plugin =
-  | PluginInstallFunction & { install?: PluginInstallFunction }
+  | (PluginInstallFunction & { install?: PluginInstallFunction })
   | {
       install: PluginInstallFunction
     }
index 61db5e3409fb54022c74aae41ffdf39bc9afd139..ec39308eea513886b726d6cfc8de775c7f4f6f68 100644 (file)
@@ -63,12 +63,12 @@ export function injectHook(
   }
 }
 
-export const createHook = <T extends Function = () => any>(
-  lifecycle: LifecycleHooks
-) => (hook: T, target: ComponentInternalInstance | null = currentInstance) =>
-  // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
-  (!isInSSRComponentSetup || lifecycle === LifecycleHooks.SERVER_PREFETCH) &&
-  injectHook(lifecycle, hook, target)
+export const createHook =
+  <T extends Function = () => any>(lifecycle: LifecycleHooks) =>
+  (hook: T, target: ComponentInternalInstance | null = currentInstance) =>
+    // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)
+    (!isInSSRComponentSetup || lifecycle === LifecycleHooks.SERVER_PREFETCH) &&
+    injectHook(lifecycle, hook, target)
 
 export const onBeforeMount = createHook(LifecycleHooks.BEFORE_MOUNT)
 export const onMounted = createHook(LifecycleHooks.MOUNTED)
index 2c0fa241ec86e085ac79094760c664edee04e48e..075d0a9e10e900d455cbce0eeed5898db056e798 100644 (file)
@@ -130,12 +130,12 @@ export function defineExpose(exposed?: Record<string, any>) {
 type NotUndefined<T> = T extends undefined ? never : T
 
 type InferDefaults<T> = {
-  [K in keyof T]?: NotUndefined<T[K]> extends (
+  [K in keyof T]?: NotUndefined<T[K]> extends
     | number
     | string
     | boolean
     | symbol
-    | Function)
+    | Function
     ? NotUndefined<T[K]>
     : (props: T) => NotUndefined<T[K]>
 }
index 4749bb7304d08c2bd690e18d0d980e79f4d2eabe..2747615b7b3d29e02942ae2043d7e41ec6e3fdf5 100644 (file)
@@ -50,10 +50,14 @@ export type WatchCallback<V = any, OV = any> = (
 
 type MapSources<T, Immediate> = {
   [K in keyof T]: T[K] extends WatchSource<infer V>
-    ? Immediate extends true ? (V | undefined) : V
+    ? Immediate extends true
+      ? V | undefined
+      : V
     : T[K] extends object
-      ? Immediate extends true ? (T[K] | undefined) : T[K]
-      : never
+    ? Immediate extends true
+      ? T[K] | undefined
+      : T[K]
+    : never
 }
 
 type InvalidateCbRegistrator = (cb: () => void) => void
@@ -81,9 +85,13 @@ export function watchPostEffect(
   effect: WatchEffect,
   options?: DebuggerOptions
 ) {
-  return doWatch(effect, null, (__DEV__
-    ? Object.assign(options || {}, { flush: 'post' })
-    : { flush: 'post' }) as WatchOptionsBase)
+  return doWatch(
+    effect,
+    null,
+    (__DEV__
+      ? Object.assign(options || {}, { flush: 'post' })
+      : { flush: 'post' }) as WatchOptionsBase
+  )
 }
 
 // initial value for watchers to trigger on undefined initial values
@@ -116,7 +124,7 @@ export function watch<
 // overload: single source + cb
 export function watch<T, Immediate extends Readonly<boolean> = false>(
   source: WatchSource<T>,
-  cb: WatchCallback<T, Immediate extends true ? (T | undefined) : T>,
+  cb: WatchCallback<T, Immediate extends true ? T | undefined : T>,
   options?: WatchOptions<Immediate>
 ): WatchStopHandle
 
@@ -126,7 +134,7 @@ export function watch<
   Immediate extends Readonly<boolean> = false
 >(
   source: T,
-  cb: WatchCallback<T, Immediate extends true ? (T | undefined) : T>,
+  cb: WatchCallback<T, Immediate extends true ? T | undefined : T>,
   options?: WatchOptions<Immediate>
 ): WatchStopHandle
 
index dd2ee5134a279e0e5bd13bc989168e90803e1d02..b2d130cb9876071f2bea76ff20fb7847e2c2f7b8 100644 (file)
@@ -238,8 +238,9 @@ export const deprecationData: Record<DeprecationTypes, DeprecationData> = {
 
   [DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE]: {
     message: componentName =>
-      `Component <${componentName ||
-        'Anonymous'}> has \`inheritAttrs: false\` but is ` +
+      `Component <${
+        componentName || 'Anonymous'
+      }> has \`inheritAttrs: false\` but is ` +
       `relying on class/style fallthrough from parent. In Vue 3, class/style ` +
       `are now included in $attrs and will no longer fallthrough when ` +
       `inheritAttrs is false. If you are already using v-bind="$attrs" on ` +
@@ -317,9 +318,7 @@ export const deprecationData: Record<DeprecationTypes, DeprecationData> = {
       `${name}="false" instead of removing it in Vue 3. To remove the attribute, ` +
       `use \`null\` or \`undefined\` instead. If the usage is intended, ` +
       `you can disable the compat behavior and suppress this warning with:` +
-      `\n\n  configureCompat({ ${
-        DeprecationTypes.ATTR_FALSE_VALUE
-      }: false })\n`,
+      `\n\n  configureCompat({ ${DeprecationTypes.ATTR_FALSE_VALUE}: false })\n`,
     link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
   },
 
@@ -332,9 +331,7 @@ export const deprecationData: Record<DeprecationTypes, DeprecationData> = {
       `Always use explicit "true" or "false" values for enumerated attributes. ` +
       `If the usage is intended, ` +
       `you can disable the compat behavior and suppress this warning with:` +
-      `\n\n  configureCompat({ ${
-        DeprecationTypes.ATTR_ENUMERATED_COERCION
-      }: false })\n`,
+      `\n\n  configureCompat({ ${DeprecationTypes.ATTR_ENUMERATED_COERCION}: false })\n`,
     link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
   },
 
@@ -348,9 +345,7 @@ export const deprecationData: Record<DeprecationTypes, DeprecationData> = {
       `default if no "tag" prop is specified. If you do not rely on the span ` +
       `for styling, you can disable the compat behavior and suppress this ` +
       `warning with:` +
-      `\n\n  configureCompat({ ${
-        DeprecationTypes.TRANSITION_GROUP_ROOT
-      }: false })\n`,
+      `\n\n  configureCompat({ ${DeprecationTypes.TRANSITION_GROUP_ROOT}: false })\n`,
     link: `https://v3.vuejs.org/guide/migration/transition-group.html`
   },
 
@@ -366,9 +361,7 @@ export const deprecationData: Record<DeprecationTypes, DeprecationData> = {
         `usage and intend to use plain functions for functional components, ` +
         `you can disable the compat behavior and suppress this ` +
         `warning with:` +
-        `\n\n  configureCompat({ ${
-          DeprecationTypes.COMPONENT_ASYNC
-        }: false })\n`
+        `\n\n  configureCompat({ ${DeprecationTypes.COMPONENT_ASYNC}: false })\n`
       )
     },
     link: `https://v3.vuejs.org/guide/migration/async-components.html`
@@ -394,9 +387,7 @@ export const deprecationData: Record<DeprecationTypes, DeprecationData> = {
     message: (comp: ComponentOptions) => {
       const configMsg =
         `opt-in to ` +
-        `Vue 3 behavior on a per-component basis with \`compatConfig: { ${
-          DeprecationTypes.COMPONENT_V_MODEL
-        }: false }\`.`
+        `Vue 3 behavior on a per-component basis with \`compatConfig: { ${DeprecationTypes.COMPONENT_V_MODEL}: false }\`.`
       if (
         comp.props &&
         (isArray(comp.props)
@@ -421,9 +412,7 @@ export const deprecationData: Record<DeprecationTypes, DeprecationData> = {
     message:
       `Vue 3's render function API has changed. ` +
       `You can opt-in to the new API with:` +
-      `\n\n  configureCompat({ ${
-        DeprecationTypes.RENDER_FUNCTION
-      }: false })\n` +
+      `\n\n  configureCompat({ ${DeprecationTypes.RENDER_FUNCTION}: false })\n` +
       `\n  (This can also be done per-component via the "compatConfig" option.)`,
     link: `https://v3.vuejs.org/guide/migration/render-function-api.html`
   },
@@ -565,9 +554,7 @@ export function validateCompatConfig(
 
   if (instance && config[DeprecationTypes.OPTIONS_DATA_MERGE] != null) {
     warn(
-      `Deprecation config "${
-        DeprecationTypes.OPTIONS_DATA_MERGE
-      }" can only be configured globally.`
+      `Deprecation config "${DeprecationTypes.OPTIONS_DATA_MERGE}" can only be configured globally.`
     )
   }
 }
index a130514726a66a5197629da03f6bc08793c3f6fa..7f66e5dad596f1f64fddb46cbad94cb4deb38b13 100644 (file)
@@ -251,8 +251,8 @@ export function createCompatVue(
       mergeBase[key] = isArray(superValue)
         ? superValue.slice()
         : isObject(superValue)
-          ? extend(Object.create(null), superValue)
-          : superValue
+        ? extend(Object.create(null), superValue)
+        : superValue
     }
 
     SubVue.options = mergeOptions(
index 69ca1d7cbe259f784b7f696dab8c23aa0c7da957..4cf2fc226cf25d083d3549ae3a9e0cabfb223104 100644 (file)
@@ -177,7 +177,7 @@ const skipLegacyRootLevelProps = /*#__PURE__*/ makeMap(
 function convertLegacyProps(
   legacyProps: LegacyVNodeProps | undefined,
   type: any
-): Data & VNodeProps | null {
+): (Data & VNodeProps) | null {
   if (!legacyProps) {
     return null
   }
index 2eaaa459fa71baa53d7f097f9557b60f721e189a..dd4feee1d1b4a4de47b9c5830713a2a993cefd02 100644 (file)
@@ -51,7 +51,7 @@ export function legacyBindObjectProps(
 
           if (isSync) {
             const on = data.on || (data.on = {})
-            on[`update:${key}`] = function($event: any) {
+            on[`update:${key}`] = function ($event: any) {
               value[key] = $event
             }
           }
index 528c3becdb1548bc243aa9aeae94b789165397fe..7b7ced57d30236fc1bee88afb7383e00ed68dc35 100644 (file)
@@ -761,10 +761,8 @@ export function finishComponentSetup(
           startMeasure(instance, `compile`)
         }
         const { isCustomElement, compilerOptions } = instance.appContext.config
-        const {
-          delimiters,
-          compilerOptions: componentCompilerOptions
-        } = Component
+        const { delimiters, compilerOptions: componentCompilerOptions } =
+          Component
         const finalCompilerOptions: CompilerOptions = extend(
           extend(
             {
@@ -822,10 +820,10 @@ export function finishComponentSetup(
           (__ESM_BUNDLER__
             ? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
             : __ESM_BROWSER__
-              ? ` Use "vue.esm-browser.js" instead.`
-              : __GLOBAL__
-                ? ` Use "vue.global.js" instead.`
-                : ``) /* should not happen */
+            ? ` Use "vue.esm-browser.js" instead.`
+            : __GLOBAL__
+            ? ` Use "vue.global.js" instead.`
+            : ``) /* should not happen */
       )
     } else {
       warn(`Component is missing template or render function.`)
index 6cc6746a57e832a458c509e45ff3d031c285f0c3..7d7f3a38728c1e9e0e6b046cedddeeb4f78fa760 100644 (file)
@@ -77,7 +77,9 @@ type RequiredKeys<T> = {
     // don't mark Boolean props as undefined
     | BooleanConstructor
     | { type: BooleanConstructor }
-    ? T[K] extends { default: undefined | (() => undefined) } ? never : K
+    ? T[K] extends { default: undefined | (() => undefined) }
+      ? never
+      : K
     : never
 }[keyof T]
 
@@ -98,16 +100,18 @@ type DefaultKeys<T> = {
 type InferPropType<T> = [T] extends [null]
   ? any // null & true would fail to infer
   : [T] extends [{ type: null | true }]
-    ? any // As TS issue https://github.com/Microsoft/TypeScript/issues/14829 // somehow `ObjectConstructor` when inferred from { (): T } becomes `any` // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`
-    : [T] extends [ObjectConstructor | { type: ObjectConstructor }]
-      ? Record<string, any>
-      : [T] extends [BooleanConstructor | { type: BooleanConstructor }]
-        ? boolean
-        : [T] extends [DateConstructor | { type: DateConstructor }]
-          ? Date
-          : [T] extends [Prop<infer V, infer D>]
-            ? (unknown extends V ? D : V)
-            : T
+  ? any // As TS issue https://github.com/Microsoft/TypeScript/issues/14829 // somehow `ObjectConstructor` when inferred from { (): T } becomes `any` // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`
+  : [T] extends [ObjectConstructor | { type: ObjectConstructor }]
+  ? Record<string, any>
+  : [T] extends [BooleanConstructor | { type: BooleanConstructor }]
+  ? boolean
+  : [T] extends [DateConstructor | { type: DateConstructor }]
+  ? Date
+  : [T] extends [Prop<infer V, infer D>]
+  ? unknown extends V
+    ? D
+    : V
+  : T
 
 export type ExtractPropTypes<O> = O extends object
   ? { [K in keyof O]?: unknown } & // This is needed to keep the relation between the option prop and the props, allowing to use ctrl+click to navigate to the prop options. see: #3656
@@ -407,7 +411,7 @@ function resolvePropValue(
           setCurrentInstance(instance)
           value = propsDefaults[key] = defaultValue.call(
             __COMPAT__ &&
-            isCompatEnabled(DeprecationTypes.PROPS_DEFAULT_THIS, instance)
+              isCompatEnabled(DeprecationTypes.PROPS_DEFAULT_THIS, instance)
               ? createPropsDefaultThis(instance, props, key)
               : null,
             props
index 7240120e5b7bc42fff86f9c8d07538a26ae00ddf..1e5935b646f8463ea306d1668e98f0595b6f2842 100644 (file)
@@ -72,7 +72,9 @@ import { installCompatInstanceProperties } from './compat/instance'
 export interface ComponentCustomProperties {}
 
 type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin
-  ? ComponentOptionsMixin extends T ? true : false
+  ? ComponentOptionsMixin extends T
+    ? true
+    : false
   : false
 
 type MixinToOptionTypes<T> = T extends ComponentOptionsBase<
@@ -261,15 +263,8 @@ export interface ComponentRenderContext {
 
 export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
   get({ _: instance }: ComponentRenderContext, key: string) {
-    const {
-      ctx,
-      setupState,
-      data,
-      props,
-      accessCache,
-      type,
-      appContext
-    } = instance
+    const { ctx, setupState, data, props, accessCache, type, appContext } =
+      instance
 
     // for internal formatters to know that this is a Vue instance
     if (__DEV__ && key === '__isVue') {
index 0a6e302a1f579e8b15cb52a0cde30fdaeaadd489..cb628bf655aede199c0796c7f531394b57077c07 100644 (file)
@@ -257,7 +257,7 @@ if (__COMPAT__) {
 
 // export the public type for h/tsx inference
 // also to avoid inline import() in generated d.ts files
-export const BaseTransition = (BaseTransitionImpl as any) as {
+export const BaseTransition = BaseTransitionImpl as any as {
   new (): {
     $props: BaseTransitionProps<any>
   }
index a394acbda6b04e21ca64451010561c8b2af884f8..9bccf40f576749f20c7088e1e73efe5c09f5eb83 100644 (file)
@@ -329,7 +329,7 @@ if (__COMPAT__) {
 
 // export the public type for h/tsx inference
 // also to avoid inline import() in generated d.ts files
-export const KeepAlive = (KeepAliveImpl as any) as {
+export const KeepAlive = KeepAliveImpl as any as {
   __isKeepAlive: true
   new (): {
     $props: VNodeProps & KeepAliveProps
index 85a2d1755bdd9a1a054b20019fb6a4ce68c3e766..ffc900180fe91123bf1df58269f4ce4abf5f2c8a 100644 (file)
@@ -87,9 +87,7 @@ export const SuspenseImpl = {
 }
 
 // Force-casted public typing for h and TSX props inference
-export const Suspense = ((__FEATURE_SUSPENSE__
-  ? SuspenseImpl
-  : null) as any) as {
+export const Suspense = (__FEATURE_SUSPENSE__ ? SuspenseImpl : null) as any as {
   __isSuspense: true
   new (): { $props: VNodeProps & SuspenseProps }
 }
@@ -520,13 +518,8 @@ function createSuspenseBoundary(
         return
       }
 
-      const {
-        vnode,
-        activeBranch,
-        parentComponent,
-        container,
-        isSVG
-      } = suspense
+      const { vnode, activeBranch, parentComponent, container, isSVG } =
+        suspense
 
       // invoke @fallback event
       triggerEvent(vnode, 'onFallback')
index 78aee9481e0e6ae3393d78081d355ee266f2add7..68d50a63fbdb57ed6aac85864c7de11a02e43f2d 100644 (file)
@@ -371,7 +371,7 @@ function hydrateTeleport(
 }
 
 // Force-casted public typing for h and TSX props inference
-export const Teleport = (TeleportImpl as any) as {
+export const Teleport = TeleportImpl as any as {
   __isTeleport: true
   new (): { $props: VNodeProps & TeleportProps }
 }
index 5f617f83c125e2b7477fa02d0052fd561f754986..4c52388524e5248866863069bab6dfbf63351d4d 100644 (file)
@@ -54,13 +54,11 @@ export const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook(
   DevtoolsHooks.COMPONENT_ADDED
 )
 
-export const devtoolsComponentUpdated = /*#__PURE__*/ createDevtoolsComponentHook(
-  DevtoolsHooks.COMPONENT_UPDATED
-)
+export const devtoolsComponentUpdated =
+  /*#__PURE__*/ createDevtoolsComponentHook(DevtoolsHooks.COMPONENT_UPDATED)
 
-export const devtoolsComponentRemoved = /*#__PURE__*/ createDevtoolsComponentHook(
-  DevtoolsHooks.COMPONENT_REMOVED
-)
+export const devtoolsComponentRemoved =
+  /*#__PURE__*/ createDevtoolsComponentHook(DevtoolsHooks.COMPONENT_REMOVED)
 
 function createDevtoolsComponentHook(hook: DevtoolsHooks) {
   return (component: ComponentInternalInstance) => {
index ed92b2cb4cd077b83d4749be5ef10132925414f1..4ec504961466a65c34e520b257940747aaddabf1 100644 (file)
@@ -15,7 +15,8 @@ export function createSlots(
   dynamicSlots: (
     | CompiledSlotDescriptor
     | CompiledSlotDescriptor[]
-    | undefined)[]
+    | undefined
+  )[]
 ): Record<string, Slot> {
   for (let i = 0; i < dynamicSlots.length; i++) {
     const slot = dynamicSlots[i]
index 222e72714af748faaa25e8f09eaaae2217497ff0..204543e6de211649134d6b3ed0ed09595715c038 100644 (file)
@@ -1,6 +1,6 @@
-export type UnionToIntersection<U> = (U extends any
-  ? (k: U) => void
-  : never) extends ((k: infer I) => void)
+export type UnionToIntersection<U> = (
+  U extends any ? (k: U) => void : never
+) extends (k: infer I) => void
   ? I
   : never
 
index f4c46110d5dd579e8b8d9d6e40ee6b98053c8cae..efa10f4dc98adace9ddb444ac9460afafb7705f1 100644 (file)
@@ -31,10 +31,10 @@ if (__DEV__) {
     typeof global !== 'undefined'
       ? global
       : typeof self !== 'undefined'
-        ? self
-        : typeof window !== 'undefined'
-          ? window
-          : {}
+      ? self
+      : typeof window !== 'undefined'
+      ? window
+      : {}
 
   globalObject.__VUE_HMR_RUNTIME__ = {
     createRecord: tryWrap(createRecord),
index 4e5fc8b5d22d30c5af1793130b35f8055ae3e0a1..9b2a903fb54c124292032ccc5925cd4fccd6735b 100644 (file)
@@ -280,8 +280,8 @@ export function createHydrationFunctions(
         if (
           forcePatchValue ||
           !optimized ||
-          (patchFlag & PatchFlags.FULL_PROPS ||
-            patchFlag & PatchFlags.HYDRATE_EVENTS)
+          patchFlag & PatchFlags.FULL_PROPS ||
+          patchFlag & PatchFlags.HYDRATE_EVENTS
         ) {
           for (const key in props) {
             if (
@@ -346,7 +346,9 @@ export function createHydrationFunctions(
           hasMismatch = true
           __DEV__ &&
             warn(
-              `Hydration text content mismatch in <${vnode.type as string}>:\n` +
+              `Hydration text content mismatch in <${
+                vnode.type as string
+              }>:\n` +
                 `- Client: ${el.textContent}\n` +
                 `- Server: ${vnode.children as string}`
             )
@@ -465,8 +467,8 @@ export function createHydrationFunctions(
         node.nodeType === DOMNodeTypes.TEXT
           ? `(text)`
           : isComment(node) && node.data === '['
-            ? `(start of fragment)`
-            : ``
+          ? `(start of fragment)`
+          : ``
       )
     vnode.el = null
 
index 79784acc112c0f0490810804b49dfc5758278a48..4ce2a82c42b9a7d0f6e58c6347d79d9b64abe186 100644 (file)
@@ -341,9 +341,9 @@ const _compatUtils = {
 /**
  * @internal only exposed in compat builds.
  */
-export const compatUtils = (__COMPAT__
-  ? _compatUtils
-  : null) as typeof _compatUtils
+export const compatUtils = (
+  __COMPAT__ ? _compatUtils : null
+) as typeof _compatUtils
 
 // Ref macros ------------------------------------------------------------------
 // for dts generation only
index a750bceba9787fb40a1a6593088d7acade065d41..8ac4536f03cc8585397f2df381c7a5d809a670a4 100644 (file)
@@ -1444,7 +1444,7 @@ function baseCreateRenderer(
           }
 
           if (isAsyncWrapper(initialVNode)) {
-            (initialVNode.type as ComponentOptions).__asyncLoader!().then(
+            ;(initialVNode.type as ComponentOptions).__asyncLoader!().then(
               // note: we are moving the render call into an async callback,
               // which means it won't track dependencies - but it's ok because
               // a server-rendered async wrapper is already in resolved state
@@ -2406,10 +2406,9 @@ function baseCreateRenderer(
   let hydrate: ReturnType<typeof createHydrationFunctions>[0] | undefined
   let hydrateNode: ReturnType<typeof createHydrationFunctions>[1] | undefined
   if (createHydrationFns) {
-    ;[hydrate, hydrateNode] = createHydrationFns(internals as RendererInternals<
-      Node,
-      Element
-    >)
+    ;[hydrate, hydrateNode] = createHydrationFns(
+      internals as RendererInternals<Node, Element>
+    )
   }
 
   return {
index 7cb39237769c50fe91187bd5f59196abca7f5f16..d65cdbe05db152e8c27040551504ad06c2f08e50 100644 (file)
@@ -44,7 +44,7 @@ import { convertLegacyVModelProps } from './compat/componentVModel'
 import { defineLegacyVNodeProperties } from './compat/renderFn'
 import { convertLegacyRefInFor } from './compat/ref'
 
-export const Fragment = (Symbol(__DEV__ ? 'Fragment' : undefined) as any) as {
+export const Fragment = Symbol(__DEV__ ? 'Fragment' : undefined) as any as {
   __isFragment: true
   new (): {
     $props: VNodeProps
@@ -78,7 +78,7 @@ export type VNodeNormalizedRefAtom = {
 
 export type VNodeNormalizedRef =
   | VNodeNormalizedRefAtom
-  | (VNodeNormalizedRefAtom)[]
+  | VNodeNormalizedRefAtom[]
 
 type VNodeMountHook = (vnode: VNode) => void
 type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void
@@ -381,11 +381,13 @@ const normalizeKey = ({ key }: VNodeProps): VNode['key'] =>
   key != null ? key : null
 
 const normalizeRef = ({ ref }: VNodeProps): VNodeNormalizedRefAtom | null => {
-  return (ref != null
-    ? isString(ref) || isRef(ref) || isFunction(ref)
-      ? { i: currentRenderingInstance, r: ref }
-      : ref
-    : null) as any
+  return (
+    ref != null
+      ? isString(ref) || isRef(ref) || isFunction(ref)
+        ? { i: currentRenderingInstance, r: ref }
+        : ref
+      : null
+  ) as any
 }
 
 function createBaseVNode(
@@ -475,9 +477,9 @@ function createBaseVNode(
 
 export { createBaseVNode as createElementVNode }
 
-export const createVNode = (__DEV__
-  ? createVNodeWithArgsTransform
-  : _createVNode) as typeof _createVNode
+export const createVNode = (
+  __DEV__ ? createVNodeWithArgsTransform : _createVNode
+) as typeof _createVNode
 
 function _createVNode(
   type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT,
@@ -537,14 +539,14 @@ function _createVNode(
   const shapeFlag = isString(type)
     ? ShapeFlags.ELEMENT
     : __FEATURE_SUSPENSE__ && isSuspense(type)
-      ? ShapeFlags.SUSPENSE
-      : isTeleport(type)
-        ? ShapeFlags.TELEPORT
-        : isObject(type)
-          ? ShapeFlags.STATEFUL_COMPONENT
-          : isFunction(type)
-            ? ShapeFlags.FUNCTIONAL_COMPONENT
-            : 0
+    ? ShapeFlags.SUSPENSE
+    : isTeleport(type)
+    ? ShapeFlags.TELEPORT
+    : isObject(type)
+    ? ShapeFlags.STATEFUL_COMPONENT
+    : isFunction(type)
+    ? ShapeFlags.FUNCTIONAL_COMPONENT
+    : 0
 
   if (__DEV__ && shapeFlag & ShapeFlags.STATEFUL_COMPONENT && isProxy(type)) {
     type = toRaw(type)
@@ -579,7 +581,7 @@ export function guardReactiveProps(props: (Data & VNodeProps) | null) {
 
 export function cloneVNode<T, U>(
   vnode: VNode<T, U>,
-  extraProps?: Data & VNodeProps | null,
+  extraProps?: (Data & VNodeProps) | null,
   mergeRef = false
 ): VNode<T, U> {
   // This is intentionally NOT using spread or extend to avoid the runtime
index 503b137cc08e4b0b2a95e0743adbe0a7aa11bb89..2c77f515221fe11fcff1cb5f46df6f28a042c869 100644 (file)
@@ -17,7 +17,7 @@ const triggerEvent = (type: string, el: Element) => {
 const withVModel = (node: VNode, arg: any, mods?: any) =>
   withDirectives(node, [[vModelDynamic, arg, '', mods]])
 
-const setValue = function(this: any, value: any) {
+const setValue = function (this: any, value: any) {
   this.value = value
 }
 
index e2417d9567761c1f3c16d6a73527d941c49bdc3d..477620f6da63ae8ef6f9a83a4ae5522c11b6218f 100644 (file)
@@ -41,9 +41,9 @@ describe('runtime-dom: v-on directive', () => {
   })
 
   test('it should support key modifiers and system modifiers', () => {
-    const keyNames = ["ctrl","shift","meta","alt"]
+    const keyNames = ['ctrl', 'shift', 'meta', 'alt']
 
-    keyNames.forEach(keyName=>{
+    keyNames.forEach(keyName => {
       const el = document.createElement('div')
       const fn = jest.fn()
       // <div @keyup[keyName].esc="test"/>
@@ -52,28 +52,28 @@ describe('runtime-dom: v-on directive', () => {
         'arrow-left'
       ])
       patchEvent(el, 'onKeyup', null, nextValue, null)
-  
+
       triggerEvent(el, 'keyup', e => (e.key = 'a'))
       expect(fn).not.toBeCalled()
-  
+
       triggerEvent(el, 'keyup', e => {
         e[`${keyName}Key`] = false
         e.key = 'esc'
       })
       expect(fn).not.toBeCalled()
-  
+
       triggerEvent(el, 'keyup', e => {
         e[`${keyName}Key`] = true
         e.key = 'Escape'
       })
       expect(fn).toBeCalledTimes(1)
-  
+
       triggerEvent(el, 'keyup', e => {
         e[`${keyName}Key`] = true
         e.key = 'ArrowLeft'
       })
       expect(fn).toBeCalledTimes(2)
-    });
+    })
   })
 
   test('it should support "exact" modifier', () => {
@@ -114,9 +114,11 @@ describe('runtime-dom: v-on directive', () => {
       const fn = jest.fn()
       const handler = withModifiers(fn, [button])
       patchEvent(el, 'onMousedown', null, handler, null)
-      buttons.filter(b => b !== button).forEach(button => {
-        triggerEvent(el, 'mousedown', e => (e.button = buttonCodes[button]))
-      })
+      buttons
+        .filter(b => b !== button)
+        .forEach(button => {
+          triggerEvent(el, 'mousedown', e => (e.button = buttonCodes[button]))
+        })
       expect(fn).not.toBeCalled()
       triggerEvent(el, 'mousedown', e => (e.button = buttonCodes[button]))
       expect(fn).toBeCalled()
index 2ece460fd7a9bcd208f5c69fb2447a105433f87b..fb22529f42daa5233656ba962d735206cd48fdc6 100644 (file)
@@ -155,10 +155,8 @@ describe('useCssVars', () => {
       setup() {
         useCssVars(() => state)
         return () =>
-          h(
-            Child,
-            null,
-            () => (value.value ? [h('div')] : [h('div'), h('div')])
+          h(Child, null, () =>
+            value.value ? [h('div')] : [h('div'), h('div')]
           )
       }
     }
index 25b4622017852dc257af6b0c71e9addb9f87f853..5de2ca9c564b3f3b2a776b29a212eb6c0f0a25cf 100644 (file)
@@ -157,9 +157,9 @@ export const defineSSRCustomElement = ((options: any) => {
   return defineCustomElement(options, hydrate)
 }) as typeof defineCustomElement
 
-const BaseClass = (typeof HTMLElement !== 'undefined'
-  ? HTMLElement
-  : class {}) as typeof HTMLElement
+const BaseClass = (
+  typeof HTMLElement !== 'undefined' ? HTMLElement : class {}
+) as typeof HTMLElement
 
 export class VueElement extends BaseClass {
   /**
index e369922fcfaa9ca963358618b628b673139684fd..9e290ef2289169d20afba642f842bc1711c4ebe2 100644 (file)
@@ -69,11 +69,12 @@ const DOMTransitionPropsValidators = {
   leaveToClass: String
 }
 
-export const TransitionPropsValidators = (Transition.props = /*#__PURE__*/ extend(
-  {},
-  (BaseTransition as any).props,
-  DOMTransitionPropsValidators
-))
+export const TransitionPropsValidators = (Transition.props =
+  /*#__PURE__*/ extend(
+    {},
+    (BaseTransition as any).props,
+    DOMTransitionPropsValidators
+  ))
 
 /**
  * #3227 Incoming hooks may be merged into arrays when wrapping Transition
index 99f5fa9871d98069e9303ea030f4077c5da04b11..8c5739ac151de08b1b810f3bc465ccb9344dcc51 100644 (file)
@@ -159,7 +159,7 @@ if (__COMPAT__) {
 const removeMode = (props: any) => delete props.mode
 /*#__PURE__*/ removeMode(TransitionGroupImpl.props)
 
-export const TransitionGroup = (TransitionGroupImpl as unknown) as {
+export const TransitionGroup = TransitionGroupImpl as unknown as {
   new (): {
     $props: TransitionGroupProps
   }
@@ -210,9 +210,9 @@ function hasCSSTransform(
   }
   moveClass.split(/\s+/).forEach(c => c && clone.classList.add(c))
   clone.style.display = 'none'
-  const container = (root.nodeType === 1
-    ? root
-    : root.parentNode) as HTMLElement
+  const container = (
+    root.nodeType === 1 ? root : root.parentNode
+  ) as HTMLElement
   container.appendChild(clone)
   const { hasTransform } = getTransitionInfo(clone)
   container.removeChild(clone)
index 42960eca2634b7902b0f8b45aa4649b790b15444..d489f25a0ca037928e607ab69f50999eb751c5c6 100644 (file)
@@ -181,9 +181,8 @@ export const vModelSelect: ModelDirective<HTMLSelectElement> = {
     addEventListener(el, 'change', () => {
       const selectedVal = Array.prototype.filter
         .call(el.options, (o: HTMLOptionElement) => o.selected)
-        .map(
-          (o: HTMLOptionElement) =>
-            number ? toNumber(getValue(o)) : getValue(o)
+        .map((o: HTMLOptionElement) =>
+          number ? toNumber(getValue(o)) : getValue(o)
         )
       el._assign(
         el.multiple
index 45fc58ade70e4ba30d9a1a42d422f149d06d67fa..d4567f839f4f21ff217151f4320d4790fbc7a371 100644 (file)
@@ -66,7 +66,7 @@ export const withKeys = (fn: Function, modifiers: string[]) => {
       compatUtils.isCompatEnabled(DeprecationTypes.CONFIG_KEY_CODES, instance)
     ) {
       if (instance) {
-        globalKeyCodes = ((instance.appContext.config as any) as LegacyConfig)
+        globalKeyCodes = (instance.appContext.config as any as LegacyConfig)
           .keyCodes
       }
     }
index ef0da5435600ec6f73c6efb66691cebdec722a99..fa217800525096a47ad9f76e8178cdb0dfe55ba5 100644 (file)
@@ -52,8 +52,8 @@ export function compatCoerceAttr(
       value === null
         ? 'false'
         : typeof value !== 'boolean' && value !== undefined
-          ? 'true'
-          : null
+        ? 'true'
+        : null
     if (
       v2CocercedValue &&
       compatUtils.softAssertCompatEnabled(
index 6eecf64169ff8ab525af732ccea4a4ebfd2c5fbf..0be26ef8682602e9930b310f085a691aa7b7c0a3 100644 (file)
@@ -8,9 +8,8 @@ export function patchClass(el: Element, value: string | null, isSVG: boolean) {
   // classes into account.
   const transitionClasses = (el as ElementWithTransition)._vtc
   if (transitionClasses) {
-    value = (value
-      ? [value, ...transitionClasses]
-      : [...transitionClasses]
+    value = (
+      value ? [value, ...transitionClasses] : [...transitionClasses]
     ).join(' ')
   }
   if (value == null) {
index 125b64d0edfbf268f08a35adda34e0ff7748878a..47d4f3ba4350cc95a38688ee39ca0aba0449a358 100644 (file)
@@ -37,8 +37,8 @@ export const patchProp: DOMRendererOptions['patchProp'] = (
     key[0] === '.'
       ? ((key = key.slice(1)), true)
       : key[0] === '^'
-        ? ((key = key.slice(1)), false)
-        : shouldSetAsProp(el, key, nextValue, isSVG)
+      ? ((key = key.slice(1)), false)
+      : shouldSetAsProp(el, key, nextValue, isSVG)
   ) {
     patchDOMProp(
       el,
index 52c79b7d0d97763b5b6e914bfd7bae5010d6e41a..a1ee138b6599c31caa12599384c8413e3f088b00 100644 (file)
@@ -43,8 +43,8 @@ function serializeElement(
       return isOn(key) || value == null
         ? ``
         : value === ``
-          ? key
-          : `${key}=${JSON.stringify(value)}`
+        ? key
+        : `${key}=${JSON.stringify(value)}`
     })
     .filter(Boolean)
     .join(' ')
index 1a40c598cc7dba271750b5ff67d5540dfc129fe8..64ce7411d91edb5d03f2cd7e67654b0dd8aa270f 100644 (file)
@@ -721,7 +721,7 @@ function testRender(type: string, render: typeof renderToString) {
       test('with client-compiled vnode slots', async () => {
         const Child = {
           __scopeId: 'data-v-child',
-          render: function(this: any) {
+          render: function (this: any) {
             return h('div', null, [renderSlot(this.$slots, 'default')])
           }
         }
@@ -1069,7 +1069,7 @@ function testRender(type: string, render: typeof renderToString) {
         renderError = e
       }
       expect(renderError).toBe(null)
-      expect(((capturedError as unknown) as Error).message).toBe('An error')
+      expect((capturedError as unknown as Error).message).toBe('An error')
     })
   })
 }
index 744d87886e0e6cb75cf5dca15d6028918e2e8ce6..e485bef75865c68c7a8a55e59511fc73368faf47 100644 (file)
@@ -43,7 +43,7 @@ describe('ssr: renderList', () => {
   })
 
   it('should render an item for entry in an iterable', () => {
-    const iterable = function*() {
+    const iterable = function* () {
       yield 1
       yield 2
       yield 3
index 4f9d50625da5365b34fe4f500b4bd59cbff859e4..19bf0489aa04ee8f50abb9a063a49b990f4689c4 100644 (file)
@@ -26,9 +26,7 @@ export function ssrCompile(
     isNativeTag: instance.appContext.config.isNativeTag || NO,
     onError(err: CompilerError) {
       if (__DEV__) {
-        const message = `[@vue/server-renderer] Template compilation error: ${
-          err.message
-        }`
+        const message = `[@vue/server-renderer] Template compilation error: ${err.message}`
         const codeFrame =
           err.loc &&
           generateCodeFrame(
index c6986f1b750152c34882dba68066c812f8dc2945..76b3d4f60f1e5e2d3fdc8e34ebb52d41df9b58e1 100644 (file)
@@ -17,9 +17,7 @@ export function ssrRenderDynamicModel(
     case 'radio':
       return looseEqual(model, value) ? ' checked' : ''
     case 'checkbox':
-      return (isArray(model)
-      ? ssrLooseContain(model, value)
-      : model)
+      return (isArray(model) ? ssrLooseContain(model, value) : model)
         ? ' checked'
         : ''
     default:
@@ -38,9 +36,7 @@ export function ssrGetDynamicModelProps(
     case 'radio':
       return looseEqual(model, value) ? { checked: true } : null
     case 'checkbox':
-      return (isArray(model)
-      ? ssrLooseContain(model, value)
-      : model)
+      return (isArray(model) ? ssrLooseContain(model, value) : model)
         ? { checked: true }
         : null
     default:
index 7e696a6e7f8bf75f3b94dc9d13a14be73f438f63..cf6e9759a35237fb6f60a31c7a85a187edeeee71 100644 (file)
@@ -74,9 +74,9 @@ async function resolveTeleports(context: SSRContext) {
     for (const key in context.__teleportBuffers) {
       // note: it's OK to await sequentially here because the Promises were
       // created eagerly in parallel.
-      context.teleports[key] = await unrollBuffer((await Promise.all(
-        context.__teleportBuffers[key]
-      )) as SSRBuffer)
+      context.teleports[key] = await unrollBuffer(
+        (await Promise.all(context.__teleportBuffers[key])) as SSRBuffer
+      )
     }
   }
 }
index 9f04f2519aab1ad3ff6d6f2d024330de0937a236..8fc7b68cec5622131e4ccdb8d6a97ba86dfa25f9 100644 (file)
@@ -217,12 +217,7 @@ async function doCompileScript(
 
       return [code, compiledScript.bindings]
     } catch (e) {
-      store.errors = [
-        e.stack
-          .split('\n')
-          .slice(0, 12)
-          .join('\n')
-      ]
+      store.errors = [e.stack.split('\n').slice(0, 12).join('\n')]
       return
     }
   } else {
index fe321cd153924d6ba6d367d2868114a5bea70e31..75bb25058b735a63bda6ebed675d07fa6cc8007b 100644 (file)
@@ -54,27 +54,27 @@ describe('utils/looseEqual', () => {
     const date2 = new Date(2019, 1, 2, 3, 4, 5, 7)
     const file1 = new File([''], 'filename.txt', {
       type: 'text/plain',
-      lastModified: date1.getTime(),
+      lastModified: date1.getTime()
     })
     const file2 = new File([''], 'filename.txt', {
       type: 'text/plain',
-      lastModified: date1.getTime(),
+      lastModified: date1.getTime()
     })
     const file3 = new File([''], 'filename.txt', {
       type: 'text/plain',
-      lastModified: date2.getTime(),
+      lastModified: date2.getTime()
     })
     const file4 = new File([''], 'filename.csv', {
       type: 'text/csv',
-      lastModified: date1.getTime(),
+      lastModified: date1.getTime()
     })
     const file5 = new File(['abcdef'], 'filename.txt', {
       type: 'text/plain',
-      lastModified: date1.getTime(),
+      lastModified: date1.getTime()
     })
     const file6 = new File(['12345'], 'filename.txt', {
       type: 'text/plain',
-      lastModified: date1.getTime(),
+      lastModified: date1.getTime()
     })
 
     // Identical file object references
@@ -163,7 +163,7 @@ describe('utils/looseEqual', () => {
     const date1 = new Date(2019, 1, 2, 3, 4, 5, 6)
     const file1 = new File([''], 'filename.txt', {
       type: 'text/plain',
-      lastModified: date1.getTime(),
+      lastModified: date1.getTime()
     })
 
     expect(looseEqual(123, '123')).toBe(true)
index f55f7f7bf861468ff586b62913c7f0a90bfb707f..c884d9e7281edaad4265038a716bcac36cdc2231 100644 (file)
@@ -6,7 +6,9 @@ describe('normalizeClass', () => {
   })
 
   test('handles array correctly', () => {
-    expect(normalizeClass(['foo', undefined, true, false, 'bar'])).toEqual('foo bar')
+    expect(normalizeClass(['foo', undefined, true, false, 'bar'])).toEqual(
+      'foo bar'
+    )
   })
 
   test('handles object correctly', () => {
index 3c000005ec883a11af88a98aae205dbd052d4e90..8c98b3b6cc4f255ef451b2098640b01a5c69c80b 100644 (file)
@@ -113,11 +113,9 @@ const camelizeRE = /-(\w)/g
 /**
  * @private
  */
-export const camelize = cacheStringFunction(
-  (str: string): string => {
-    return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))
-  }
-)
+export const camelize = cacheStringFunction((str: string): string => {
+  return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))
+})
 
 const hyphenateRE = /\B([A-Z])/g
 /**
@@ -137,8 +135,8 @@ export const capitalize = cacheStringFunction(
 /**
  * @private
  */
-export const toHandlerKey = cacheStringFunction(
-  (str: string) => (str ? `on${capitalize(str)}` : ``)
+export const toHandlerKey = cacheStringFunction((str: string) =>
+  str ? `on${capitalize(str)}` : ``
 )
 
 // compare whether a value has changed, accounting for NaN.
@@ -172,11 +170,11 @@ export const getGlobalThis = (): any => {
       typeof globalThis !== 'undefined'
         ? globalThis
         : typeof self !== 'undefined'
-          ? self
-          : typeof window !== 'undefined'
-            ? window
-            : typeof global !== 'undefined'
-              ? global
-              : {})
+        ? self
+        : typeof window !== 'undefined'
+        ? window
+        : typeof global !== 'undefined'
+        ? global
+        : {})
   )
 }
index 1d0b69284002c246222953a69c5331cea1eca2eb..a8ee3bbb54ed31820c2dfb4307d62df1bde726da 100644 (file)
@@ -8,8 +8,8 @@ export const toDisplayString = (val: unknown): string => {
   return val == null
     ? ''
     : isObject(val)
-      ? JSON.stringify(val, replacer, 2)
-      : String(val)
+    ? JSON.stringify(val, replacer, 2)
+    : String(val)
 }
 
 const replacer = (_key: string, val: any) => {
index ee5ed750ba60dee69224ad6399f832b5ea94a243..683bf0452be8417864b84bb44dd5cadf02ed8aa8 100644 (file)
@@ -72,9 +72,7 @@ window.init = () => {
       lastSuccessfulMap = new SourceMapConsumer(map!)
       lastSuccessfulMap!.computeColumnSpans()
     } catch (e) {
-      lastSuccessfulCode = `/* ERROR: ${
-        e.message
-      } (see console for more info) */`
+      lastSuccessfulCode = `/* ERROR: ${e.message} (see console for more info) */`
       console.error(e)
     }
     return lastSuccessfulCode
@@ -195,8 +193,10 @@ window.init = () => {
         if (
           pos.line != null &&
           pos.column != null &&
-          !// ignore mock location
-          (pos.line === 1 && pos.column === 0)
+          !(
+            // ignore mock location
+            (pos.line === 1 && pos.column === 0)
+          )
         ) {
           const translatedPos = {
             column: pos.column + 1,
index f757a7118eadb46100e6425e209564d9b860dc4e..c5c5eba5a478938679c4f3a1f1dc042423d1bb9e 100644 (file)
@@ -48,8 +48,7 @@ const App = {
         h(
           'a',
           {
-            href:
-              'https://app.netlify.com/sites/vue-next-template-explorer/deploys',
+            href: 'https://app.netlify.com/sites/vue-next-template-explorer/deploys',
             target: `_blank`
           },
           'History'
@@ -147,7 +146,9 @@ const App = {
                 checked: compilerOptions.hoistStatic && !isSSR,
                 disabled: isSSR,
                 onChange(e: Event) {
-                  compilerOptions.hoistStatic = (e.target as HTMLInputElement).checked
+                  compilerOptions.hoistStatic = (
+                    e.target as HTMLInputElement
+                  ).checked
                 }
               }),
               h('label', { for: 'hoist' }, 'hoistStatic')
@@ -161,7 +162,9 @@ const App = {
                 checked: usePrefix && compilerOptions.cacheHandlers && !isSSR,
                 disabled: !usePrefix || isSSR,
                 onChange(e: Event) {
-                  compilerOptions.cacheHandlers = (e.target as HTMLInputElement).checked
+                  compilerOptions.cacheHandlers = (
+                    e.target as HTMLInputElement
+                  ).checked
                 }
               }),
               h('label', { for: 'cache' }, 'cacheHandlers')
@@ -191,7 +194,9 @@ const App = {
                 id: 'inline',
                 checked: compilerOptions.inline,
                 onChange(e: Event) {
-                  compilerOptions.inline = (e.target as HTMLInputElement).checked
+                  compilerOptions.inline = (
+                    e.target as HTMLInputElement
+                  ).checked
                 }
               }),
               h('label', { for: 'inline' }, 'inline')
@@ -204,8 +209,9 @@ const App = {
                 id: 'compat',
                 checked: compilerOptions.compatConfig!.MODE === 2,
                 onChange(e: Event) {
-                  compilerOptions.compatConfig!.MODE = (e.target as HTMLInputElement)
-                    .checked
+                  compilerOptions.compatConfig!.MODE = (
+                    e.target as HTMLInputElement
+                  ).checked
                     ? 2
                     : 3
                 }
index 3d272c586b5dfe87073d79ce3d300bfc50d25a52..82587cbf86b474d3e988d9fbaca0815c3d77d506 100644 (file)
@@ -55,7 +55,8 @@ test('COMPONENT_FUNCTIONAL', async () => {
   )
 
   expect(
-    (deprecationData[DeprecationTypes.COMPONENT_FUNCTIONAL]
-      .message as Function)(func)
+    (
+      deprecationData[DeprecationTypes.COMPONENT_FUNCTIONAL].message as Function
+    )(func)
   ).toHaveBeenWarned()
 })
index 350e1aeb1dc33b6f21380bd67bb1949aebc2716b..819ccc5d3efc6b7da1136ea29195f31cdf3cd86b 100644 (file)
@@ -26,10 +26,7 @@ describe('FILTERS', () => {
   }
 
   function reverse(v: string) {
-    return v
-      .split('')
-      .reverse()
-      .join('')
+    return v.split('').reverse().join('')
   }
 
   function double(v: number) {
index 6ef28f1ddbfd33688477e380691b875c3446f2c7..86bb4391092829b49a7ee3d785ed24ec537727fa 100644 (file)
@@ -145,10 +145,10 @@ describe('GLOBAL_EXTEND', () => {
   })
 
   it('should not merge nested mixins created with Vue.extend', () => {
-    const a = jest.fn();
-    const b = jest.fn();
-    const c = jest.fn();
-    const d = jest.fn();
+    const a = jest.fn()
+    const b = jest.fn()
+    const c = jest.fn()
+    const d = jest.fn()
     const A = Vue.extend({
       created: a
     })
@@ -163,7 +163,9 @@ describe('GLOBAL_EXTEND', () => {
     const D = Vue.extend({
       mixins: [C],
       created: d,
-      render() { return null },
+      render() {
+        return null
+      }
     })
     new D().$mount()
     expect(a.mock.calls.length).toStrictEqual(1)
@@ -255,7 +257,7 @@ describe('GLOBAL_PROTOTYPE', () => {
   })
 
   test('method this context', () => {
-    Vue.prototype.$test = function() {
+    Vue.prototype.$test = function () {
       return this.msg
     }
     const vm = new Vue({
index 3c71e831f4a080094d40aa0646e65650c9d0a17c..93ceda93c5471645a4a32a540bfd12facd3bda0e 100644 (file)
@@ -57,7 +57,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
   })
 
   it('$on', () => {
-    vm.$on('test', function(this: any) {
+    vm.$on('test', function (this: any) {
       // expect correct context
       expect(this).toBe(vm)
       spy.apply(this, arguments)
@@ -71,7 +71,7 @@ describe('INSTANCE_EVENT_EMITTER', () => {
   })
 
   it('$on multi event', () => {
-    vm.$on(['test1', 'test2'], function(this: any) {
+    vm.$on(['test1', 'test2'], function (this: any) {
       expect(this).toBe(vm)
       spy.apply(this, arguments)
     })
@@ -179,8 +179,10 @@ describe('INSTANCE_EVENT_HOOKS', () => {
     vm.$mount()
     expect(spy).toHaveBeenCalled()
     expect(
-      (deprecationData[DeprecationTypes.INSTANCE_EVENT_HOOKS]
-        .message as Function)('hook:mounted')
+      (
+        deprecationData[DeprecationTypes.INSTANCE_EVENT_HOOKS]
+          .message as Function
+      )('hook:mounted')
     ).toHaveBeenWarned()
   })
 
@@ -197,8 +199,10 @@ describe('INSTANCE_EVENT_HOOKS', () => {
     }).$mount()
     expect(spy).toHaveBeenCalled()
     expect(
-      (deprecationData[DeprecationTypes.INSTANCE_EVENT_HOOKS]
-        .message as Function)('hook:mounted')
+      (
+        deprecationData[DeprecationTypes.INSTANCE_EVENT_HOOKS]
+          .message as Function
+      )('hook:mounted')
     ).toHaveBeenWarned()
   })
 })
@@ -319,7 +323,9 @@ test('INSTANCE_ATTR_CLASS_STYLE', () => {
   )
 
   expect(
-    (deprecationData[DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE]
-      .message as Function)('Anonymous')
+    (
+      deprecationData[DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE]
+        .message as Function
+    )('Anonymous')
   ).toHaveBeenWarned()
 })
index cce9b3f86a7f6580a3faf3726edd58932fb3d3dc..a788fccb4a68d078bd2c7fad490136bdb0e03b33 100644 (file)
@@ -213,15 +213,21 @@ test('ATTR_ENUMERATED_COERCION', () => {
   expect(vm.$el.getAttribute('spellcheck')).toBe('true')
   expect(vm.$el.getAttribute('contenteditable')).toBe('true')
   expect(
-    (deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
-      .message as Function)('draggable', null, 'false')
+    (
+      deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
+        .message as Function
+    )('draggable', null, 'false')
   ).toHaveBeenWarned()
   expect(
-    (deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
-      .message as Function)('spellcheck', 0, 'true')
+    (
+      deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
+        .message as Function
+    )('spellcheck', 0, 'true')
   ).toHaveBeenWarned()
   expect(
-    (deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
-      .message as Function)('contenteditable', 'foo', 'true')
+    (
+      deprecationData[DeprecationTypes.ATTR_ENUMERATED_COERCION]
+        .message as Function
+    )('contenteditable', 'foo', 'true')
   ).toHaveBeenWarned()
 })
index bcfb3b622eae3ba00ed4a073b76e4e512fb2f705..642ecd20d1192e2e4b3a98a2f1b6420cc12224c3 100644 (file)
@@ -79,9 +79,9 @@ function compileToFunction(
   // with keys that cannot be mangled, and can be quite heavy size-wise.
   // In the global build we know `Vue` is available globally so we can avoid
   // the wildcard object.
-  const render = (__GLOBAL__
-    ? new Function(code)()
-    : new Function('Vue', code)(runtimeDom)) as RenderFunction
+  const render = (
+    __GLOBAL__ ? new Function(code)() : new Function('Vue', code)(runtimeDom)
+  ) as RenderFunction
 
   // mark the function as runtime compiled
   ;(render as InternalRenderFunction)._rc = true
index 76370b84784162272551a750f055eb05aeaa35bb..5cb5845b24ce7a7d7633b53c371e5e6b9d43c1f2 100644 (file)
@@ -12,10 +12,10 @@ Vue.compile = (() => {
         (__ESM_BUNDLER__
           ? ` Configure your bundler to alias "vue" to "@vue/compat/dist/vue.esm-bundler.js".`
           : __ESM_BROWSER__
-            ? ` Use "vue.esm-browser.js" instead.`
-            : __GLOBAL__
-              ? ` Use "vue.global.js" instead.`
-              : ``) /* should not happen */
+          ? ` Use "vue.esm-browser.js" instead.`
+          : __GLOBAL__
+          ? ` Use "vue.global.js" instead.`
+          : ``) /* should not happen */
     )
   }
 }) as any
index f871f8073d2b365d427922f9f7f4f5294d0cb756..bcb1fcb3b0a2388a1368a726e13152f66a8c3a1c 100644 (file)
@@ -3,15 +3,8 @@ import path from 'path'
 import { h, createApp, Transition, ref, nextTick } from 'vue'
 
 describe('e2e: Transition', () => {
-  const {
-    page,
-    html,
-    classList,
-    isVisible,
-    timeout,
-    nextFrame,
-    click
-  } = setupPuppeteer()
+  const { page, html, classList, isVisible, timeout, nextFrame, click } =
+    setupPuppeteer()
   const baseUrl = `file://${path.resolve(__dirname, './transition.html')}`
 
   const duration = process.env.CI ? 200 : 50
@@ -21,7 +14,7 @@ describe('e2e: Transition', () => {
 
   const classWhenTransitionStart = () =>
     page().evaluate(() => {
-      (document.querySelector('#toggleBtn') as any)!.click()
+      ;(document.querySelector('#toggleBtn') as any)!.click()
       return Promise.resolve().then(() => {
         return document.querySelector('#container div')!.className.split(/\s+/g)
       })
@@ -1066,7 +1059,7 @@ describe('e2e: Transition', () => {
 
         // change view -> 'two'
         await page().evaluate(() => {
-          (document.querySelector('#changeViewBtn') as any)!.click()
+          ;(document.querySelector('#changeViewBtn') as any)!.click()
         })
         // enter
         expect(await classWhenTransitionStart()).toStrictEqual([
@@ -1085,7 +1078,7 @@ describe('e2e: Transition', () => {
 
         // change view -> 'one'
         await page().evaluate(() => {
-          (document.querySelector('#changeViewBtn') as any)!.click()
+          ;(document.querySelector('#changeViewBtn') as any)!.click()
         })
         // leave
         expect(await classWhenTransitionStart()).toStrictEqual([
@@ -1172,7 +1165,7 @@ describe('e2e: Transition', () => {
 
         // enter
         const enterClass = await page().evaluate(async () => {
-          (document.querySelector('#toggleBtn') as any)!.click()
+          ;(document.querySelector('#toggleBtn') as any)!.click()
           // nextTrick for patch start
           await Promise.resolve()
           // nextTrick for Suspense resolve
@@ -2001,10 +1994,8 @@ describe('e2e: Transition', () => {
     const root = document.createElement('div')
     createApp({
       render() {
-        return h(
-          MyTransition,
-          { onLeave: () => outerSpy() },
-          () => (toggle.value ? h('div') : null)
+        return h(MyTransition, { onLeave: () => outerSpy() }, () =>
+          toggle.value ? h('div') : null
         )
       }
     }).mount(root)
index ea649dc5abb111c257162fd767972d9872baf15d..6ba057638018bda1cc018aaf20420f0a5238c853 100644 (file)
@@ -11,7 +11,7 @@ describe('e2e: TransitionGroup', () => {
 
   const htmlWhenTransitionStart = () =>
     page().evaluate(() => {
-      (document.querySelector('#toggleBtn') as any)!.click()
+      ;(document.querySelector('#toggleBtn') as any)!.click()
       return Promise.resolve().then(() => {
         return document.querySelector('#container')!.innerHTML
       })
index 8ec7b55810e3248ccb3c80171597106bcc6d5884..fc83518f1e0f78089486952a18da294cfaab0950 100644 (file)
@@ -18,11 +18,9 @@ export default {
         message: 'test: add test for runtime-dom/modules/class (#75)',
         tree: {
           sha: 'f53f761827af281db86c31d113086c068c1d0789',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/git/trees/f53f761827af281db86c31d113086c068c1d0789'
+          url: 'https://api.github.com/repos/vuejs/vue-next/git/trees/f53f761827af281db86c31d113086c068c1d0789'
         },
-        url:
-          'https://api.github.com/repos/vuejs/vue-next/git/commits/d1527fbee422c7170e56845e55b49c4fd6de72a7',
+        url: 'https://api.github.com/repos/vuejs/vue-next/git/commits/d1527fbee422c7170e56845e55b49c4fd6de72a7',
         comment_count: 0,
         verification: {
           verified: false,
@@ -31,8 +29,7 @@ export default {
           payload: null
         }
       },
-      url:
-        'https://api.github.com/repos/vuejs/vue-next/commits/d1527fbee422c7170e56845e55b49c4fd6de72a7',
+      url: 'https://api.github.com/repos/vuejs/vue-next/commits/d1527fbee422c7170e56845e55b49c4fd6de72a7',
       html_url:
         'https://github.com/vuejs/vue-next/commit/d1527fbee422c7170e56845e55b49c4fd6de72a7',
       comments_url:
@@ -87,8 +84,7 @@ export default {
       parents: [
         {
           sha: '2383b45e322272ddc102d6914c149b284a25d04f',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/commits/2383b45e322272ddc102d6914c149b284a25d04f',
+          url: 'https://api.github.com/repos/vuejs/vue-next/commits/2383b45e322272ddc102d6914c149b284a25d04f',
           html_url:
             'https://github.com/vuejs/vue-next/commit/2383b45e322272ddc102d6914c149b284a25d04f'
         }
@@ -112,11 +108,9 @@ export default {
         message: 'chore: fix typo (#530) [ci skip]',
         tree: {
           sha: '2a5872ff8dc8ccb8121abd7e890ac3c0c9f1209f',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/git/trees/2a5872ff8dc8ccb8121abd7e890ac3c0c9f1209f'
+          url: 'https://api.github.com/repos/vuejs/vue-next/git/trees/2a5872ff8dc8ccb8121abd7e890ac3c0c9f1209f'
         },
-        url:
-          'https://api.github.com/repos/vuejs/vue-next/git/commits/2383b45e322272ddc102d6914c149b284a25d04f',
+        url: 'https://api.github.com/repos/vuejs/vue-next/git/commits/2383b45e322272ddc102d6914c149b284a25d04f',
         comment_count: 0,
         verification: {
           verified: false,
@@ -125,8 +119,7 @@ export default {
           payload: null
         }
       },
-      url:
-        'https://api.github.com/repos/vuejs/vue-next/commits/2383b45e322272ddc102d6914c149b284a25d04f',
+      url: 'https://api.github.com/repos/vuejs/vue-next/commits/2383b45e322272ddc102d6914c149b284a25d04f',
       html_url:
         'https://github.com/vuejs/vue-next/commit/2383b45e322272ddc102d6914c149b284a25d04f',
       comments_url:
@@ -182,8 +175,7 @@ export default {
       parents: [
         {
           sha: 'e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
+          url: 'https://api.github.com/repos/vuejs/vue-next/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
           html_url:
             'https://github.com/vuejs/vue-next/commit/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad'
         }
@@ -207,11 +199,9 @@ export default {
         message: 'test: fix warning',
         tree: {
           sha: 'd942b17681e2e2fbbcd2ee04092390c7f2cf534d',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/git/trees/d942b17681e2e2fbbcd2ee04092390c7f2cf534d'
+          url: 'https://api.github.com/repos/vuejs/vue-next/git/trees/d942b17681e2e2fbbcd2ee04092390c7f2cf534d'
         },
-        url:
-          'https://api.github.com/repos/vuejs/vue-next/git/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
+        url: 'https://api.github.com/repos/vuejs/vue-next/git/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
         comment_count: 0,
         verification: {
           verified: false,
@@ -220,8 +210,7 @@ export default {
           payload: null
         }
       },
-      url:
-        'https://api.github.com/repos/vuejs/vue-next/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
+      url: 'https://api.github.com/repos/vuejs/vue-next/commits/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
       html_url:
         'https://github.com/vuejs/vue-next/commit/e7e1314cccd1a66fcf8b8526ec21350ec16cc3ad',
       comments_url:
@@ -277,8 +266,7 @@ export default {
       parents: [
         {
           sha: '12ec62e6881f83dfa6c7f8a3c3650ec2567e6b1e',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/commits/12ec62e6881f83dfa6c7f8a3c3650ec2567e6b1e',
+          url: 'https://api.github.com/repos/vuejs/vue-next/commits/12ec62e6881f83dfa6c7f8a3c3650ec2567e6b1e',
           html_url:
             'https://github.com/vuejs/vue-next/commit/12ec62e6881f83dfa6c7f8a3c3650ec2567e6b1e'
         }
@@ -304,11 +292,9 @@ export default {
         message: 'chore: fix tests',
         tree: {
           sha: '6ac7bd078a6eb0ad32b5102e0c5d2c29f2b20a48',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/git/trees/6ac7bd078a6eb0ad32b5102e0c5d2c29f2b20a48'
+          url: 'https://api.github.com/repos/vuejs/vue-next/git/trees/6ac7bd078a6eb0ad32b5102e0c5d2c29f2b20a48'
         },
-        url:
-          'https://api.github.com/repos/vuejs/vue-next/git/commits/ecf4da822eea97f5db5fa769d39f994755384a4b',
+        url: 'https://api.github.com/repos/vuejs/vue-next/git/commits/ecf4da822eea97f5db5fa769d39f994755384a4b',
         comment_count: 0,
         verification: {
           verified: false,
@@ -317,8 +303,7 @@ export default {
           payload: null
         }
       },
-      url:
-        'https://api.github.com/repos/vuejs/vue-next/commits/ecf4da822eea97f5db5fa769d39f994755384a4b',
+      url: 'https://api.github.com/repos/vuejs/vue-next/commits/ecf4da822eea97f5db5fa769d39f994755384a4b',
       html_url:
         'https://github.com/vuejs/vue-next/commit/ecf4da822eea97f5db5fa769d39f994755384a4b',
       comments_url:
@@ -374,8 +359,7 @@ export default {
       parents: [
         {
           sha: 'ca296812d54aff123472d7147b83fddfb634d9bc',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
+          url: 'https://api.github.com/repos/vuejs/vue-next/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
           html_url:
             'https://github.com/vuejs/vue-next/commit/ca296812d54aff123472d7147b83fddfb634d9bc'
         }
@@ -399,11 +383,9 @@ export default {
         message: 'refactor: bring back clone for reused nodes',
         tree: {
           sha: '2cec32c97686e0ee9af1b87f0abdbbbdc18b6de6',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/git/trees/2cec32c97686e0ee9af1b87f0abdbbbdc18b6de6'
+          url: 'https://api.github.com/repos/vuejs/vue-next/git/trees/2cec32c97686e0ee9af1b87f0abdbbbdc18b6de6'
         },
-        url:
-          'https://api.github.com/repos/vuejs/vue-next/git/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
+        url: 'https://api.github.com/repos/vuejs/vue-next/git/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
         comment_count: 0,
         verification: {
           verified: false,
@@ -412,8 +394,7 @@ export default {
           payload: null
         }
       },
-      url:
-        'https://api.github.com/repos/vuejs/vue-next/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
+      url: 'https://api.github.com/repos/vuejs/vue-next/commits/ca296812d54aff123472d7147b83fddfb634d9bc',
       html_url:
         'https://github.com/vuejs/vue-next/commit/ca296812d54aff123472d7147b83fddfb634d9bc',
       comments_url:
@@ -469,8 +450,7 @@ export default {
       parents: [
         {
           sha: 'e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
+          url: 'https://api.github.com/repos/vuejs/vue-next/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
           html_url:
             'https://github.com/vuejs/vue-next/commit/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b'
         }
@@ -494,11 +474,9 @@ export default {
         message: 'chore: relax render type for tsx',
         tree: {
           sha: '7e2b3bb92ab91f755b2251e4a7903e6dd2042602',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/git/trees/7e2b3bb92ab91f755b2251e4a7903e6dd2042602'
+          url: 'https://api.github.com/repos/vuejs/vue-next/git/trees/7e2b3bb92ab91f755b2251e4a7903e6dd2042602'
         },
-        url:
-          'https://api.github.com/repos/vuejs/vue-next/git/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
+        url: 'https://api.github.com/repos/vuejs/vue-next/git/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
         comment_count: 0,
         verification: {
           verified: false,
@@ -507,8 +485,7 @@ export default {
           payload: null
         }
       },
-      url:
-        'https://api.github.com/repos/vuejs/vue-next/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
+      url: 'https://api.github.com/repos/vuejs/vue-next/commits/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
       html_url:
         'https://github.com/vuejs/vue-next/commit/e6be55a4989edb6f8750dbaa14eb693ec1f0d67b',
       comments_url:
@@ -564,8 +541,7 @@ export default {
       parents: [
         {
           sha: 'ccc835caff0344baad3c92ce786ad4f804bf667b',
-          url:
-            'https://api.github.com/repos/vuejs/vue-next/commits/ccc835caff0344baad3c92ce786ad4f804bf667b',
+          url: 'https://api.github.com/repos/vuejs/vue-next/commits/ccc835caff0344baad3c92ce786ad4f804bf667b',
           html_url:
             'https://github.com/vuejs/vue-next/commit/ccc835caff0344baad3c92ce786ad4f804bf667b'
         }
index 60ea75fd4db5de345082beaa0c6116ef5060f77f..4fa3f12527017e4459c9b4d8bcb7263430becbdb 100644 (file)
@@ -74,9 +74,9 @@ function compileToFunction(
   // with keys that cannot be mangled, and can be quite heavy size-wise.
   // In the global build we know `Vue` is available globally so we can avoid
   // the wildcard object.
-  const render = (__GLOBAL__
-    ? new Function(code)()
-    : new Function('Vue', code)(runtimeDom)) as RenderFunction
+  const render = (
+    __GLOBAL__ ? new Function(code)() : new Function('Vue', code)(runtimeDom)
+  ) as RenderFunction
 
   // mark the function as runtime compiled
   ;(render as InternalRenderFunction)._rc = true
index 1452fceb003156d749e6e11de3b078f5bcf2c30b..7fe70670a5ed2b475cf1a8d1ee8ce6301d55787a 100644 (file)
@@ -16,10 +16,10 @@ export const compile = () => {
         (__ESM_BUNDLER__
           ? ` Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".`
           : __ESM_BROWSER__
-            ? ` Use "vue.esm-browser.js" instead.`
-            : __GLOBAL__
-              ? ` Use "vue.global.js" instead.`
-              : ``) /* should not happen */
+          ? ` Use "vue.esm-browser.js" instead.`
+          : __GLOBAL__
+          ? ` Use "vue.global.js" instead.`
+          : ``) /* should not happen */
     )
   }
 }