Skip to content

Contributing: fix typos #36423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -62865,7 +62865,7 @@ var ts;
var sourceConstraint = constraint && getTypeFromTypeNode(constraint);
var targetConstraint = getConstraintOfTypeParameter(target);
// relax check if later interface augmentation has no constraint, it's more broad and is OK to merge with
// a more constrained interface (this could be generalized to a full heirarchy check, but that's maybe overkill)
// a more constrained interface (this could be generalized to a full hierarchy check, but that's maybe overkill)
if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) {
return false;
}
Expand Down Expand Up @@ -112680,7 +112680,7 @@ var ts;
getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, 0 /* Import */), state, state.includesSourceFile(exportingFile));
}
}
/** Search for all occurences of an identifier in a source file (and filter out the ones that match). */
/** Search for all occurrences of an identifier in a source file (and filter out the ones that match). */
function searchForName(sourceFile, search, state) {
if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) {
getReferencesInSourceFile(sourceFile, search, state);
Expand Down
4 changes: 2 additions & 2 deletions lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -63015,7 +63015,7 @@ var ts;
var sourceConstraint = constraint && getTypeFromTypeNode(constraint);
var targetConstraint = getConstraintOfTypeParameter(target);
// relax check if later interface augmentation has no constraint, it's more broad and is OK to merge with
// a more constrained interface (this could be generalized to a full heirarchy check, but that's maybe overkill)
// a more constrained interface (this could be generalized to a full hierarchy check, but that's maybe overkill)
if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) {
return false;
}
Expand Down Expand Up @@ -113203,7 +113203,7 @@ var ts;
getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, 0 /* Import */), state, state.includesSourceFile(exportingFile));
}
}
/** Search for all occurences of an identifier in a source file (and filter out the ones that match). */
/** Search for all occurrences of an identifier in a source file (and filter out the ones that match). */
function searchForName(sourceFile, search, state) {
if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) {
getReferencesInSourceFile(sourceFile, search, state);
Expand Down
4 changes: 2 additions & 2 deletions lib/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -63015,7 +63015,7 @@ var ts;
var sourceConstraint = constraint && getTypeFromTypeNode(constraint);
var targetConstraint = getConstraintOfTypeParameter(target);
// relax check if later interface augmentation has no constraint, it's more broad and is OK to merge with
// a more constrained interface (this could be generalized to a full heirarchy check, but that's maybe overkill)
// a more constrained interface (this could be generalized to a full hierarchy check, but that's maybe overkill)
if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) {
return false;
}
Expand Down Expand Up @@ -113203,7 +113203,7 @@ var ts;
getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, 0 /* Import */), state, state.includesSourceFile(exportingFile));
}
}
/** Search for all occurences of an identifier in a source file (and filter out the ones that match). */
/** Search for all occurrences of an identifier in a source file (and filter out the ones that match). */
function searchForName(sourceFile, search, state) {
if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) {
getReferencesInSourceFile(sourceFile, search, state);
Expand Down
4 changes: 2 additions & 2 deletions lib/typescriptServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -63015,7 +63015,7 @@ var ts;
var sourceConstraint = constraint && getTypeFromTypeNode(constraint);
var targetConstraint = getConstraintOfTypeParameter(target);
// relax check if later interface augmentation has no constraint, it's more broad and is OK to merge with
// a more constrained interface (this could be generalized to a full heirarchy check, but that's maybe overkill)
// a more constrained interface (this could be generalized to a full hierarchy check, but that's maybe overkill)
if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) {
return false;
}
Expand Down Expand Up @@ -113203,7 +113203,7 @@ var ts;
getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, 0 /* Import */), state, state.includesSourceFile(exportingFile));
}
}
/** Search for all occurences of an identifier in a source file (and filter out the ones that match). */
/** Search for all occurrences of an identifier in a source file (and filter out the ones that match). */
function searchForName(sourceFile, search, state) {
if (ts.getNameTable(sourceFile).get(search.escapedText) !== undefined) {
getReferencesInSourceFile(sourceFile, search, state);
Expand Down
2 changes: 1 addition & 1 deletion lib/typingsInstaller.js
Original file line number Diff line number Diff line change
Expand Up @@ -62854,7 +62854,7 @@ var ts;
var sourceConstraint = constraint && getTypeFromTypeNode(constraint);
var targetConstraint = getConstraintOfTypeParameter(target);
// relax check if later interface augmentation has no constraint, it's more broad and is OK to merge with
// a more constrained interface (this could be generalized to a full heirarchy check, but that's maybe overkill)
// a more constrained interface (this could be generalized to a full hierarchy check, but that's maybe overkill)
if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32014,7 +32014,7 @@ namespace ts {
const sourceConstraint = constraint && getTypeFromTypeNode(constraint);
const targetConstraint = getConstraintOfTypeParameter(target);
// relax check if later interface augmentation has no constraint, it's more broad and is OK to merge with
// a more constrained interface (this could be generalized to a full heirarchy check, but that's maybe overkill)
// a more constrained interface (this could be generalized to a full hierarchy check, but that's maybe overkill)
if (sourceConstraint && targetConstraint && !isTypeIdenticalTo(sourceConstraint, targetConstraint)) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/findAllReferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ namespace ts.FindAllReferences {
}
}

/** Search for all occurences of an identifier in a source file (and filter out the ones that match). */
/** Search for all occurrences of an identifier in a source file (and filter out the ones that match). */
function searchForName(sourceFile: SourceFile, search: Search, state: State): void {
if (getNameTable(sourceFile).get(search.escapedText) !== undefined) {
getReferencesInSourceFile(sourceFile, search, state);
Expand Down
4 changes: 2 additions & 2 deletions src/testRunner/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"unittests/tsserver/maxNodeModuleJsDepth.ts",
"unittests/tsserver/metadataInResponse.ts",
"unittests/tsserver/navTo.ts",
"unittests/tsserver/occurences.ts",
"unittests/tsserver/occurrences.ts",
"unittests/tsserver/openFile.ts",
"unittests/tsserver/packageJsonInfo.ts",
"unittests/tsserver/projectErrors.ts",
Expand All @@ -184,7 +184,7 @@
"unittests/tsserver/syntaxOperations.ts",
"unittests/tsserver/textStorage.ts",
"unittests/tsserver/telemetry.ts",
"unittests/tsserver/typeAquisition.ts",
"unittests/tsserver/typeAcquisition.ts",
"unittests/tsserver/typeReferenceDirectives.ts",
"unittests/tsserver/typingsInstaller.ts",
"unittests/tsserver/untitledFiles.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace ts.projectSystem {
describe("unittests:: tsserver:: occurence highlight on string", () => {
describe("unittests:: tsserver:: occurrence highlight on string", () => {
it("should be marked if only on string values", () => {
const file1: File = {
path: "/a/b/file1.ts",
Expand All @@ -17,8 +17,8 @@ namespace ts.projectSystem {
{ file: file1.path, line: 1, offset: 11 }
);
const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[];
const firstOccurence = highlightResponse[0];
assert.isTrue(firstOccurence.isInString, "Highlights should be marked with isInString");
const firstOccurrence = highlightResponse[0];
assert.isTrue(firstOccurrence.isInString, "Highlights should be marked with isInString");
}

{
Expand All @@ -28,8 +28,8 @@ namespace ts.projectSystem {
);
const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[];
assert.isTrue(highlightResponse.length === 2);
const firstOccurence = highlightResponse[0];
assert.isUndefined(firstOccurence.isInString, "Highlights should not be marked with isInString if on property name");
const firstOccurrence = highlightResponse[0];
assert.isUndefined(firstOccurrence.isInString, "Highlights should not be marked with isInString if on property name");
}

{
Expand All @@ -39,8 +39,8 @@ namespace ts.projectSystem {
);
const highlightResponse = session.executeCommand(highlightRequest).response as protocol.OccurrencesResponseItem[];
assert.isTrue(highlightResponse.length === 2);
const firstOccurence = highlightResponse[0];
assert.isUndefined(firstOccurence.isInString, "Highlights should not be marked with isInString if on indexer");
const firstOccurrence = highlightResponse[0];
assert.isUndefined(firstOccurrence.isInString, "Highlights should not be marked with isInString if on indexer");
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace ts.projectSystem {
});
projectService.checkNumberOfProjects({ externalProjects: 1 });
const typeAcquisition = projectService.externalProjects[0].getTypeAcquisition();
assert.isTrue(typeAcquisition.enable, "Typine acquisition should be enabled");
assert.isTrue(typeAcquisition.enable, "Typing acquisition should be enabled");
});
});

Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/parserNotRegex1.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ tests/cases/conformance/parser/ecmascript5/parserNotRegex1.ts(3,5): error TS1108


==== tests/cases/conformance/parser/ecmascript5/parserNotRegex1.ts (2 errors) ====
if (a.indexOf(-(4/3))) // We should not get a regex here becuase of the / in the comment.
if (a.indexOf(-(4/3))) // We should not get a regex here because of the / in the comment.
~
!!! error TS2304: Cannot find name 'a'.
{
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/parserNotRegex1.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//// [parserNotRegex1.ts]
if (a.indexOf(-(4/3))) // We should not get a regex here becuase of the / in the comment.
{
return true;
if (a.indexOf(-(4/3))) // We should not get a regex here because of the / in the comment.
{
return true;
}

//// [parserNotRegex1.js]
if (a.indexOf(-(4 / 3))) // We should not get a regex here becuase of the / in the comment.
if (a.indexOf(-(4 / 3))) // We should not get a regex here because of the / in the comment.
{
return true;
}
2 changes: 1 addition & 1 deletion tests/baselines/reference/parserNotRegex1.symbols
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=== tests/cases/conformance/parser/ecmascript5/parserNotRegex1.ts ===
if (a.indexOf(-(4/3))) // We should not get a regex here becuase of the / in the comment.
if (a.indexOf(-(4/3))) // We should not get a regex here because of the / in the comment.
No type information for this code. {
No type information for this code. return true;
No type information for this code. }
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/parserNotRegex1.types
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=== tests/cases/conformance/parser/ecmascript5/parserNotRegex1.ts ===
if (a.indexOf(-(4/3))) // We should not get a regex here becuase of the / in the comment.
if (a.indexOf(-(4/3))) // We should not get a regex here because of the / in the comment.
>a.indexOf(-(4/3)) : any
>a.indexOf : any
>a : any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tests/cases/conformance/jsx/file.tsx(36,12): error TS2769: No overload matches t
!!! error TS2769: Overload 2 of 2, '(l: { yy: number; yy1: string; }): Element', gave the following error.
!!! error TS2769: Type 'true' is not assignable to type 'string'.
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:3:43: The expected type comes from property 'yy1' which is declared here on type 'IntrinsicAttributes & { yy: number; yy1: string; }'
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK becuase all attribute are spread
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK because all attribute are spread
const c4 = <OneThing {...obj} y1={10000} />; // extra property;
~~
!!! error TS2769: No overload matches this call.
Expand Down
62 changes: 31 additions & 31 deletions tests/baselines/reference/tsxStatelessFunctionComponentOverload4.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//// [file.tsx]
//// [file.tsx]
import React = require('react')
declare function OneThing(): JSX.Element;
declare function OneThing(l: {yy: number, yy1: string}): JSX.Element;
Expand All @@ -13,7 +13,7 @@ let obj2: any;
const c0 = <OneThing extraProp />; // extra property;
const c1 = <OneThing yy={10}/>; // missing property;
const c2 = <OneThing {...obj} yy1 />; // type incompatible;
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK becuase all attribute are spread
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK because all attribute are spread
const c4 = <OneThing {...obj} y1={10000} />; // extra property;
const c5 = <OneThing {...obj} {...{yy: true}} />; // type incompatible;
const c6 = <OneThing {...obj2} {...{extra: "extra attr"}} />; // Should error as there is extra attribute that doesn't match any. Current it is not
Expand All @@ -35,32 +35,32 @@ const e1 = <TestingOptional y1 y3="hello"/>
const e2 = <TestingOptional y1="hello" y2={1000} y3 />
const e3 = <TestingOptional y1="hello" y2={1000} children="hi" />
const e4 = <TestingOptional y1="hello" y2={1000}>Hi</TestingOptional>
//// [file.jsx]
define(["require", "exports", "react"], function (require, exports, React) {
"use strict";
exports.__esModule = true;
var obj = {
yy: 10,
yy1: "hello"
};
var obj2;
// Error
var c0 = <OneThing extraProp/>; // extra property;
var c1 = <OneThing yy={10}/>; // missing property;
var c2 = <OneThing {...obj} yy1/>; // type incompatible;
var c3 = <OneThing {...obj} {...{ extra: "extra attr" }}/>; // This is OK becuase all attribute are spread
var c4 = <OneThing {...obj} y1={10000}/>; // extra property;
var c5 = <OneThing {...obj} {...{ yy: true }}/>; // type incompatible;
var c6 = <OneThing {...obj2} {...{ extra: "extra attr" }}/>; // Should error as there is extra attribute that doesn't match any. Current it is not
var c7 = <OneThing {...obj2} yy/>; // Should error as there is extra attribute that doesn't match any. Current it is not
// Error
var d1 = <TestingOneThing extra-data/>;
var d2 = <TestingOneThing yy="hello" direction="left"/>;
// Error
var e1 = <TestingOptional y1 y3="hello"/>;
var e2 = <TestingOptional y1="hello" y2={1000} y3/>;
var e3 = <TestingOptional y1="hello" y2={1000} children="hi"/>;
var e4 = <TestingOptional y1="hello" y2={1000}>Hi</TestingOptional>;
});


//// [file.jsx]
define(["require", "exports", "react"], function (require, exports, React) {
"use strict";
exports.__esModule = true;
var obj = {
yy: 10,
yy1: "hello"
};
var obj2;
// Error
var c0 = <OneThing extraProp/>; // extra property;
var c1 = <OneThing yy={10}/>; // missing property;
var c2 = <OneThing {...obj} yy1/>; // type incompatible;
var c3 = <OneThing {...obj} {...{ extra: "extra attr" }}/>; // This is OK because all attribute are spread
var c4 = <OneThing {...obj} y1={10000}/>; // extra property;
var c5 = <OneThing {...obj} {...{ yy: true }}/>; // type incompatible;
var c6 = <OneThing {...obj2} {...{ extra: "extra attr" }}/>; // Should error as there is extra attribute that doesn't match any. Current it is not
var c7 = <OneThing {...obj2} yy/>; // Should error as there is extra attribute that doesn't match any. Current it is not
// Error
var d1 = <TestingOneThing extra-data/>;
var d2 = <TestingOneThing yy="hello" direction="left"/>;
// Error
var e1 = <TestingOptional y1 y3="hello"/>;
var e2 = <TestingOptional y1="hello" y2={1000} y3/>;
var e3 = <TestingOptional y1="hello" y2={1000} children="hi"/>;
var e4 = <TestingOptional y1="hello" y2={1000}>Hi</TestingOptional>;
});
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const c2 = <OneThing {...obj} yy1 />; // type incompatible;
>obj : Symbol(obj, Decl(file.tsx, 4, 3))
>yy1 : Symbol(yy1, Decl(file.tsx, 13, 29))

const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK becuase all attribute are spread
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK because all attribute are spread
>c3 : Symbol(c3, Decl(file.tsx, 14, 5))
>OneThing : Symbol(OneThing, Decl(file.tsx, 0, 31), Decl(file.tsx, 1, 41))
>obj : Symbol(obj, Decl(file.tsx, 4, 3))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const c2 = <OneThing {...obj} yy1 />; // type incompatible;
>obj : { yy: number; yy1: string; }
>yy1 : true

const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK becuase all attribute are spread
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK because all attribute are spread
>c3 : JSX.Element
><OneThing {...obj} {...{extra: "extra attr"}} /> : JSX.Element
>OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let obj2: any;
const c0 = <OneThing extraProp />; // extra property;
const c1 = <OneThing yy={10}/>; // missing property;
const c2 = <OneThing {...obj} yy1 />; // type incompatible;
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK becuase all attribute are spread
const c3 = <OneThing {...obj} {...{extra: "extra attr"}} />; // This is OK because all attribute are spread
const c4 = <OneThing {...obj} y1={10000} />; // extra property;
const c5 = <OneThing {...obj} {...{yy: true}} />; // type incompatible;
const c6 = <OneThing {...obj2} {...{extra: "extra attr"}} />; // Should error as there is extra attribute that doesn't match any. Current it is not
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (a.indexOf(-(4/3))) // We should not get a regex here becuase of the / in the comment.
if (a.indexOf(-(4/3))) // We should not get a regex here because of the / in the comment.
{
return true;
}
Loading