From 3c63b12ccd4a694b6de5d7c9fd51a375b389793e Mon Sep 17 00:00:00 2001 From: Alejandro Torres Date: Tue, 25 Nov 2025 17:52:51 -0400 Subject: [PATCH] chore: fix typos in code comments and documentation (#17187) * chore: fix typos in code comments and documentation * regenerate --------- Co-authored-by: Rich Harris --- documentation/docs/98-reference/.generated/client-warnings.md | 2 +- packages/svelte/messages/client-warnings/warnings.md | 2 +- packages/svelte/src/compiler/migrate/index.js | 4 ++-- .../phases/3-transform/client/visitors/VariableDeclaration.js | 2 +- .../phases/3-transform/server/visitors/VariableDeclaration.js | 2 +- .../src/compiler/phases/3-transform/shared/transform-async.js | 2 +- .../svelte/src/internal/client/dom/elements/bindings/this.js | 2 +- packages/svelte/src/internal/client/dom/elements/misc.js | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/documentation/docs/98-reference/.generated/client-warnings.md b/documentation/docs/98-reference/.generated/client-warnings.md index 4deb338521..7daf808d61 100644 --- a/documentation/docs/98-reference/.generated/client-warnings.md +++ b/documentation/docs/98-reference/.generated/client-warnings.md @@ -237,7 +237,7 @@ Hydration failed because the initial UI does not match what was rendered on the This warning is thrown when Svelte encounters an error while hydrating the HTML from the server. During hydration, Svelte walks the DOM, expecting a certain structure. If that structure is different (for example because the HTML was repaired by the DOM because of invalid HTML), then Svelte will run into issues, resulting in this warning. -During development, this error is often preceeded by a `console.error` detailing the offending HTML, which needs fixing. +During development, this error is often preceded by a `console.error` detailing the offending HTML, which needs fixing. ### invalid_raw_snippet_render diff --git a/packages/svelte/messages/client-warnings/warnings.md b/packages/svelte/messages/client-warnings/warnings.md index b51fc6b53c..6998173a99 100644 --- a/packages/svelte/messages/client-warnings/warnings.md +++ b/packages/svelte/messages/client-warnings/warnings.md @@ -209,7 +209,7 @@ To fix this, either silence the warning with a [`svelte-ignore`](basic-markup#Co This warning is thrown when Svelte encounters an error while hydrating the HTML from the server. During hydration, Svelte walks the DOM, expecting a certain structure. If that structure is different (for example because the HTML was repaired by the DOM because of invalid HTML), then Svelte will run into issues, resulting in this warning. -During development, this error is often preceeded by a `console.error` detailing the offending HTML, which needs fixing. +During development, this error is often preceded by a `console.error` detailing the offending HTML, which needs fixing. ## invalid_raw_snippet_render diff --git a/packages/svelte/src/compiler/migrate/index.js b/packages/svelte/src/compiler/migrate/index.js index 0d4691e9d6..ce5387f4dd 100644 --- a/packages/svelte/src/compiler/migrate/index.js +++ b/packages/svelte/src/compiler/migrate/index.js @@ -604,7 +604,7 @@ const instance_script = { 'Encountered an export declaration pattern that is not supported for automigration.' ); // Turn export let into props. It's really really weird because export let { x: foo, z: [bar]} = .. - // means that foo and bar are the props (i.e. the leafs are the prop names), not x and z. + // means that foo and bar are the props (i.e. the leaves are the prop names), not x and z. // const tmp = b.id(state.scope.generate('tmp')); // const paths = extract_paths(declarator.id, tmp); // state.props_pre.push( @@ -1812,7 +1812,7 @@ function handle_events(element, state) { } /** - * Returns start and end of the node. If the start is preceeded with white-space-only before a line break, + * Returns start and end of the node. If the start is preceded with white-space-only before a line break, * the start will be the start of the line. * @param {string} source * @param {LabeledStatement} node diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js index 63f942943f..f830e8c57d 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js @@ -305,7 +305,7 @@ export function VariableDeclaration(node, context) { if (has_props) { if (declarator.id.type !== 'Identifier') { // Turn export let into props. It's really really weird because export let { x: foo, z: [bar]} = .. - // means that foo and bar are the props (i.e. the leafs are the prop names), not x and z. + // means that foo and bar are the props (i.e. the leaves are the prop names), not x and z. const tmp = b.id(context.state.scope.generate('tmp')); const { inserts, paths } = extract_paths(declarator.id, tmp); diff --git a/packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js b/packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js index 7c94595147..58fde5964f 100644 --- a/packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js +++ b/packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js @@ -119,7 +119,7 @@ export function VariableDeclaration(node, context) { if (has_props) { if (declarator.id.type !== 'Identifier') { // Turn export let into props. It's really really weird because export let { x: foo, z: [bar]} = .. - // means that foo and bar are the props (i.e. the leafs are the prop names), not x and z. + // means that foo and bar are the props (i.e. the leaves are the prop names), not x and z. const tmp = b.id(context.state.scope.generate('tmp')); const { inserts, paths } = extract_paths(declarator.id, tmp); diff --git a/packages/svelte/src/compiler/phases/3-transform/shared/transform-async.js b/packages/svelte/src/compiler/phases/3-transform/shared/transform-async.js index 22c4beb08a..b55356a38c 100644 --- a/packages/svelte/src/compiler/phases/3-transform/shared/transform-async.js +++ b/packages/svelte/src/compiler/phases/3-transform/shared/transform-async.js @@ -35,7 +35,7 @@ export function transform_body(instance_body, runner, transform) { (node) => /** @type {ESTree.Statement | ESTree.VariableDeclaration} */ (transform(node)) ); - // Declarations for the await expressions (they will asign to them; need to be hoisted to be available in whole instance scope) + // Declarations for the await expressions (they will assign to them; need to be hoisted to be available in whole instance scope) if (instance_body.declarations.length > 0) { statements.push( b.declaration( diff --git a/packages/svelte/src/internal/client/dom/elements/bindings/this.js b/packages/svelte/src/internal/client/dom/elements/bindings/this.js index e9bbcedc6f..f2e715113f 100644 --- a/packages/svelte/src/internal/client/dom/elements/bindings/this.js +++ b/packages/svelte/src/internal/client/dom/elements/bindings/this.js @@ -38,7 +38,7 @@ export function bind_this(element_or_component = {}, update, get_value, get_part untrack(() => { if (element_or_component !== get_value(...parts)) { update(element_or_component, ...parts); - // If this is an effect rerun (cause: each block context changes), then nullfiy the binding at + // If this is an effect rerun (cause: each block context changes), then nullify the binding at // the previous position if it isn't already taken over by a different effect. if (old_parts && is_bound_this(get_value(...old_parts), element_or_component)) { update(null, ...old_parts); diff --git a/packages/svelte/src/internal/client/dom/elements/misc.js b/packages/svelte/src/internal/client/dom/elements/misc.js index 61e513903f..f350d1df8c 100644 --- a/packages/svelte/src/internal/client/dom/elements/misc.js +++ b/packages/svelte/src/internal/client/dom/elements/misc.js @@ -51,7 +51,7 @@ export function add_form_reset_listener() { } }); }, - // In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation) + // In the capture phase to guarantee we get noticed of it (no possibility of stopPropagation) { capture: true } ); }