From: Evan You Date: Wed, 15 Apr 2020 14:51:07 +0000 (-0400) Subject: chore: run prettier X-Git-Tag: v3.0.0-alpha.13~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1068212cb2c3e8be89b11fc677a963f94db23708;p=thirdparty%2Fvuejs%2Fcore.git chore: run prettier --- diff --git a/packages/compiler-core/__tests__/transforms/vIf.spec.ts b/packages/compiler-core/__tests__/transforms/vIf.spec.ts index 0513ff4e33..0ded2ac206 100644 --- a/packages/compiler-core/__tests__/transforms/vIf.spec.ts +++ b/packages/compiler-core/__tests__/transforms/vIf.spec.ts @@ -78,7 +78,7 @@ describe('compiler: v-if', () => { expect(node.branches[0].children[2].type).toBe(NodeTypes.ELEMENT) expect((node.branches[0].children[2] as ElementNode).tag).toBe(`p`) }) - + test('component v-if', () => { const { node } = parseWithIfTransform(``) expect(node.type).toBe(NodeTypes.IF) diff --git a/packages/compiler-core/src/index.ts b/packages/compiler-core/src/index.ts index 432492aa2a..ba2587fdd7 100644 --- a/packages/compiler-core/src/index.ts +++ b/packages/compiler-core/src/index.ts @@ -48,6 +48,10 @@ export { trackVForSlotScopes, trackSlotScopes } from './transforms/vSlot' -export { transformElement, resolveComponentType, buildProps } from './transforms/transformElement' +export { + transformElement, + resolveComponentType, + buildProps +} from './transforms/transformElement' export { processSlotOutlet } from './transforms/transformSlotOutlet' export { generateCodeFrame } from '@vue/shared' diff --git a/packages/runtime-dom/jsx.d.ts b/packages/runtime-dom/jsx.d.ts index cdf6f409d2..8748c4f661 100644 --- a/packages/runtime-dom/jsx.d.ts +++ b/packages/runtime-dom/jsx.d.ts @@ -79,7 +79,15 @@ interface AriaAttributes { */ 'aria-controls'?: string /** Indicates the element that represents the current item within a container or set of related elements. */ - 'aria-current'?: boolean | 'false' | 'true' | 'page' | 'step' | 'location' | 'date' | 'time' + 'aria-current'?: + | boolean + | 'false' + | 'true' + | 'page' + | 'step' + | 'location' + | 'date' + | 'time' /** * Identifies the element (or elements) that describes the object. * @see aria-labelledby @@ -118,7 +126,15 @@ interface AriaAttributes { */ 'aria-grabbed'?: boolean | 'false' | 'true' /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ - 'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' + 'aria-haspopup'?: + | boolean + | 'false' + | 'true' + | 'menu' + | 'listbox' + | 'tree' + | 'grid' + | 'dialog' /** * Indicates whether the element is exposed to an accessibility API. * @see aria-disabled. @@ -228,16 +244,15 @@ interface AriaAttributes { 'aria-valuetext'?: string } -export interface HTMLAttributes extends AriaAttributes{ - - domPropsInnerHTML?: string; +export interface HTMLAttributes extends AriaAttributes { + domPropsInnerHTML?: string class?: any style?: string | CSSProperties // Standard HTML Attributes accesskey?: string - contenteditable?: Booleanish | "inherit" + contenteditable?: Booleanish | 'inherit' contextmenu?: string dir?: string draggable?: Booleanish @@ -285,7 +300,15 @@ export interface HTMLAttributes extends AriaAttributes{ * Hints at the type of data that might be entered by the user while editing the element or its contents * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute */ - inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search' + inputmode?: + | 'none' + | 'text' + | 'tel' + | 'url' + | 'email' + | 'numeric' + | 'decimal' + | 'search' /** * Specify that a standard HTML element should behave like a defined custom built-in element * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is @@ -317,8 +340,7 @@ export interface AreaHTMLAttributes extends HTMLAttributes { target?: string } -export interface AudioHTMLAttributes extends MediaHTMLAttributes { -} +export interface AudioHTMLAttributes extends MediaHTMLAttributes {} export interface BaseHTMLAttributes extends HTMLAttributes { href?: string @@ -712,8 +734,7 @@ export interface WebViewHTMLAttributes extends HTMLAttributes { } export interface SVGAttributes extends AriaAttributes { - - domPropsInnerHTML?: string; + domPropsInnerHTML?: string color?: string height?: number | string @@ -736,7 +757,20 @@ export interface SVGAttributes extends AriaAttributes { 'accent-height'?: number | string accumulate?: 'none' | 'sum' additive?: 'replace' | 'sum' - 'alignment-baseline'?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit' + 'alignment-baseline'?: + | 'auto' + | 'baseline' + | 'before-edge' + | 'text-before-edge' + | 'middle' + | 'central' + | 'after-edge' + | 'text-after-edge' + | 'ideographic' + | 'alphabetic' + | 'hanging' + | 'mathematical' + | 'inherit' allowReorder?: 'no' | 'yes' alphabetic?: number | string amplitude?: number | string @@ -955,13 +989,13 @@ export interface SVGAttributes extends AriaAttributes { x?: number | string xChannelSelector?: string 'x-height'?: number | string - 'xlinkActuate'?: string - 'xlinkArcrole'?: string - 'xlinkHref'?: string - 'xlinkRole'?: string - 'xlinkShow'?: string - 'xlinkTitle'?: string - 'xlinkType'?: string + xlinkActuate?: string + xlinkArcrole?: string + xlinkHref?: string + xlinkRole?: string + xlinkShow?: string + xlinkTitle?: string + xlinkType?: string y1?: number | string y2?: number | string y?: number | string diff --git a/packages/server-renderer/src/helpers/ssrRenderAttrs.ts b/packages/server-renderer/src/helpers/ssrRenderAttrs.ts index d17c0dd11d..958e470805 100644 --- a/packages/server-renderer/src/helpers/ssrRenderAttrs.ts +++ b/packages/server-renderer/src/helpers/ssrRenderAttrs.ts @@ -53,9 +53,7 @@ export function ssrRenderDynamicAttr( if (isBooleanAttr(attrKey)) { return value === false ? `` : ` ${attrKey}` } else if (isSSRSafeAttrName(attrKey)) { - return value === '' - ? ` ${attrKey}` - : ` ${attrKey}="${escapeHtml(value)}"` + return value === '' ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"` } else { console.warn( `[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`