8000 refactor: fix a number of typos throughout the codebase (#55018) · angular/angular@f3b6245 · GitHub
[go: up one dir, main page]

Skip to content

Commit f3b6245

Browse files
ranma42dylhunn
authored andcommitted
refactor: fix a number of typos throughout the codebase (#55018)
Fix some typos detected using spellchecking tools, both in documentation and in code (comments, identifiers). PR Close #55018
1 parent 42eab69 commit f3b6245

File tree

25 files changed

+45
-45
lines changed

25 files changed

+45
-45
lines changed

adev/src/app/editor/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The following steps are executed on project change:
115115
5. The previous project dependencies are compared with the new project dependencies.
116116
1. If there are differences, a `npm install` is triggered, hiding the preview and going to the install loading step.
117117
2. If there are no differences, the project is ready.
118-
6. Some states are resetted, for example the "reveal answer" state if the previous project was in the "reveal answer" state.
118+
6. Some states are reset, for example the "reveal answer" state if the previous project was in the "reveal answer" state.
119119

120120
## Components and services
121121

@@ -200,7 +200,7 @@ Responsible for handling the download button in the embedded editor, fetching th
200200

201201
#### [`AlertManager`](./alert-manager.service.ts)
202202

203-
Manage the alerts displayed in the embedded editor, being the out of memory alert when multiple tabs are opened, and unsupported enviroments alerts.
203+
Manage the alerts displayed in the embedded editor, being the out of memory alert when multiple tabs are opened, and unsupported environments alerts.
204204

205205
#### [`TypingsLoader`](./typings-loader.service.ts)
206206

adev/src/app/features/tutorial/tutorial.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FakeDocViewer {
4141
@Input('documentFilePath') documentFilePath: string | undefined;
4242
}
4343

44-
// TODO: export this class, it's a helpfull mock we could you on other tests.
44+
// TODO: export this class, it's a helpful mock we could you on other tests.
4545
class FakeNodeRuntimeSandbox {
4646
loadingStep = signal(0);
4747
previewUrl$ = of();

adev/src/content/reference/migrations/control-flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[Control flow syntax](guide/templates/control-flow) is available from Angular 17 and simplified way to use the control-flow directives like *ngFor, *ngIf and *ngSwitch.
55

6-
The new syntax is baked into the template, so you don't need to import `CommonModule` anymore. But wait there is more to it, there is an migration availble for migrating all your old code to use new Control Flow Syntax with Angular 17 release. Run the schematic with the following command:
6+
The new syntax is baked into the template, so you don't need to import `CommonModule` anymore. But wait there is more to it, there is an migration available for migrating all your old code to use new Control Flow Syntax with Angular 17 release. Run the schematic with the following command:
77

88
<docs-code language="shell">
99

aio/content/examples/rx-library/e2e/src/app.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This example project is special in that it is not a cli app. To run tests appropriate for this
3-
* project, the test command is overwritten in `aio/content/examples/rx-libary/example-config.json`.
3+
* project, the test command is overwritten in `aio/content/examples/rx-library/example-config.json`.
44
*
55
* This is an empty placeholder file to ensure that `aio/tools/examples/run-example-e2e.mjs` runs
66
* tests for this project.

aio/content/guide/devtools.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ Then, import the file in the initial view of the profiler by clicking the **Choo
259259

260260
### View the injector hierarchy of your application
261261

262-
The **Injector Tree** tab lets you explore the structure of the Injectors configured in your application. Here you will see two trees representing the [injector hiearchy](guide/hierarchical-dependency-injection) of your application. One tree is your environment hierarchy, the other is your element hierachy.
262+
The **Injector Tree** tab lets you explore the structure of the Injectors configured in your application. Here you will see two trees representing the [injector hierarchy](guide/hierarchical-dependency-injection) of your application. One tree is your environment hierarchy, the other is your element hierarchy.
263263

264264
<div class="lightbox">
265265

@@ -269,7 +269,7 @@ The **Injector Tree** tab lets you explore the structure of the Injectors config
269269

270270
### Visualize resolution paths
271271

272-
When a specific injector is selected, the path that Angular's depenedency injection algorithm traverses from that injector to the root is highlighted. For element injectors, this includes highlighting the environment injectors that the dependency injection algorithm jumps to when a dependency cannot be resolved in the element hierarchy. See [resolution rules](guide/hierarchical-dependency-injection#resolution-rules) for more details about how Angular resolves resolution paths.
272+
When a specific injector is selected, the path that Angular's dependency injection algorithm traverses from that injector to the root is highlighted. For element injectors, this includes highlighting the environment injectors that the dependency injection algorithm jumps to when a dependency cannot be resolved in the element hierarchy. See [resolution rules](guide/hierarchical-dependency-injection#resolution-rules) for more details about how Angular resolves resolution paths.
273273

274274
<div class="lightbox">
275275

aio/content/guide/esbuild.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ If the `application` builder is difficult for your project to adopt, `browser-es
4141

4242
A builder named `browser-esbuild` is available within the `@angular-devkit/build-angular` package that is present in an Angular CLI generated application. The builder is a drop-in replacement for the existing `browser` builder that provides the preexisting browser application build system.
4343

44-
The compatiblity option was implemented to minimize the amount of changes necessary to initially migrate your applications.
44+
The compatibility option was implemented to minimize the amount of changes necessary to initially migrate your applications.
4545
This is provided via an alternate builder (`browser-esbuild`).
4646
You can update the `build` target for any application target to migrate to the new build system.
4747

packages/common/http/test/fetch_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ describe('FetchBackend', async () => {
233233

234234
it('handles a blob with a mime type', async () => {
235235
const promise = trackEvents(backend.handle(TEST_POST.clone({responseType: 'blob'})));
236-
const type = 'aplication/pdf';
236+
const type = 'application/pdf';
237237
fetchMock.mockFlush(HttpStatusCode.Ok, 'OK', new Blob(), {'Content-Type': type});
238238
const events = await promise;
239239
expect(events.length).toBe(2);

packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ class TcbIfOp extends TcbOp {
14451445
expression = expressionScope.resolve(branch.expressionAlias);
14461446
}
14471447

1448-
// The expressions of the preceeding branches have to be negated
1448+
// The expressions of the preceding branches have to be negated
14491449
// (e.g. `expr` becomes `!(expr)`) when comparing in the guard, except
14501450
// for the branch's own expression which is preserved as is.
14511451
const comparisonExpression = i === index ?
@@ -1486,7 +1486,7 @@ class TcbSwitchOp extends TcbOp {
14861486
const comparisonExpression = tcbExpression(this.block.expression, this.tcb, this.scope);
14871487
markIgnoreDiagnostics(comparisonExpression);
14881488

1489-
// Wrap the comparisson expression in parentheses so we don't ignore
1489+
// Wrap the comparison expression in parentheses so we don't ignore
14901490
// diagnostics when comparing incompatible types (see #52315).
14911491
const expression = ts.factory.createParenthesizedExpression(comparisonExpression);
14921492
const root = this.generateCase(0, expression, null);
@@ -2326,13 +2326,13 @@ class TcbExpressionTranslator {
23262326
* context). This method assists in resolving those.
23272327
*/
23282328
protected resolve(ast: AST): ts.Expression|null {
2329-
// TODO: this is actually a bug, because `ImpliticReceiver` extends `ThisReceiver`. Consider a
2329+
// TODO: this is actually a bug, because `ImplicitReceiver` extends `ThisReceiver`. Consider a
23302330
// case when the explicit `this` read is inside a template with a context that also provides the
23312331
// variable name being read:
23322332
// ```
23332333
// <ng-template let-a>{{this.a}}</ng-template>
23342334
// ```
2335-
// Clearly, `this.a` should refer to the class property `a`. However, becuase of this code,
2335+
// Clearly, `this.a` should refer to the class property `a`. However, because of this code,
23362336
// `this.a` will refer to `let-a` on the template context.
23372337
//
23382338
// Note that the generated code is actually consistent with this bug. To fix it, we have to:

packages/compiler-cli/test/ngtsc/ngtsc_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9328,8 +9328,8 @@ function allTests(os: string) {
93289328
kind: ts.SyntaxKind.MultiLineCommentTrivia,
93299329
text: `*
93309330
* @fileoverview Closure comment
9331-
* @supress bla1
9332-
* @supress bla2
9331+
* @suppress bla1
9332+
* @suppress bla2
93339333
`,
93349334
pos: -1,
93359335
end: -1,

packages/compiler/src/render3/view/t2_binder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,9 @@ export class R3BoundTarget<DirectiveT extends DirectiveMeta> implements BoundTar
908908
private findEntityInScope(rootNode: ScopedNode, name: string): Reference|Variable|null {
909909
const entities = this.getEntitiesInScope(rootNode);
910910

911-
for (const entitity of entities) {
912-
if (entitity.name === name) {
913-
return entitity;
911+
for (const entity of entities) {
912+
if (entity.name === name) {
913+
return entity;
914914
}
915915
}
916916

packages/compiler/src/shadow_css.ts

Lines changed: 1 addition & 1 deletion
10000
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class ShadowCss {
155155
comments.push(m);
156156
} else {
157157
// Replace non hash comments with empty lines.
158-
// This is done so that we do not leak any senstive data in comments.
158+
// This is done so that we do not leak any sensitive data in comments.
159159
const newLinesMatches = m.match(_newLinesRe);
160160
comments.push((newLinesMatches?.join('') ?? '') + '\n');
161161
}

packages/compiler/src/template/pipeline/ir/src/ops/update.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export interface BindingOp extends Op<UpdateOp> {
118118
/**
119119
* Whether the binding is a TextAttribute (e.g. `some-attr="some-value"`).
120120
*
121-
* This needs to be tracked for compatiblity with `TemplateDefinitionBuilder` which treats `style`
122-
* and `class` TextAttributes differently from `[attr.style]` and `[attr.class]`.
121+
* This needs to be tracked for compatibility with `TemplateDefinitionBuilder` which treats
122+
* `style` and `class` TextAttributes differently from `[attr.style]` and `[attr.class]`.
123123
*/
124124
isTextAttribute: boolean;
125125

@@ -507,8 +507,8 @@ export interface AttributeOp extends Op<UpdateOp> {
507507
/**
508508
* Whether the binding is a TextAttribute (e.g. `some-attr="some-value"`).
509509
*
510-
* This needs to be tracked for compatiblity with `TemplateDefinitionBuilder` which treats `style`
511-
* and `class` TextAttributes differently from `[attr.style]` and `[attr.class]`.
510+
* This needs to be tracked for compatibility with `TemplateDefinitionBuilder` which treats
511+
* `style` and `class` TextAttributes differently from `[attr.style]` and `[attr.class]`.
512512
*/
513513
isTextAttribute: boolean;
514514

packages/compiler/src/template/pipeline/src/phases/naming.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function getVariableName(
162162
break;
163163
case ir.SemanticVariableKind.Identifier:
164164
if (unit.job.compatibility === ir.CompatibilityMode.TemplateDefinitionBuilder) {
165-
// TODO: Prefix increment and `_r` are for compatiblity with the old naming scheme.
165+
// TODO: Prefix increment and `_r` are for compatibility with the old naming scheme.
166166
// This has the potential to cause collisions when `ctx` is the identifier, so we need a
167167
// special check for that as well.
168168
const compatPrefix = variable.identifier === 'ctx' ? 'i' : '';

packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function wrapTemplateWithI18n(unit: ViewCompilationUnit, parentI18n: ir.I18nStar
9090
if (unit.create.head.next?.kind !== ir.OpKind.I18nStart) {
9191
const id = unit.job.allocateXrefId();
9292
ir.OpList.insertAfter(
93-
// Nested ng-template i18n start/end ops should not recieve source spans.
93+
// Nested ng-template i18n start/end ops should not receive source spans.
9494
ir.createI18nStartOp(id, parentI18n.message, parentI18n.root, null), unit.create.head);
9595
ir.OpList.insertBefore(ir.createI18nEndOp(id, null), unit.create.tail);
9696
}

packages/compiler/src/template/pipeline/src/phases/wrap_icus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function wrapI18nIcus(job: CompilationJob): void {
2727
case ir.OpKind.IcuStart:
2828
if (currentI18nOp === null) {
2929
addedI18nId = job.allocateXrefId();
30-
// ICU i18n start/end ops should not recieve source spans.
30+
// ICU i18n start/end ops should not receive source spans.
3131
ir.OpList.insertBefore<ir.CreateOp>(
3232
ir.createI18nStartOp(addedI18nId, op.message, undefined, null), op);
3333
}

packages/core/src/render3/debug/framework_injector_profiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function handleInstanceCreatedByInjectorEvent(
203203
const environmentInjector: EnvironmentInjector|null =
204204
context.injector.get(EnvironmentInjector, null, {optional: true});
205205
// Standalone components should have an environment injector. If one cannot be
206-
// found we may be in a test case for low level functionality that did not explictly
206+
// found we may be in a test case for low level functionality that did not explicitly
207207
// setup this injector. In those cases, we simply ignore this event.
208208
if (environmentInjector === null) {
209209
return;

packages/core/src/render3/util/injector_discovery_utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ function getInjectorParent(injector: Injector): Injector|null {
608608
// todo(aleksanderbodurri): ideally nothing in packages/core should deal
609609
// directly with router concerns. Refactor this so that we can make the jump from
610610
// NodeInjector -> OutletInjector -> NodeInjector
611-
// without explictly relying on types contracts from packages/router
611+
// without explicitly relying on types contracts from packages/router
612612
const injectorParent = (chainedInjector.injector as any)?.parent as Injector;
613613

614614
if (injectorParent instanceof NodeInjector) {

packages/core/testing/src/component_fixture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export class PseudoApplicationComponentFixture<T> extends ComponentFixture<T> {
334334
(this.componentRef.hostView as any).notifyErrorHandler,
335335
);
336336
} catch (e: unknown) {
337-
// If an error ocurred during change detection, remove the test view from the application
337+
// If an error occurred during change detection, remove the test view from the application
338338
// ref tracking. Note that this isn't exactly desirable but done this way because of how
339339
// things used to work with `autoDetect` and uncaught errors. Ideally we would surface
340340
// this error to the error handler instead and continue refreshing the view like

packages/forms/test/value_accessor_integration_spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ describe('value accessors', () => {
10701070
fixture = initTest(CvaWithDisabledStateForm, CvaWithDisabledState);
10711071
});
10721072

1073-
it('sets the disabled state when the control is initally disabled', () => {
1073+
it('sets the disabled state when the control is initially disabled', () => {
10741074
fixture.componentInstance.form = new FormGroup({
10751075
'login': new FormControl({value: 'aa', disabled: true}),
10761076
});
@@ -1083,7 +1083,7 @@ describe('value accessors', () => {
10831083
.toContain('DISABLED');
10841084
});
10851085

1086-
it('sets the enabled state when the control is initally enabled', () => {
1086+
it('sets the enabled state when the control is initially enabled', () => {
10871087
fixture.componentInstance.form = new FormGroup({
10881088
'login': new FormControl({value: 'aa', disabled: false}),
10891089
});
@@ -1210,7 +1210,7 @@ describe('value accessors in reactive forms with custom options', () => {
12101210
fixture = initTest(CvaWithDisabledStateForm, CvaWithDisabledState);
12111211
});
12121212

1213-
it('does not set the enabled state when the control is initally enabled', () => {
1213+
it('does not set the enabled state when the control is initially enabled', () => {
12141214
fixture.componentInstance.form = new FormGroup({
12151215
'login': new FormControl({value: 'aa', disabled: false}),
12161216
});

packages/language-service/src/completions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ export class CompletionBuilder<N extends TmplAstNode|AST> {
132132
length: this.node.name.length,
133133
}
134134
};
135-
let competionKeywords: string[] = [...blocksWithParens, ...blocksWithoutParens];
135+
let completionKeywords: string[] = [...blocksWithParens, ...blocksWithoutParens];
136136
if (this.nodeParent instanceof SwitchBlock) {
137-
competionKeywords = ['case', 'default'];
137+
completionKeywords = ['case', 'default'];
138138
}
139-
const completionEntries: ts.CompletionEntry[] = competionKeywords.map(
139+
const completionEntries: ts.CompletionEntry[] = completionKeywords.map(
140140
name => ({
141141
name,
142142
sortText: `${AsciiSortPriority.First}${name}`,

packages/language-service/test/legacy/mock_host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export class MockService {
275275
}
276276

277277
/**
278-
* Replace at most one occurence that matches `regex` in the specified
278+
* Replace at most one occurrence that matches `regex` in the specified
279279
* `searchText` with the specified `replaceText`. Throw an error if there is
280280
* more than one occurrence.
281281
*/

packages/language-service/test/ts_utils_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ describe('TS util', () => {
151151
false);
152152
});
153153

154-
it('creates a non-existant property', () => {
154+
it('creates a non-existent property', () => {
155155
const obj = updateObjectValueForKey(oldObj, 'newKey', valueAppenderFn);
156156
expect(print(obj)).toBe('{ foo: "bar", newKey: "baz" }');
157157
});

packages/service-worker/worker/test/idle_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ import {envIsSupported} from '../testing/utils';
176176
const forthTrigger = idle.trigger();
177177

178178
// Finally, advance the clock beyond `maxDelay` (3000) from the first trigger, but not beyond
179-
// the timeout for the forth. This should cause the task to be executed nontheless.
179+
// the timeout for the forth. This should cause the task to be executed nonetheless.
180180
scope.advance(3);
181181
await Promise.all([thirdTrigger, forthTrigger]);
182182

packages/zone.js/NON-STANDARD-APIS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ In electron, we patched the following APIs with `zone.js`
186186

187187
1. Browser API
188188
2. NodeJS
189-
3. Electorn Native API
189+
3. Electron Native API
190190

191191
## Usage.
192192

packages/zone.js/test/browser/browser.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ describe('Zone', function() {
799799
expect(testFn).not.toThrow();
800800
}));
801801

802-
it('window.onerror callback signiture should be (message, source, lineno, colno, error)',
802+
it('window.onerror callback signature should be (message, source, lineno, colno, error)',
803803
ifEnvSupportsWithDone(canPatchOnProperty(window, 'onerror'), function(done: DoneFn) {
804804
const oriOnError = window.onerror;
805805
let testError = new Error('testError');
@@ -1320,7 +1320,7 @@ describe('Zone', function() {
13201320
}));
13211321

13221322

1323-
it('should support add multipe listeners with AddEventListenerOptions once setting and same capture after normal listener',
1323+
it('should support add multiple listeners with AddEventListenerOptions once setting and same capture after normal listener',
13241324
ifEnvSupports(supportEventListenerOptions, function() {
13251325
let logs: string[] = [];
13261326

@@ -1342,7 +1342,7 @@ describe('Zone', function() {
13421342
expect(logs).toEqual(['click']);
13431343
}));
13441344

1345-
it('should support add multipe listeners with AddEventListenerOptions once setting and mixed capture after normal listener',
1345+
it('should support add multiple listeners with AddEventListenerOptions once setting and mixed capture after normal listener',
13461346
ifEnvSupports(supportEventListenerOptions, function() {
13471347
let logs: string[] = [];
13481348

@@ -1364,7 +1364,7 @@ describe('Zone', function() {
13641364
expect(logs).toEqual(['click']);
13651365
}));
13661366

1367-
it('should support add multipe listeners with AddEventListenerOptions once setting before normal listener',
1367+
it('should support add multiple listeners with AddEventListenerOptions once setting before normal listener',
13681368
ifEnvSupports(supportEventListenerOptions, function() {
13691369
let logs: string[] = [];
13701370

@@ -1387,7 +1387,7 @@ describe('Zone', function() {
13871387
expect(logs).toEqual(['click']);
13881388
}));
13891389

1390-
it('should support add multipe listeners with AddEventListenerOptions once setting with same capture before normal listener',
1390+
it('should support add multiple listeners with AddEventListenerOptions once setting with same capture before normal listener',
13911391
ifEnvSupports(supportEventListenerOptions, function() {
13921392
let logs: string[] = [];
13931393

@@ -1410,7 +1410,7 @@ describe('Zone', function() {
14101410
expect(logs).toEqual(['click']);
14111411
}));
14121412

1413-
it('should support add multipe listeners with AddEventListenerOptions once setting with mixed capture before normal listener',
1413+
it('should support add multiple listeners with AddEventListenerOptions once setting with mixed capture before normal listener',
14141414
ifEnvSupports(supportEventListenerOptions, function() {
14151415
let logs: string[] = [];
14161416

0 commit comments

Comments
 (0)
0