Skip to content

Commit e41bfd1

Browse files
committed
fix many lints
1 parent 117da7f commit e41bfd1

13 files changed

Lines changed: 91 additions & 91 deletions

File tree

src/compiler/checker.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ namespace ts {
122122

123123
const noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);
124124

125-
const anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, false, false);
126-
const unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, false, false);
125+
const anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false);
126+
const unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false);
127127

128128
const globals: SymbolTable = {};
129129

@@ -2276,7 +2276,7 @@ namespace ts {
22762276
return false;
22772277
}
22782278
resolutionTargets.push(target);
2279-
resolutionResults.push(true);
2279+
resolutionResults.push(/*items*/ true);
22802280
resolutionPropertyNames.push(propertyName);
22812281
return true;
22822282
}
@@ -3348,7 +3348,7 @@ namespace ts {
33483348

33493349
function getDefaultConstructSignatures(classType: InterfaceType): Signature[] {
33503350
if (!hasClassBaseType(classType)) {
3351-
return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, false, false)];
3351+
return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, /*hasRestParameter*/ false, /*hasStringLiterals*/ false)];
33523352
}
33533353
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
33543354
const baseSignatures = getSignaturesOfType(baseConstructorType, SignatureKind.Construct);
@@ -3973,7 +3973,7 @@ namespace ts {
39733973
}
39743974

39753975
function getSignatureInstantiation(signature: Signature, typeArguments: Type[]): Signature {
3976-
return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true);
3976+
return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true);
39773977
}
39783978

39793979
function getErasedSignature(signature: Signature): Signature {
@@ -3983,7 +3983,7 @@ namespace ts {
39833983
signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper);
39843984
}
39853985
else {
3986-
signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true);
3986+
signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), /*eraseTypeParameters*/ true);
39873987
}
39883988
}
39893989
return signature.erasedSignatureCache;
@@ -5099,7 +5099,7 @@ namespace ts {
50995099
let result = Ternary.True;
51005100
const sourceTypes = source.types;
51015101
for (const sourceType of sourceTypes) {
5102-
const related = typeRelatedToSomeType(sourceType, target, false);
5102+
const related = typeRelatedToSomeType(sourceType, target, /*reportErrors*/ false);
51035103
if (!related) {
51045104
return Ternary.False;
51055105
}
@@ -5497,7 +5497,7 @@ namespace ts {
54975497
const saveErrorInfo = errorInfo;
54985498
let related = isRelatedTo(s, t, reportErrors);
54995499
if (!related) {
5500-
related = isRelatedTo(t, s, false);
5500+
related = isRelatedTo(t, s, /*reportErrors*/ false);
55015501
if (!related) {
55025502
if (reportErrors) {
55035503
reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible,
@@ -5624,7 +5624,7 @@ namespace ts {
56245624
let related: Ternary;
56255625
if (sourceStringType && sourceNumberType) {
56265626
// If we know for sure we're testing both string and numeric index types then only report errors from the second one
5627-
related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors);
5627+
related = isRelatedTo(sourceStringType, targetType, /*reportErrors*/ false) || isRelatedTo(sourceNumberType, targetType, reportErrors);
56285628
}
56295629
else {
56305630
related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors);

src/compiler/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ namespace ts {
842842
}
843843

844844
export function fail(message?: string): void {
845-
Debug.assert(false, message);
845+
Debug.assert(/*expression*/ false, message);
846846
}
847847
}
848848

src/compiler/emitter.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
12921292

12931293
function emitCommaList(nodes: Node[]) {
12941294
if (nodes) {
1295-
emitList(nodes, 0, nodes.length, /*multiline*/ false, /*trailingComma*/ false);
1295+
emitList(nodes, 0, nodes.length, /*multiLine*/ false, /*trailingComma*/ false);
12961296
}
12971297
}
12981298

@@ -2191,7 +2191,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
21912191
}
21922192
else if (languageVersion >= ScriptTarget.ES6 || !forEach(elements, isSpreadElementExpression)) {
21932193
write("[");
2194-
emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces:*/ false);
2194+
emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces*/ false);
21952195
write("]");
21962196
}
21972197
else {
@@ -2215,7 +2215,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
22152215
// then try to preserve the original shape of the object literal.
22162216
// Otherwise just try to preserve the formatting.
22172217
if (numElements === properties.length) {
2218-
emitLinePreservingList(node, properties, /* allowTrailingComma */ languageVersion >= ScriptTarget.ES5, /* spacesBetweenBraces */ true);
2218+
emitLinePreservingList(node, properties, /*allowTrailingComma*/ languageVersion >= ScriptTarget.ES5, /*spacesBetweenBraces*/ true);
22192219
}
22202220
else {
22212221
const multiLine = (node.flags & NodeFlags.MultiLine) !== 0;
@@ -2765,7 +2765,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
27652765
write(".bind.apply(");
27662766
emit(target);
27672767
write(", [void 0].concat(");
2768-
emitListWithSpread(node.arguments, /*needsUniqueCopy*/ false, /*multiline*/ false, /*trailingComma*/ false, /*useConcat*/ false);
2768+
emitListWithSpread(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*trailingComma*/ false, /*useConcat*/ false);
27692769
write(")))");
27702770
write("()");
27712771
}
@@ -2982,7 +2982,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
29822982

29832983
synthesizedLHS = <ElementAccessExpression>createSynthesizedNode(SyntaxKind.ElementAccessExpression, /*startsOnNewLine*/ false);
29842984

2985-
const identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldEmitCommaBeforeAssignment*/ false);
2985+
const identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false);
29862986
synthesizedLHS.expression = identifier;
29872987

29882988
if (leftHandSideExpression.argumentExpression.kind !== SyntaxKind.NumericLiteral &&
@@ -3001,7 +3001,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
30013001
write("(");
30023002
synthesizedLHS = <PropertyAccessExpression>createSynthesizedNode(SyntaxKind.PropertyAccessExpression, /*startsOnNewLine*/ false);
30033003

3004-
const identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefinedTempVariablesInPlaces*/ false, /*shouldemitCommaBeforeAssignment*/ false);
3004+
const identifier = emitTempVariableAssignment(leftHandSideExpression.expression, /*canDefineTempVariablesInPlace*/ false, /*shouldEmitCommaBeforeAssignment*/ false);
30053005
synthesizedLHS.expression = identifier;
30063006

30073007
(<PropertyAccessExpression>synthesizedLHS).dotToken = leftHandSideExpression.dotToken;
@@ -3181,10 +3181,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
31813181
function emitDoStatementWorker(node: DoStatement, loop: ConvertedLoop) {
31823182
write("do");
31833183
if (loop) {
3184-
emitConvertedLoopCall(loop, /* emitAsBlock */ true);
3184+
emitConvertedLoopCall(loop, /*emitAsBlock*/ true);
31853185
}
31863186
else {
3187-
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true);
3187+
emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true);
31883188
}
31893189
if (node.statement.kind === SyntaxKind.Block) {
31903190
write(" ");
@@ -3207,10 +3207,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
32073207
write(")");
32083208

32093209
if (loop) {
3210-
emitConvertedLoopCall(loop, /* emitAsBlock */ true);
3210+
emitConvertedLoopCall(loop, /*emitAsBlock*/ true);
32113211
}
32123212
else {
3213-
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true);
3213+
emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true);
32143214
}
32153215
}
32163216

@@ -3532,8 +3532,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
35323532
write(`switch(${loopResultVariable}) {`);
35333533
increaseIndent();
35343534

3535-
emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /* isBreak */ true, loopResultVariable, outerLoop);
3536-
emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /* isBreak */ false, loopResultVariable, outerLoop);
3535+
emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalBreaks, /*isBreak*/ true, loopResultVariable, outerLoop);
3536+
emitDispatchEntriesForLabeledJumps(currentLoop.labeledNonLocalContinues, /*isBreak*/ false, loopResultVariable, outerLoop);
35373537

35383538
decreaseIndent();
35393539
writeLine();
@@ -3597,10 +3597,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
35973597
write(")");
35983598

35993599
if (loop) {
3600-
emitConvertedLoopCall(loop, /* emitAsBlock */ true);
3600+
emitConvertedLoopCall(loop, /*emitAsBlock*/ true);
36013601
}
36023602
else {
3603-
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true);
3603+
emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true);
36043604
}
36053605
}
36063606

@@ -3638,10 +3638,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
36383638
emitToken(SyntaxKind.CloseParenToken, node.expression.end);
36393639

36403640
if (loop) {
3641-
emitConvertedLoopCall(loop, /* emitAsBlock */ true);
3641+
emitConvertedLoopCall(loop, /*emitAsBlock*/ true);
36423642
}
36433643
else {
3644-
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ true);
3644+
emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ true);
36453645
}
36463646
}
36473647

@@ -3781,10 +3781,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
37813781

37823782
if (loop) {
37833783
writeLine();
3784-
emitConvertedLoopCall(loop, /* emitAsBlock */ false);
3784+
emitConvertedLoopCall(loop, /*emitAsBlock*/ false);
37853785
}
37863786
else {
3787-
emitNormalLoopBody(node, /* emitAsEmbeddedStatement */ false);
3787+
emitNormalLoopBody(node, /*emitAsEmbeddedStatement*/ false);
37883788
}
37893789

37903790
writeLine();
@@ -3818,11 +3818,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
38183818
let labelMarker: string;
38193819
if (node.kind === SyntaxKind.BreakStatement) {
38203820
labelMarker = `break-${node.label.text}`;
3821-
setLabeledJump(convertedLoopState, /* isBreak */ true, node.label.text, labelMarker);
3821+
setLabeledJump(convertedLoopState, /*isBreak*/ true, node.label.text, labelMarker);
38223822
}
38233823
else {
38243824
labelMarker = `continue-${node.label.text}`;
3825-
setLabeledJump(convertedLoopState, /* isBreak */ false, node.label.text, labelMarker);
3825+
setLabeledJump(convertedLoopState, /*isBreak*/ false, node.label.text, labelMarker);
38263826
}
38273827
write(`return "${labelMarker}";`);
38283828
}
@@ -4248,7 +4248,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
42484248
let index: Expression;
42494249
const nameIsComputed = propName.kind === SyntaxKind.ComputedPropertyName;
42504250
if (nameIsComputed) {
4251-
index = ensureIdentifier((<ComputedPropertyName>propName).expression, /* reuseIdentifierExpression */ false);
4251+
index = ensureIdentifier((<ComputedPropertyName>propName).expression, /*reuseIdentifierExpressions*/ false);
42524252
}
42534253
else {
42544254
// We create a synthetic copy of the identifier in order to avoid the rewriting that might
@@ -5380,7 +5380,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
53805380
emitEnd(baseTypeElement);
53815381
}
53825382
}
5383-
emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ false));
5383+
emitPropertyDeclarations(node, getInitializedProperties(node, /*isStatic*/ false));
53845384
if (ctor) {
53855385
let statements: Node[] = (<Block>ctor.body).statements;
53865386
if (superCall) {
@@ -5502,7 +5502,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
55025502
//
55035503
// This keeps the expression as an expression, while ensuring that the static parts
55045504
// of it have been initialized by the time it is used.
5505-
const staticProperties = getInitializedProperties(node, /*static:*/ true);
5505+
const staticProperties = getInitializedProperties(node, /*isStatic*/ true);
55065506
const isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === SyntaxKind.ClassExpression;
55075507
let tempVariable: Identifier;
55085508

@@ -5564,7 +5564,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
55645564
for (var property of staticProperties) {
55655565
write(",");
55665566
writeLine();
5567-
emitPropertyDeclaration(node, property, /*receiver:*/ tempVariable, /*isExpression:*/ true);
5567+
emitPropertyDeclaration(node, property, /*receiver*/ tempVariable, /*isExpression*/ true);
55685568
}
55695569
write(",");
55705570
writeLine();
@@ -5638,7 +5638,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
56385638
writeLine();
56395639
emitConstructor(node, baseTypeNode);
56405640
emitMemberFunctionsForES5AndLower(node);
5641-
emitPropertyDeclarations(node, getInitializedProperties(node, /*static:*/ true));
5641+
emitPropertyDeclarations(node, getInitializedProperties(node, /*isStatic*/ true));
56425642
writeLine();
56435643
emitDecoratorsOfClass(node);
56445644
writeLine();
@@ -8094,11 +8094,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
80948094
* Emit comments associated with node that will not be emitted into JS file
80958095
*/
80968096
function emitCommentsOnNotEmittedNode(node: Node) {
8097-
emitLeadingCommentsWorker(node, /*isEmittedNode:*/ false);
8097+
emitLeadingCommentsWorker(node, /*isEmittedNode*/ false);
80988098
}
80998099

81008100
function emitLeadingComments(node: Node) {
8101-
return emitLeadingCommentsWorker(node, /*isEmittedNode:*/ true);
8101+
return emitLeadingCommentsWorker(node, /*isEmittedNode*/ true);
81028102
}
81038103

81048104
function emitLeadingCommentsWorker(node: Node, isEmittedNode: boolean) {
@@ -8127,7 +8127,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
81278127
emitNewLineBeforeLeadingComments(currentLineMap, writer, node, leadingComments);
81288128

81298129
// Leading comments are emitted at /*leading comment1 */space/*leading comment*/space
8130-
emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator:*/ true, newLine, writeComment);
8130+
emitComments(currentText, currentLineMap, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment);
81318131
}
81328132

81338133
function emitTrailingComments(node: Node) {

0 commit comments

Comments
 (0)