]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: type [ci skip]
author那里好脏不可以 <453491931@qq.com>
Tue, 10 May 2022 02:51:51 +0000 (10:51 +0800)
committerGitHub <noreply@github.com>
Tue, 10 May 2022 02:51:51 +0000 (22:51 -0400)
22 files changed:
packages/compiler-core/__tests__/parse.spec.ts
packages/compiler-core/__tests__/transforms/transformElement.spec.ts
packages/compiler-dom/__tests__/transforms/__snapshots__/warnTransitionChildren.spec.ts.snap
packages/compiler-dom/__tests__/transforms/warnTransitionChildren.spec.ts
packages/compiler-sfc/__tests__/compileScript.spec.ts
packages/compiler-sfc/src/cssVars.ts
packages/reactivity-transform/__tests__/__snapshots__/reactivityTransform.spec.ts.snap
packages/reactivity-transform/__tests__/reactivityTransform.spec.ts
packages/reactivity/__tests__/effectScope.spec.ts
packages/reactivity/__tests__/readonly.spec.ts
packages/reactivity/src/effectScope.ts
packages/runtime-core/__tests__/components/Suspense.spec.ts
packages/runtime-core/__tests__/errorHandling.spec.ts
packages/runtime-core/__tests__/helpers/withMemo.spec.ts
packages/runtime-core/__tests__/rendererOptimizedMode.spec.ts
packages/runtime-core/src/component.ts
packages/runtime-core/src/componentOptions.ts
packages/runtime-dom/__tests__/directives/vModel.spec.ts
packages/runtime-dom/__tests__/patchProps.spec.ts
packages/shared/__tests__/toDisplayString.spec.ts
packages/vue-compat/README.md
test-dts/component.test-d.ts

index f1869739cf45a825188a61376a212e4b1aacef37..5d5e40566365a63a9b6edab9a8bab05fa365962c 100644 (file)
@@ -2023,7 +2023,7 @@ foo
         isPreTag: tag => tag === 'pre'
       })
       const elementAfterPre = ast.children[1] as ElementNode
-      // should not affect the <span> and condense its whitepsace inside
+      // should not affect the <span> and condense its whitespace inside
       expect((elementAfterPre.children[0] as TextNode).content).toBe(` foo bar`)
     })
 
index e7a95622d1ab33d55ef7bf5d9b7ec4775cb650d2..a9edc9870dee00dd33b12c1b7b50021eced9630d 100644 (file)
@@ -80,7 +80,7 @@ describe('compiler: element transform', () => {
     expect(root.components).toContain(`Foo`)
   })
 
-  test('resolve implcitly self-referencing component', () => {
+  test('resolve implicitly self-referencing component', () => {
     const { root } = parseWithElementTransform(`<Example/>`, {
       filename: `/foo/bar/Example.vue?vue&type=template`
     })
index 5787b08ffda7bcd0618c51790b0cde88cda475ac..2b39b25fa3f11739280ddbd04da2cfb191cd8f0b 100644 (file)
@@ -1,6 +1,6 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`the v-if/else-if/else branchs in Transition should ignore comments 1`] = `
+exports[`the v-if/else-if/else branches in Transition should ignore comments 1`] = `
 "const _Vue = Vue
 
 return function render(_ctx, _cache) {
index 3cccdfffc889c17b9dc0b8d0e4daf5a790a0d175..b037af8e6f1c50246d86c49f5c429c16c0254aba 100644 (file)
@@ -139,7 +139,7 @@ describe('compiler warnings', () => {
   })
 })
 
-test('the v-if/else-if/else branchs in Transition should ignore comments', () => {
+test('the v-if/else-if/else branches in Transition should ignore comments', () => {
   expect(
     compile(`
     <transition>
index 51ef6c9e7ec265290cf5a12ff5e1b8b9d4de7c8a..f87a326c82f8aa6d8ce7b897c77478d16fd18e11 100644 (file)
@@ -64,7 +64,7 @@ const bar = 1
   `)
     // should generate working code
     assertCode(content)
-    // should anayze bindings
+    // should analyze bindings
     expect(bindings).toStrictEqual({
       foo: BindingTypes.PROPS,
       bar: BindingTypes.SETUP_CONST,
@@ -403,7 +403,7 @@ defineExpose({ foo: 123 })
       assertCode(content)
     })
 
-    // #4340 interpolations in tempalte strings
+    // #4340 interpolations in template strings
     test('js template string interpolations', () => {
       const { content } = compile(`
         <script setup lang="ts">
index c7572e58d973df868834295ed3a72b62b635bad4..5153ab8d7a4a5fb44281ef2ee336b23092a4c24b 100644 (file)
@@ -33,7 +33,7 @@ function genVarName(id: string, raw: string, isProd: boolean): string {
   }
 }
 
-function noramlizeExpression(exp: string) {
+function normalizeExpression(exp: string) {
   exp = exp.trim()
   if (
     (exp[0] === `'` && exp[exp.length - 1] === `'`) ||
@@ -51,7 +51,7 @@ export function parseCssVars(sfc: SFCDescriptor): string[] {
     // ignore v-bind() in comments /* ... */
     const content = style.content.replace(/\/\*([\s\S]*?)\*\//g, '')
     while ((match = cssVarRE.exec(content))) {
-      const variable = noramlizeExpression(match[1])
+      const variable = normalizeExpression(match[1])
       if (!vars.includes(variable)) {
         vars.push(variable)
       }
@@ -74,7 +74,7 @@ export const cssVarsPlugin: PluginCreator<CssVarsPluginOptions> = opts => {
       // rewrite CSS variables
       if (cssVarRE.test(decl.value)) {
         decl.value = decl.value.replace(cssVarRE, (_, $1) => {
-          return `var(--${genVarName(id, noramlizeExpression($1), isProd)})`
+          return `var(--${genVarName(id, normalizeExpression($1), isProd)})`
         })
       }
     }
index 99be242135d0c05cf4a0e4207014a807c3ae7bec..a99420a34947f3115228dfd454aa62baa55c2369 100644 (file)
@@ -85,7 +85,7 @@ exports[`handle TS casting syntax 1`] = `
 exports[`macro import alias and removal 1`] = `
 "import { ref as _ref, toRef as _toRef } from 'vue'
 
-    
+
 
     let a = _ref(1)
     const __$temp_1 = (useMouse()),
@@ -184,7 +184,7 @@ exports[`object destructure 1`] = `
   d = _toRef(__$temp_1, 'd', 1),
   f = _toRef(__$temp_1, 'e', 2),
   h = _toRef(__$temp_1, g)
-    let __$temp_2 = (useSomthing(() => 1)),
+    let __$temp_2 = (useSomething(() => 1)),
   foo = _toRef(__$temp_2, 'foo');
     console.log(n.value, a.value, c.value, d.value, f.value, h.value, foo.value)
     "
index ece6e3512f91f508a77d10f43bbe62cc0c40c2e9..7471615cae20f1eefe7822b8daadb688abd8bb38 100644 (file)
@@ -240,7 +240,7 @@ test('should not rewrite scope variable', () => {
 test('object destructure', () => {
   const { code, rootRefs } = transform(`
     let n = $ref(1), { a, b: c, d = 1, e: f = 2, [g]: h } = $(useFoo())
-    let { foo } = $(useSomthing(() => 1));
+    let { foo } = $(useSomething(() => 1));
     console.log(n, a, c, d, f, h, foo)
     `)
   expect(code).toMatch(`a = _toRef(__$temp_1, 'a')`)
index 6adda3d834ae822b5e938c7a473449d9a43a62a8..af92c97f94c7cdfb693812d8e14ffd563e5efe7d 100644 (file)
@@ -120,7 +120,7 @@ describe('reactivity/effect/scope', () => {
     counter.num = 6
     expect(dummy).toBe(7)
 
-    // nested scope should not be stoped
+    // nested scope should not be stopped
     expect(doubled).toBe(12)
   })
 
@@ -212,7 +212,7 @@ describe('reactivity/effect/scope', () => {
     expect(spy).toHaveBeenCalledTimes(1)
   })
 
-  it('should derefence child scope from parent scope after stopping child scope (no memleaks)', () => {
+  it('should dereference child scope from parent scope after stopping child scope (no memleaks)', () => {
     const parent = new EffectScope()
     const child = parent.run(() => new EffectScope())!
     expect(parent.scopes!.includes(child)).toBe(true)
index 73030c5b997d6f858f7e3cfdf2e2a39e5288c5f3..3d597de6615820923e8b770a3e5795b91456dc57 100644 (file)
@@ -459,7 +459,7 @@ describe('reactivity/readonly', () => {
     expect(
       'Set operation on key "_dirty" failed: target is readonly.'
     ).not.toHaveBeenWarned()
-    // @ts-expect-error - non-existant property
+    // @ts-expect-error - non-existent property
     rC.randomProperty = true
 
     expect(
@@ -476,7 +476,7 @@ describe('reactivity/readonly', () => {
     expect(isReadonly(rr.foo)).toBe(true)
   })
 
-  test('attemptingt to write plain value to a readonly ref nested in a reactive object should fail', () => {
+  test('attempting to write plain value to a readonly ref nested in a reactive object should fail', () => {
     const r = ref(false)
     const ror = readonly(r)
     const obj = reactive({ ror })
index e80a4f61d1d7e40d3faf012d5d4bb9f663e9a8c7..f4396e8f3ab07b8ed688136fb54e636ebf8b811d 100644 (file)
@@ -18,7 +18,7 @@ export class EffectScope {
   cleanups: (() => void)[] = []
 
   /**
-   * only assinged by undetached scope
+   * only assigned by undetached scope
    * @internal
    */
   parent: EffectScope | undefined
index b206dced46349235a20f75eb9ea704c7a74d4f07..a2c38b2846e11b8f1b4f1b52bbbea249f755ca9b 100644 (file)
@@ -1032,7 +1032,7 @@ describe('Suspense', () => {
     await nextTick()
     expect(deps.length).toBe(2)
 
-    // switch before two resovles
+    // switch before two resolves
     view.value = Three
     await nextTick()
     expect(deps.length).toBe(3)
@@ -1098,7 +1098,7 @@ describe('Suspense', () => {
     await nextTick()
     expect(deps.length).toBe(2)
 
-    // switch back before two resovles
+    // switch back before two resolves
     view.value = One
     await nextTick()
     expect(deps.length).toBe(2)
index d1d6969104e3f7e83c83d2c19fc8570ac4e25836..8a18870a5db3a927e5deda5c56e07d57bb31d752 100644 (file)
@@ -183,7 +183,7 @@ describe('error handling', () => {
   })
 
   // unlike other lifecycle hooks, created/beforeCreate are called as part of
-  // the options API initiualization process instead of by the renderer.
+  // the options API initialization process instead of by the renderer.
   test('in created/beforeCreate hook', () => {
     const err = new Error('foo')
     const fn = jest.fn()
index 5d6590bd9096a1fa7a03af79d5788697cf5f1198..6a1a9ae2ee66affcaea092d71975732a95d53eca 100644 (file)
@@ -1,5 +1,5 @@
 // since v-memo really is a compiler + runtime combo feature, we are performing
-// more of an itegration test here.
+// more of an integration test here.
 import { ComponentOptions, createApp, nextTick } from 'vue'
 
 describe('v-memo', () => {
index 82acc4bdb5d5034a415c024384ac87bd484da1a7..a1a3293c0328b3af4528b8a66dcc47860b3c0e30 100644 (file)
@@ -879,7 +879,7 @@ describe('renderer: optimized mode', () => {
   // #3881
   // root cause: fragment inside a compiled slot passed to component which
   // programmatically invokes the slot. The entire slot should de-opt but
-  // the fragment was incorretly put in optimized mode which causes it to skip
+  // the fragment was incorrectly put in optimized mode which causes it to skip
   // updates for its inner components.
   test('fragments inside programmatically invoked compiled slot should de-opt properly', async () => {
     const Parent: FunctionalComponent = (_, { slots }) => slots.default!()
index 53048b9a294a685e0264ec02d3925b9afec5c7fa..b04d8fefcd0913c7274dafe14ab83ce568e4ada9 100644 (file)
@@ -477,7 +477,7 @@ export function createComponentInstance(
     accessCache: null!,
     renderCache: [],
 
-    // local resovled assets
+    // local resolved assets
     components: null,
     directives: null,
 
index b4fd4790543fc0bbb2428818306430a599a86472..ed95174b187edd20351e997e0748594dcec3adaa 100644 (file)
@@ -483,8 +483,8 @@ interface LegacyOptions<
    *
    * type-only, used to assist Mixin's type inference,
    * typescript will try to simplify the inferred `Mixin` type,
-   * with the `__differenciator`, typescript won't be able to combine different mixins,
-   * because the `__differenciator` will be different
+   * with the `__differentiator`, typescript won't be able to combine different mixins,
+   * because the `__differentiator` will be different
    */
   __differentiator?: keyof D | keyof C | keyof M
 }
index 2c77f515221fe11fcff1cb5f46df6f28a042c869..a192e930128f9a48fdc25112a1b675e37b9b2cd4 100644 (file)
@@ -1015,7 +1015,7 @@ describe('vModel', () => {
     bar.selected = false
     data.value = new Set([{ foo: 1 }, { bar: 1 }])
     await nextTick()
-    // whithout looseEqual, here is different from Array
+    // without looseEqual, here is different from Array
     expect(foo.selected).toEqual(false)
     expect(bar.selected).toEqual(false)
   })
index 9a324970cc9d3c7e8d414240b03cf4d7a951e691..b7ce2302f80bb2dcbbcde3022eafd17427ab7075 100644 (file)
@@ -205,7 +205,7 @@ describe('runtime-dom: props patching', () => {
   test('form attribute', () => {
     const el = document.createElement('input')
     patchProp(el, 'form', null, 'foo')
-    // non existant element
+    // non existent element
     expect(el.form).toBe(null)
     expect(el.getAttribute('form')).toBe('foo')
     // remove attribute
index 53cfcb87a1f1b334cb0f2ffd78a0e3e7a55aedff..bc25c1e27fef740ae505d92f53c3386fed4a8cc2 100644 (file)
@@ -28,11 +28,11 @@ describe('toDisplayString', () => {
     }
     expect(toDisplayString(objWithToStringOverride)).toBe('override')
 
-    const objWithNonInvokeableToString = {
+    const objWithNonInvokableToString = {
       foo: 555,
       toString: null
     }
-    expect(toDisplayString(objWithNonInvokeableToString)).toBe(
+    expect(toDisplayString(objWithNonInvokableToString)).toBe(
       `{
   "foo": 555,
   "toString": null
index a530227620256ab2782cf0889773c5c6dbaaefd2..0bc84b3340220f45a3e553405040ef7daafbbe80 100644 (file)
@@ -281,7 +281,7 @@ Features that start with `COMPILER_` are compiler-specific: if you are using the
 
 | ID                 | Type | Description                           | Docs                                     |
 | ------------------ | ---- | ------------------------------------- | ---------------------------------------- |
-| TRANSITION_CLASSES | ⭘    | Transtion enter/leave classes changed | [link](https://v3-migration.vuejs.org/breaking-changes/transition.html) |
+| TRANSITION_CLASSES | ⭘    | Transition enter/leave classes changed | [link](https://v3-migration.vuejs.org/breaking-changes/transition.html) |
 
 ### Fully Compatible
 
index d8d3934b964230b4e3147e3cd6be6d318d42397e..3463995613c6056c55a1887ecd646c8d477e3030 100644 (file)
@@ -98,7 +98,7 @@ describe('object props', () => {
         ff: Function as PropType<(a: number, b: string) => { a: boolean }>,
         // explicit type casting with constructor
         ccc: Array as () => string[],
-        // required + contructor type casting
+        // required + constructor type casting
         ddd: {
           type: Array as () => string[],
           required: true
@@ -281,7 +281,7 @@ describe('object props', () => {
         ff: Function as PropType<(a: number, b: string) => { a: boolean }>,
         // explicit type casting with constructor
         ccc: Array as () => string[],
-        // required + contructor type casting
+        // required + constructor type casting
         ddd: {
           type: Array as () => string[],
           required: true