Skip to content

Commit 829b35e

Browse files
authored
chore: typo fixes (#1546)
* chore: fix typos in comments/JSDoc. * chore: fix typo in internal function name. * chore: fix typos in test comments/descriptions/variable names.
1 parent 9b04ea3 commit 829b35e

File tree

19 files changed

+27
-27
lines changed

19 files changed

+27
-27
lines changed

packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ describe('compiler: expression transform', () => {
412412
})
413413
})
414414

415-
test('nullish colescing', () => {
415+
test('nullish coalescing', () => {
416416
const node = parseWithExpressionTransform(
417417
`{{ a ?? b }}`
418418
) as InterpolationNode

packages/compiler-core/src/codegen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ function genFunctionPreamble(ast: RootNode, context: CodegenContext) {
333333
}
334334
// generate variables for ssr helpers
335335
if (!__BROWSER__ && ast.ssrHelpers && ast.ssrHelpers.length) {
336-
// ssr guaruntees prefixIdentifier: true
336+
// ssr guarantees prefixIdentifier: true
337337
push(
338338
`const { ${ast.ssrHelpers
339339
.map(aliasHelper)
@@ -372,7 +372,7 @@ function genModulePreamble(
372372
// when bundled with webpack with code-split, calling an import binding
373373
// as a function leads to it being wrapped with `Object(a.b)` or `(0,a.b)`,
374374
// incurring both payload size increase and potential perf overhead.
375-
// therefore we assign the imports to vairables (which is a constant ~50b
375+
// therefore we assign the imports to variables (which is a constant ~50b
376376
// cost per-component instead of scaling with template size)
377377
push(
378378
`import { ${ast.helpers
@@ -446,7 +446,7 @@ function genHoists(hoists: (JSChildNode | null)[], context: CodegenContext) {
446446
const genScopeId = !__BROWSER__ && scopeId != null && mode !== 'function'
447447
newline()
448448

449-
// push scope Id before initilaizing hoisted vnodes so that these vnodes
449+
// push scope Id before initializing hoisted vnodes so that these vnodes
450450
// get the proper scopeId as well.
451451
if (genScopeId) {
452452
push(`${helper(PUSH_SCOPE_ID)}("${scopeId}")`)

packages/compiler-core/src/options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export type HoistTransform = (
5959

6060
export interface TransformOptions {
6161
/**
62-
* An array of node trasnforms to be applied to every AST node.
62+
* An array of node transforms to be applied to every AST node.
6363
*/
6464
nodeTransforms?: NodeTransform[]
6565
/**
@@ -118,7 +118,7 @@ export interface TransformOptions {
118118
scopeId?: string | null
119119
/**
120120
* Generate SSR-optimized render functions instead.
121-
* The resulting funciton must be attached to the component via the
121+
* The resulting function must be attached to the component via the
122122
* `ssrRender` option instead of `render`.
123123
*/
124124
ssr?: boolean

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function walk(
5151
doNotHoistNode: boolean = false
5252
) {
5353
let hasHoistedNode = false
54-
// Some transforms, e.g. trasnformAssetUrls from @vue/compiler-sfc, replaces
54+
// Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces
5555
// static bindings with expressions. These expressions are guaranteed to be
5656
// constant so they are still eligible for hoisting, but they are only
5757
// available at runtime and therefore cannot be evaluated ahead of time.

packages/compiler-core/src/transforms/transformElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export function buildProps(
280280
if (
281281
!isComponent &&
282282
isOn(name) &&
283-
// omit the flag for click handlers becaues hydration gives click
283+
// omit the flag for click handlers because hydration gives click
284284
// dedicated fast path.
285285
name.toLowerCase() !== 'onclick' &&
286286
// omit v-model handlers

packages/compiler-sfc/__tests__/templateTransformSrcset.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import {
1212

1313
function compileWithSrcset(template: string, options?: AssetURLOptions) {
1414
const ast = baseParse(template)
15-
const srcsetTrasnform = options
15+
const srcsetTransform = options
1616
? createSrcsetTransformWithOptions(normalizeOptions(options))
1717
: transformSrcset
1818
transform(ast, {
19-
nodeTransforms: [srcsetTrasnform, transformElement],
19+
nodeTransforms: [srcsetTransform, transformElement],
2020
directiveTransforms: {
2121
bind: transformBind
2222
}

packages/compiler-ssr/src/transforms/ssrTransformComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const ssrTransformComponent: NodeTransform = (node, context) => {
142142

143143
if (typeof component !== 'string') {
144144
// dynamic component that resolved to a `resolveDynamicComponent` call
145-
// expression - since the reoslved result may be a plain element (string)
145+
// expression - since the resolved result may be a plain element (string)
146146
// or a VNode, handle it with `renderVNode`.
147147
node.ssrCodegenNode = createCallExpression(
148148
context.helper(SSR_RENDER_VNODE),

packages/compiler-ssr/src/transforms/ssrTransformElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const ssrTransformElement: NodeTransform = (node, context) => {
6464
// element
6565
// generate the template literal representing the open tag.
6666
const openTag: TemplateLiteral['elements'] = [`<${node.tag}`]
67-
// some tags need to be pasesd to runtime for special checks
67+
// some tags need to be passed to runtime for special checks
6868
const needTagForRuntime =
6969
node.tag === 'textarea' || node.tag.indexOf('-') > 0
7070

packages/reactivity/src/ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ type BaseTypes = string | number | boolean
150150
* }
151151
* ```
152152
*
153-
* Note that api-extractor somehow refuses to include `decalre module`
153+
* Note that api-extractor somehow refuses to include `declare module`
154154
* augmentations in its generated d.ts, so we have to manually append them
155155
* to the final generated d.ts in our build process.
156156
*/

packages/runtime-core/__tests__/componentEmits.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ describe('component: emit', () => {
2626
render(h(Comp), nodeOps.createElement('div'))
2727

2828
expect(onfoo).not.toHaveBeenCalled()
29-
// only capitalized or special chars are considerd event listeners
29+
// only capitalized or special chars are considered event listeners
3030
expect(onBar).toHaveBeenCalled()
3131
expect(onBaz).toHaveBeenCalled()
3232
})
3333

3434
// for v-model:foo-bar usage in DOM templates
35-
test('trigger hyphendated events for update:xxx events', () => {
35+
test('trigger hyphenated events for update:xxx events', () => {
3636
const Foo = defineComponent({
3737
render() {},
3838
created() {

0 commit comments

Comments
 (0)