Explorar o código

chore: fix typos (#1090)

HiiTea %!s(int64=6) %!d(string=hai) anos
pai
achega
22717772dd
Modificáronse 25 ficheiros con 42 adicións e 42 borrados
  1. 2 2
      packages/compiler-core/__tests__/transforms/__snapshots__/vModel.spec.ts.snap
  2. 4 4
      packages/compiler-core/__tests__/transforms/vModel.spec.ts
  3. 1 1
      packages/compiler-core/src/parse.ts
  4. 1 1
      packages/compiler-core/src/transforms/hoistStatic.ts
  5. 1 1
      packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts
  6. 1 1
      packages/compiler-ssr/src/transforms/ssrVFor.ts
  7. 1 1
      packages/compiler-ssr/src/transforms/ssrVIf.ts
  8. 1 1
      packages/reactivity/__tests__/effect.spec.ts
  9. 1 1
      packages/reactivity/__tests__/reactiveArray.spec.ts
  10. 2 2
      packages/runtime-core/__tests__/components/BaseTransition.spec.ts
  11. 3 3
      packages/runtime-core/__tests__/hmr.spec.ts
  12. 1 1
      packages/runtime-core/__tests__/hydration.spec.ts
  13. 2 2
      packages/runtime-core/__tests__/scheduler.spec.ts
  14. 9 9
      packages/runtime-core/__tests__/vnode.spec.ts
  15. 2 2
      packages/runtime-core/src/apiDefineComponent.ts
  16. 1 1
      packages/runtime-core/src/componentProps.ts
  17. 1 1
      packages/runtime-core/src/components/BaseTransition.ts
  18. 1 1
      packages/runtime-core/src/components/Suspense.ts
  19. 1 1
      packages/runtime-dom/__tests__/customizedBuiltIn.spec.ts
  20. 1 1
      packages/runtime-dom/__tests__/directives/vModel.spec.ts
  21. 1 1
      packages/runtime-dom/src/modules/attrs.ts
  22. 1 1
      packages/server-renderer/__tests__/renderToString.spec.ts
  23. 1 1
      packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts
  24. 1 1
      packages/shared/src/patchFlags.ts
  25. 1 1
      packages/vue/__tests__/svgNamespace.spec.ts

+ 2 - 2
packages/compiler-core/__tests__/transforms/__snapshots__/vModel.spec.ts.snap

@@ -26,7 +26,7 @@ return function render(_ctx, _cache) {
 }"
 `;
 
-exports[`compiler: transform v-model simple exprssion (with prefixIdentifiers) 1`] = `
+exports[`compiler: transform v-model simple expression (with prefixIdentifiers) 1`] = `
 "import { createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \\"vue\\"
 
 export function render(_ctx, _cache) {
@@ -37,7 +37,7 @@ export function render(_ctx, _cache) {
 }"
 `;
 
-exports[`compiler: transform v-model simple exprssion 1`] = `
+exports[`compiler: transform v-model simple expression 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {

+ 4 - 4
packages/compiler-core/__tests__/transforms/vModel.spec.ts

@@ -39,7 +39,7 @@ function parseWithVModel(template: string, options: CompilerOptions = {}) {
 }
 
 describe('compiler: transform v-model', () => {
-  test('simple exprssion', () => {
+  test('simple expression', () => {
     const root = parseWithVModel('<input v-model="model" />')
     const node = root.children[0] as ElementNode
     const props = ((node.codegenNode as VNodeCall).props as ObjectExpression)
@@ -76,7 +76,7 @@ describe('compiler: transform v-model', () => {
     expect(generate(root).code).toMatchSnapshot()
   })
 
-  test('simple exprssion (with prefixIdentifiers)', () => {
+  test('simple expression (with prefixIdentifiers)', () => {
     const root = parseWithVModel('<input v-model="model" />', {
       prefixIdentifiers: true
     })
@@ -377,7 +377,7 @@ describe('compiler: transform v-model', () => {
     expect(codegen.dynamicProps).toBe(`["modelValue", "onUpdate:modelValue"]`)
   })
 
-  test('should generate modelModifers for component v-model', () => {
+  test('should generate modelModifiers for component v-model', () => {
     const root = parseWithVModel('<Comp v-model.trim.bar-baz="foo" />', {
       prefixIdentifiers: true
     })
@@ -399,7 +399,7 @@ describe('compiler: transform v-model', () => {
     expect(vnodeCall.dynamicProps).toBe(`["modelValue", "onUpdate:modelValue"]`)
   })
 
-  test('should generate modelModifers for component v-model with arguments', () => {
+  test('should generate modelModifiers for component v-model with arguments', () => {
     const root = parseWithVModel(
       '<Comp v-model:foo.trim="foo" v-model:bar.number="bar" />',
       {

+ 1 - 1
packages/compiler-core/src/parse.ts

@@ -31,7 +31,7 @@ type MergedParserOptions = Omit<Required<ParserOptions>, OptionalOptions> &
   Pick<ParserOptions, OptionalOptions>
 
 // The default decoder only provides escapes for characters reserved as part of
-// the tempalte syntax, and is only used if the custom renderer did not provide
+// the template syntax, and is only used if the custom renderer did not provide
 // a platform-specific decoder.
 const decodeRE = /&(gt|lt|amp|apos|quot);/g
 const decodeMap: Record<string, string> = {

+ 1 - 1
packages/compiler-core/src/transforms/hoistStatic.ts

@@ -19,7 +19,7 @@ export function hoistStatic(root: RootNode, context: TransformContext) {
     root.children,
     context,
     new Map(),
-    // Root node is unfortuantely non-hoistable due to potential parent
+    // Root node is unfortunately non-hoistable due to potential parent
     // fallthrough attributes.
     isSingleElementRoot(root, root.children[0])
   )

+ 1 - 1
packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts

@@ -75,7 +75,7 @@ describe('stringify static html', () => {
     })
   })
 
-  test('serliazing constant bindings', () => {
+  test('serializing constant bindings', () => {
     const { ast } = compileWithStringify(
       `<div><div :style="{ color: 'red' }">${repeat(
         `<span :class="[{ foo: true }, { bar: true }]">{{ 1 }} + {{ false }}</span>`,

+ 1 - 1
packages/compiler-ssr/src/transforms/ssrVFor.ts

@@ -19,7 +19,7 @@ export const ssrTransformFor = createStructuralDirectiveTransform(
   processFor
 )
 
-// This is called during the 2nd transform pass to construct the SSR-sepcific
+// This is called during the 2nd transform pass to construct the SSR-specific
 // codegen nodes.
 export function ssrProcessFor(node: ForNode, context: SSRTransformContext) {
   const needFragmentWrapper =

+ 1 - 1
packages/compiler-ssr/src/transforms/ssrVIf.ts

@@ -20,7 +20,7 @@ export const ssrTransformIf = createStructuralDirectiveTransform(
   processIf
 )
 
-// This is called during the 2nd transform pass to construct the SSR-sepcific
+// This is called during the 2nd transform pass to construct the SSR-specific
 // codegen nodes.
 export function ssrProcessIf(node: IfNode, context: SSRTransformContext) {
   const [rootBranch] = node.branches

+ 1 - 1
packages/reactivity/__tests__/effect.spec.ts

@@ -759,7 +759,7 @@ describe('reactivity/effect', () => {
     expect(fnSpy).toHaveBeenCalledTimes(1)
   })
 
-  it('should trigger all effects when array lenght is set 0', () => {
+  it('should trigger all effects when array length is set 0', () => {
     const observed: any = reactive([1])
     let dummy, record
     effect(() => {

+ 1 - 1
packages/reactivity/__tests__/reactiveArray.spec.ts

@@ -121,7 +121,7 @@ describe('reactivity/reactive/Array', () => {
       expect(isRef(raw[1])).toBe(true)
     })
 
-    test('read + indentity', () => {
+    test('read + identity', () => {
       const ref = original[1]
       expect(ref).toBe(toRaw(original)[1])
       expect(original.indexOf(ref)).toBe(1)

+ 2 - 2
packages/runtime-core/__tests__/components/BaseTransition.spec.ts

@@ -664,7 +664,7 @@ describe('BaseTransition', () => {
       expect(props.onAfterEnter).toHaveBeenCalledTimes(1)
       assertCalledWithEl(props.onAfterEnter, falseSerialized)
 
-      // toggele again
+      // toggle again
       toggle.value = true
       await nextTick()
       expect(serializeInner(root)).toBe(`${falseSerialized}<!---->`)
@@ -740,7 +740,7 @@ describe('BaseTransition', () => {
       await nextTick()
       // expected behavior: the previous true branch is preserved,
       // and a placeholder is injected for the replacement.
-      // the leaving node is repalced with the replace node (of the same branch)
+      // the leaving node is replaced with the replace node (of the same branch)
       // when it finishes leaving
       expect(serializeInner(root)).toBe(`${trueSerialized}<!---->`)
       // enter hooks should never be called (for neither branch)

+ 3 - 3
packages/runtime-core/__tests__/hmr.spec.ts

@@ -112,7 +112,7 @@ describe('hot module replacement', () => {
   test('reload', async () => {
     const root = nodeOps.createElement('div')
     const childId = 'test3-child'
-    const unmoutSpy = jest.fn()
+    const unmountSpy = jest.fn()
     const mountSpy = jest.fn()
 
     const Child: ComponentOptions = {
@@ -120,7 +120,7 @@ describe('hot module replacement', () => {
       data() {
         return { count: 0 }
       },
-      unmounted: unmoutSpy,
+      unmounted: unmountSpy,
       render: compileToFunction(`<div @click="count++">{{ count }}</div>`)
     }
     createRecord(childId, Child)
@@ -142,7 +142,7 @@ describe('hot module replacement', () => {
     })
     await nextTick()
     expect(serializeInner(root)).toBe(`<div>1</div>`)
-    expect(unmoutSpy).toHaveBeenCalledTimes(1)
+    expect(unmountSpy).toHaveBeenCalledTimes(1)
     expect(mountSpy).toHaveBeenCalledTimes(1)
   })
 })

+ 1 - 1
packages/runtime-core/__tests__/hydration.spec.ts

@@ -653,7 +653,7 @@ describe('SSR hydration', () => {
       // fragment ends early and attempts to hydrate the extra <div>bar</div>
       // as 2nd fragment child.
       expect(`Hydration text content mismatch`).toHaveBeenWarned()
-      // exccesive children removal
+      // excessive children removal
       expect(`Hydration children mismatch`).toHaveBeenWarned()
     })
   })

+ 2 - 2
packages/runtime-core/__tests__/scheduler.spec.ts

@@ -62,7 +62,7 @@ describe('scheduler', () => {
       const calls: string[] = []
       const job1 = () => {
         calls.push('job1')
-        // job2 will be excuted after job1 at the same tick
+        // job2 will be executed after job1 at the same tick
         queueJob(job2)
       }
       const job2 = () => {
@@ -123,7 +123,7 @@ describe('scheduler', () => {
       const calls: string[] = []
       const cb1 = () => {
         calls.push('cb1')
-        // cb2 will be excuted after cb1 at the same tick
+        // cb2 will be executed after cb1 at the same tick
         queuePostFlushCb(cb2)
       }
       const cb2 = () => {

+ 9 - 9
packages/runtime-core/__tests__/vnode.spec.ts

@@ -199,7 +199,7 @@ describe('vnode', () => {
     expect(cloneVNode(node2)).toEqual(node2)
     expect(cloneVNode(node2)).toEqual(cloned2)
 
-    // #1041 should use reoslved key/ref
+    // #1041 should use resolved key/ref
     expect(cloneVNode(createVNode('div', { key: 1 })).key).toBe(1)
     expect(cloneVNode(createVNode('div', { key: 1 }), { key: 2 }).key).toBe(2)
     expect(cloneVNode(createVNode('div'), { key: 2 }).key).toBe(2)
@@ -260,15 +260,15 @@ describe('vnode', () => {
     })
 
     test('handlers', () => {
-      let clickHander1 = function() {}
-      let clickHander2 = function() {}
-      let focusHander2 = function() {}
+      let clickHandler1 = function() {}
+      let clickHandler2 = function() {}
+      let focusHandler2 = function() {}
 
-      let props1: Data = { onClick: clickHander1 }
-      let props2: Data = { onClick: clickHander2, onFocus: focusHander2 }
+      let props1: Data = { onClick: clickHandler1 }
+      let props2: Data = { onClick: clickHandler2, onFocus: focusHandler2 }
       expect(mergeProps(props1, props2)).toMatchObject({
-        onClick: [clickHander1, clickHander2],
-        onFocus: focusHander2
+        onClick: [clickHandler1, clickHandler2],
+        onFocus: focusHandler2
       })
     })
 
@@ -359,7 +359,7 @@ describe('vnode', () => {
     // #1039
     // <component :is="foo">{{ bar }}</component>
     // - content is compiled as slot
-    // - dynamic component reoslves to plain element, but as a block
+    // - dynamic component resolves to plain element, but as a block
     // - block creation disables its own tracking, accidentally causing the
     //   slot content (called during the block node creation) to be missed
     test('element block should track normalized slot children', () => {

+ 2 - 2
packages/runtime-core/src/apiDefineComponent.ts

@@ -14,7 +14,7 @@ import { VNodeProps } from './vnode'
 
 // defineComponent is a utility that is primarily used for type inference
 // when declaring components. Type inference is provided in the component
-// options (provided as the argument). The returned value has artifical types
+// options (provided as the argument). The returned value has artificial types
 // for TSX / manual render function / IDE support.
 
 // overload 1: direct setup function
@@ -83,7 +83,7 @@ export function defineComponent<
     EE
   >
 ): {
-  // array props technically doesn't place any contraints on props in TSX
+  // array props technically doesn't place any constraints on props in TSX
   new (): ComponentPublicInstance<VNodeProps, RawBindings, D, C, M, E>
 } & ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, E, EE>
 

+ 1 - 1
packages/runtime-core/src/componentProps.ts

@@ -48,7 +48,7 @@ type PropConstructor<T = any> =
   | PropMethod<T>
 
 type PropMethod<T> = T extends (...args: any) => any // if is function with args
-  ? { new (): T; (): T; readonly proptotype: Function } // Create Function like contructor
+  ? { new (): T; (): T; readonly proptotype: Function } // Create Function like constructor
   : never
 
 type RequiredKeys<T, MakeDefaultRequired> = {

+ 1 - 1
packages/runtime-core/src/components/BaseTransition.ts

@@ -75,7 +75,7 @@ export interface TransitionState {
 
 export interface TransitionElement {
   // in persisted mode (e.g. v-show), the same element is toggled, so the
-  // pending enter/leave callbacks may need to cancalled if the state is toggled
+  // pending enter/leave callbacks may need to be cancelled if the state is toggled
   // before it finishes.
   _enterCb?: PendingCallback
   _leaveCb?: PendingCallback

+ 1 - 1
packages/runtime-core/src/components/Suspense.ts

@@ -432,7 +432,7 @@ function createSuspenseBoundary(
           handleSetupResult(instance, asyncSetupResult, false)
           if (hydratedEl) {
             // vnode may have been replaced if an update happened before the
-            // async dep is reoslved.
+            // async dep is resolved.
             vnode.el = hydratedEl
           }
           setupRenderEffect(

+ 1 - 1
packages/runtime-dom/__tests__/customizedBuiltIn.spec.ts

@@ -1,6 +1,6 @@
 import { render, h } from '@vue/runtime-dom'
 
-describe('customimized built-in elements support', () => {
+describe('customized built-in elements support', () => {
   let createElement: jest.SpyInstance
   afterEach(() => {
     createElement.mockRestore()

+ 1 - 1
packages/runtime-dom/__tests__/directives/vModel.spec.ts

@@ -114,7 +114,7 @@ describe('vModel', () => {
     await nextTick()
     expect(spy1).toHaveBeenCalledWith('foo')
 
-    // udpate listener
+    // update listener
     toggle.value = false
     await nextTick()
 

+ 1 - 1
packages/runtime-dom/src/modules/attrs.ts

@@ -16,7 +16,7 @@ export function patchAttr(
     }
   } else {
     // note we are only checking boolean attributes that don't have a
-    // correspoding dom prop of the same name here.
+    // corresponding dom prop of the same name here.
     const isBoolean = isSpecialBooleanAttr(key)
     if (value == null || (isBoolean && value === false)) {
       el.removeAttribute(key)

+ 1 - 1
packages/server-renderer/__tests__/renderToString.spec.ts

@@ -370,7 +370,7 @@ describe('ssr: renderToString', () => {
 
     test('async components', async () => {
       const Child = {
-        // should wait for resovled render context from setup()
+        // should wait for resolved render context from setup()
         async setup() {
           return {
             msg: 'hello'

+ 1 - 1
packages/server-renderer/__tests__/ssrRenderAttrs.spec.ts

@@ -61,7 +61,7 @@ describe('ssr: renderAttrs', () => {
     ).toBe(` foo="false"`) // non boolean should render `false` as is
   })
 
-  test('ingore non-renderable values', () => {
+  test('ignore non-renderable values', () => {
     expect(
       ssrRenderAttrs({
         foo: {},

+ 1 - 1
packages/shared/src/patchFlags.ts

@@ -68,7 +68,7 @@ export const enum PatchFlags {
 
   // Special flags are negative integers. They are never matched against using
   // bitwise operators (bitwise matching should only happen in branches where
-  // patchFlag > 0), and are mutually exclusive. When checking for a speical
+  // patchFlag > 0), and are mutually exclusive. When checking for a special
   // flag, simply check patchFlag === FLAG.
 
   // Indicates a hoisted static vnode. This is a hint for hydration to skip

+ 1 - 1
packages/vue/__tests__/svgNamespace.spec.ts

@@ -3,7 +3,7 @@
 // the renderer and compiler implementations.
 // Related files:
 // - runtime-core/src/renderer.ts
-// - compiler-core/src/transoforms/transformElement.ts
+// - compiler-core/src/transforms/transformElement.ts
 
 import { render, h, ref, nextTick } from '../src'