Skip to content

Commit 981991e

Browse files
committed
Fix all lints
1 parent 1df2cea commit 981991e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+237
-246
lines changed

src/compiler/binder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3306,7 +3306,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
33063306
}
33073307
else if (hasDynamicName(node)) {
33083308
bindAnonymousDeclaration(node, SymbolFlags.Property | SymbolFlags.Assignment, InternalSymbolName.Computed);
3309-
const sym = bindPotentiallyMissingNamespaces(parentSymbol, node.left.expression, isTopLevelNamespaceAssignment(node.left), /*isPrototype*/ false, /*containerIsClass*/ false);
3309+
const sym = bindPotentiallyMissingNamespaces(parentSymbol, node.left.expression, isTopLevelNamespaceAssignment(node.left), /*isPrototypeProperty*/ false, /*containerIsClass*/ false);
33103310
addLateBoundAssignmentDeclarationToSymbol(node, sym);
33113311
}
33123312
else {
@@ -3477,7 +3477,7 @@ function createBinder(): (file: SourceFile, options: CompilerOptions) => void {
34773477
function bindCallExpression(node: CallExpression) {
34783478
// We're only inspecting call expressions to detect CommonJS modules, so we can skip
34793479
// this check if we've already seen the module indicator
3480-
if (!file.commonJsModuleIndicator && isRequireCall(node, /*checkArgumentIsStringLiteralLike*/ false)) {
3480+
if (!file.commonJsModuleIndicator && isRequireCall(node, /*requireStringLiteralLikeArgument*/ false)) {
34813481
setCommonJsModuleIndicator(node);
34823482
}
34833483
}

src/compiler/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ export function createBuilderProgram(kind: BuilderProgramKind, { newProgram, hos
16231623
}
16241624
else {
16251625
// When whole program is affected, get all semantic diagnostics (eg when --out or --outFile is specified)
1626-
result = state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken);
1626+
result = state.program.getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken);
16271627
state.changedFilesSet.clear();
16281628
state.programEmitPending = getBuilderFileEmit(state.compilerOptions);
16291629
}

src/compiler/builderState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export namespace BuilderState {
421421
), sourceFiles!);
422422
},
423423
cancellationToken,
424-
/*emitOnlyDtsFiles*/ true,
424+
/*emitOnly*/ true,
425425
/*customTransformers*/ undefined,
426426
/*forceDtsEmit*/ true
427427
);

src/compiler/checker.ts

Lines changed: 64 additions & 64 deletions
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2457,7 +2457,7 @@ export function convertToObjectWorker(
24572457
else {
24582458
return validateValue(convertObjectLiteralExpressionToJson(
24592459
objectLiteralExpression, /* knownOptions*/ undefined,
2460-
/*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined));
2460+
/*extraKeyDiagnostics*/ undefined, /*parentOption*/ undefined));
24612461
}
24622462

24632463
case SyntaxKind.ArrayLiteralExpression:

src/compiler/emitter.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ function emitUsingBuildInfoWorker(
12621262
declarationMapText,
12631263
buildInfoPath,
12641264
buildInfo,
1265-
/*onlyOwnText*/ true
1265+
/*oldFileOfCurrentEmit*/ true
12661266
);
12671267
const outputFiles: OutputFile[] = [];
12681268
const prependNodes = createPrependNodes(config.projectReferences, getCommandLine, f => host.readFile(f), host);
@@ -1478,12 +1478,12 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
14781478
}
14791479

14801480
function printBundle(bundle: Bundle): string {
1481-
writeBundle(bundle, beginPrint(), /*sourceMapEmitter*/ undefined);
1481+
writeBundle(bundle, beginPrint(), /*sourceMapGenerator*/ undefined);
14821482
return endPrint();
14831483
}
14841484

14851485
function printFile(sourceFile: SourceFile): string {
1486-
writeFile(sourceFile, beginPrint(), /*sourceMapEmitter*/ undefined);
1486+
writeFile(sourceFile, beginPrint(), /*sourceMapGenerator*/ undefined);
14871487
return endPrint();
14881488
}
14891489

@@ -3121,7 +3121,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
31213121
function emitParenthesizedExpression(node: ParenthesizedExpression) {
31223122
const openParenPos = emitTokenWithComment(SyntaxKind.OpenParenToken, node.pos, writePunctuation, node);
31233123
const indented = writeLineSeparatorsAndIndentBefore(node.expression, node);
3124-
emitExpression(node.expression, /*parenthesizerRules*/ undefined);
3124+
emitExpression(node.expression, /*parenthesizerRule*/ undefined);
31253125
writeLineSeparatorsAfter(node.expression, node);
31263126
decreaseIndentIf(indented);
31273127
emitTokenWithComment(SyntaxKind.CloseParenToken, node.expression ? node.expression.end : openParenPos, writePunctuation, node);
@@ -3353,7 +3353,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
33533353
}
33543354

33553355
function emitAsExpression(node: AsExpression) {
3356-
emitExpression(node.expression, /*parenthesizerRules*/ undefined);
3356+
emitExpression(node.expression, /*parenthesizerRule*/ undefined);
33573357
if (node.type) {
33583358
writeSpace();
33593359
writeKeyword("as");
@@ -3368,7 +3368,7 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
33683368
}
33693369

33703370
function emitSatisfiesExpression(node: SatisfiesExpression) {
3371-
emitExpression(node.expression, /*parenthesizerRules*/ undefined);
3371+
emitExpression(node.expression, /*parenthesizerRule*/ undefined);
33723372
if (node.type) {
33733373
writeSpace();
33743374
writeKeyword("satisfies");
@@ -6012,9 +6012,9 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri
60126012
case SyntaxKind.SetAccessor:
60136013
return generateNameForMethodOrAccessor(node as MethodDeclaration | AccessorDeclaration, privateName, prefix, suffix);
60146014
case SyntaxKind.ComputedPropertyName:
6015-
return makeTempVariableName(TempFlags.Auto, /*reserveInNestedScopes*/ true, privateName, prefix, suffix);
6015+
return makeTempVariableName(TempFlags.Auto, /*reservedInNestedScopes*/ true, privateName, prefix, suffix);
60166016
default:
6017-
return makeTempVariableName(TempFlags.Auto, /*reserveInNestedScopes*/ false, privateName, prefix, suffix);
6017+
return makeTempVariableName(TempFlags.Auto, /*reservedInNestedScopes*/ false, privateName, prefix, suffix);
60186018
}
60196019
}
60206020

src/compiler/factory/parenthesizerRules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export function createParenthesizerRules(factory: NodeFactory): ParenthesizerRul
340340
const check = skipPartiallyEmittedExpressions(expression);
341341
let needsParens = isCommaSequence(check);
342342
if (!needsParens) {
343-
switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) {
343+
switch (getLeftmostExpression(check, /*stopAtCallExpressions*/ false).kind) {
344344
case SyntaxKind.ClassExpression:
345345
case SyntaxKind.FunctionExpression:
346346
needsParens = true;

src/compiler/factory/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ export function createAccessorPropertySetRedirector(factory: NodeFactory, node:
16701670
name,
16711671
[factory.createParameterDeclaration(
16721672
/*modifiers*/ undefined,
1673-
/*dotdotDotToken*/ undefined,
1673+
/*dotDotDotToken*/ undefined,
16741674
"value"
16751675
)],
16761676
factory.createBlock([

src/compiler/moduleNameResolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ function tryResolveJSModuleWorker(moduleName: string, initialDir: string, host:
16461646
/*cache*/ undefined,
16471647
Extensions.JavaScript,
16481648
/*isConfigLookup*/ false,
1649-
/*redirectedReferences*/ undefined);
1649+
/*redirectedReference*/ undefined);
16501650
}
16511651

16521652
export function bundlerModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations {
@@ -2139,7 +2139,7 @@ function loadEntrypointsFromExportMap(
21392139
}
21402140
const resolvedTarget = combinePaths(scope.packageDirectory, target);
21412141
const finalPath = getNormalizedAbsolutePath(resolvedTarget, state.host.getCurrentDirectory?.());
2142-
const result = loadFileNameFromPackageJsonField(extensions, finalPath, /*recordOnlyFailures*/ false, state);
2142+
const result = loadFileNameFromPackageJsonField(extensions, finalPath, /*onlyRecordFailures*/ false, state);
21432143
if (result) {
21442144
entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
21452145
return true;

src/compiler/parser.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ namespace Parser {
15891589

15901590
export function parseIsolatedEntityName(content: string, languageVersion: ScriptTarget): EntityName | undefined {
15911591
// Choice of `isDeclarationFile` should be arbitrary
1592-
initializeState("", content, languageVersion, /*syntaxCursor*/ undefined, ScriptKind.JS);
1592+
initializeState("", content, languageVersion, /*_syntaxCursor*/ undefined, ScriptKind.JS);
15931593
// Prime the scanner.
15941594
nextToken();
15951595
const entityName = parseEntityName(/*allowReservedWords*/ true);
@@ -1668,7 +1668,7 @@ namespace Parser {
16681668
}
16691669

16701670
// Set source file so that errors will be reported with this file name
1671-
const sourceFile = createSourceFile(fileName, ScriptTarget.ES2015, ScriptKind.JSON, /*isDeclaration*/ false, statements, endOfFileToken, sourceFlags, noop);
1671+
const sourceFile = createSourceFile(fileName, ScriptTarget.ES2015, ScriptKind.JSON, /*isDeclarationFile*/ false, statements, endOfFileToken, sourceFlags, noop);
16721672

16731673
if (setParentNodes) {
16741674
fixupParentReferences(sourceFile);
@@ -6073,7 +6073,7 @@ namespace Parser {
60736073
}
60746074
else {
60756075
parseExpected(SyntaxKind.SlashToken);
6076-
if (parseExpected(SyntaxKind.GreaterThanToken, /*diagnostic*/ undefined, /*shouldAdvance*/ false)) {
6076+
if (parseExpected(SyntaxKind.GreaterThanToken, /*diagnosticMessage*/ undefined, /*shouldAdvance*/ false)) {
60776077
// manually advance the scanner in order to look for jsx text inside jsx
60786078
if (inExpressionContext) {
60796079
nextToken();
@@ -6123,7 +6123,7 @@ namespace Parser {
61236123
parseExpected(SyntaxKind.CloseBraceToken);
61246124
}
61256125
else {
6126-
if (parseExpected(SyntaxKind.CloseBraceToken, /*message*/ undefined, /*shouldAdvance*/ false)) {
6126+
if (parseExpected(SyntaxKind.CloseBraceToken, /*diagnosticMessage*/ undefined, /*shouldAdvance*/ false)) {
61276127
scanJsxText();
61286128
}
61296129
}
@@ -6170,7 +6170,7 @@ namespace Parser {
61706170
const pos = getNodePos();
61716171
parseExpected(SyntaxKind.LessThanSlashToken);
61726172
const tagName = parseJsxElementName();
6173-
if (parseExpected(SyntaxKind.GreaterThanToken, /*diagnostic*/ undefined, /*shouldAdvance*/ false)) {
6173+
if (parseExpected(SyntaxKind.GreaterThanToken, /*diagnosticMessage*/ undefined, /*shouldAdvance*/ false)) {
61746174
// manually advance the scanner in order to look for jsx text inside jsx
61756175
if (inExpressionContext || !tagNamesAreEquivalent(open.tagName, tagName)) {
61766176
nextToken();
@@ -8461,7 +8461,7 @@ namespace Parser {
84618461

84628462
export namespace JSDocParser {
84638463
export function parseJSDocTypeExpressionForTests(content: string, start: number | undefined, length: number | undefined): { jsDocTypeExpression: JSDocTypeExpression, diagnostics: Diagnostic[] } | undefined {
8464-
initializeState("file.js", content, ScriptTarget.Latest, /*_syntaxCursor:*/ undefined, ScriptKind.JS);
8464+
initializeState("file.js", content, ScriptTarget.Latest, /*_syntaxCursor*/ undefined, ScriptKind.JS);
84658465
scanner.setText(content, start, length);
84668466
currentToken = scanner.scan();
84678467
const jsDocTypeExpression = parseJSDocTypeExpression();
@@ -8511,7 +8511,7 @@ namespace Parser {
85118511
}
85128512

85138513
export function parseIsolatedJSDocComment(content: string, start: number | undefined, length: number | undefined): { jsDoc: JSDoc, diagnostics: Diagnostic[] } | undefined {
8514-
initializeState("", content, ScriptTarget.Latest, /*_syntaxCursor:*/ undefined, ScriptKind.JS);
8514+
initializeState("", content, ScriptTarget.Latest, /*_syntaxCursor*/ undefined, ScriptKind.JS);
85158515
const jsDoc = doInsideOfContext(NodeFlags.JSDoc, () => parseJSDocCommentWorker(start, length));
85168516

85178517
const sourceFile = { languageVariant: LanguageVariant.Standard, text: content } as SourceFile;

src/compiler/program.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,7 +2127,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
21272127
if (structureIsReused === StructureIsReused.Not) {
21282128
// If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules,
21292129
// the best we can do is fallback to the default logic.
2130-
return resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, /*resuedNames*/ undefined);
2130+
return resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, /*reusedNames*/ undefined);
21312131
}
21322132

21332133
const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : undefined;
@@ -2534,7 +2534,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
25342534
getEmitHost(writeFileCallback),
25352535
/*targetSourceFile*/ undefined,
25362536
/*transformers*/ noTransformers,
2537-
/*emitOnlyDtsFiles*/ false,
2537+
/*emitOnly*/ false,
25382538
/*onlyBuildInfo*/ true
25392539
);
25402540

@@ -3269,7 +3269,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
32693269
const r = /import|require/g;
32703270
while (r.exec(file.text) !== null) { // eslint-disable-line no-null/no-null
32713271
const node = getNodeAtPosition(file, r.lastIndex);
3272-
if (shouldProcessRequires && isRequireCall(node, /*checkArgumentIsStringLiteralLike*/ true)) {
3272+
if (shouldProcessRequires && isRequireCall(node, /*requireStringLiteralLikeArgument*/ true)) {
32733273
setParentRecursive(node, /*incremental*/ false); // we need parent data on imports before the program is fully bound, so we ensure it's set here
32743274
imports = append(imports, node.arguments[0]);
32753275
}
@@ -3954,7 +3954,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
39543954
if (host.getParsedCommandLine) {
39553955
commandLine = host.getParsedCommandLine(refPath);
39563956
if (!commandLine) {
3957-
addFileToFilesByName(/*sourceFile*/ undefined, sourceFilePath, /*redirectedPath*/ undefined);
3957+
addFileToFilesByName(/*file*/ undefined, sourceFilePath, /*redirectedPath*/ undefined);
39583958
projectReferenceRedirects.set(sourceFilePath, false);
39593959
return undefined;
39603960
}

src/compiler/resolutionCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ export function createResolutionCache(resolutionHost: ResolutionCacheHost, rootD
905905
resolutions.forEach(watchFailedLookupLocationOfResolution);
906906
}
907907
else {
908-
resolutions.forEach(resolution => watchAffectingLocationsOfResolution(resolution, /*addToResolutionWithOnlyAffectingLocations*/ true));
908+
resolutions.forEach(resolution => watchAffectingLocationsOfResolution(resolution, /*addToResolutionsWithOnlyAffectingLocations*/ true));
909909
}
910910
}
911911

src/compiler/transformers/classFields.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,7 @@ export function transformClassFields(context: TransformationContext): (x: Source
17501750
function visitExpressionWithTypeArgumentsInHeritageClause(node: ExpressionWithTypeArguments) {
17511751
const facts = lexicalEnvironment?.data?.facts || ClassFacts.None;
17521752
if (facts & ClassFacts.NeedsClassSuperReference) {
1753-
const temp = factory.createTempVariable(hoistVariableDeclaration, /*reserveInNestedScopes*/ true);
1753+
const temp = factory.createTempVariable(hoistVariableDeclaration, /*reservedInNestedScopes*/ true);
17541754
getClassLexicalEnvironment().superClassReference = temp;
17551755
return factory.updateExpressionWithTypeArguments(
17561756
node,
@@ -2857,7 +2857,7 @@ export function transformClassFields(context: TransformationContext): (x: Source
28572857
const identifier =
28582858
typeof name === "object" ? factory.getGeneratedNameForNode(name, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.ReservedInNestedScopes, prefix, suffix) :
28592859
typeof name === "string" ? factory.createUniqueName(name, GeneratedIdentifierFlags.Optimistic, prefix, suffix) :
2860-
factory.createTempVariable(/*recordTempVariable*/ undefined, /*reserveInNestedScopes*/ true, prefix, suffix);
2860+
factory.createTempVariable(/*recordTempVariable*/ undefined, /*reservedInNestedScopes*/ true, prefix, suffix);
28612861

28622862
if (resolver.getNodeCheckFlags(node) & NodeCheckFlags.BlockScopedBindingInLoop) {
28632863
addBlockScopedVariable(identifier);

src/compiler/transformers/declarations.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ export function transformDeclarations(context: TransformationContext) {
387387

388388
function trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags) {
389389
if (symbol.flags & SymbolFlags.TypeParameter) return false;
390-
const issuedDiagnostic = handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, /*shouldComputeAliasesToMakeVisible*/ true));
390+
const issuedDiagnostic = handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning, /*shouldComputeAliasToMarkVisible*/ true));
391391
recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForSymbol(symbol, meaning));
392392
return issuedDiagnostic;
393393
}
@@ -1126,7 +1126,7 @@ export function transformDeclarations(context: TransformationContext) {
11261126
if (isMethodDeclaration(input) || isMethodSignature(input)) {
11271127
if (hasEffectiveModifier(input, ModifierFlags.Private)) {
11281128
if (input.symbol && input.symbol.declarations && input.symbol.declarations[0] !== input) return; // Elide all but the first overload
1129-
return cleanup(factory.createPropertyDeclaration(ensureModifiers(input), input.name, /*questionToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined));
1129+
return cleanup(factory.createPropertyDeclaration(ensureModifiers(input), input.name, /*questionOrExclamationToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined));
11301130
}
11311131
}
11321132

@@ -1648,7 +1648,7 @@ export function transformDeclarations(context: TransformationContext) {
16481648
elems.push(factory.createPropertyDeclaration(
16491649
ensureModifiers(param),
16501650
elem.name as Identifier,
1651-
/*questionToken*/ undefined,
1651+
/*questionOrExclamationToken*/ undefined,
16521652
ensureType(elem, /*type*/ undefined),
16531653
/*initializer*/ undefined
16541654
));
@@ -1666,7 +1666,7 @@ export function transformDeclarations(context: TransformationContext) {
16661666
factory.createPropertyDeclaration(
16671667
/*modifiers*/ undefined,
16681668
factory.createPrivateIdentifier("#private"),
1669-
/*questionToken*/ undefined,
1669+
/*questionOrExclamationToken*/ undefined,
16701670
/*type*/ undefined,
16711671
/*initializer*/ undefined
16721672
)

src/compiler/transformers/es2015.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,7 @@ export function transformES2015(context: TransformationContext): (x: SourceFile
25432543
visitor,
25442544
context,
25452545
FlattenLevel.All,
2546-
/*value*/ undefined,
2546+
/*rval*/ undefined,
25472547
(ancestorFacts & HierarchyFacts.ExportedVariableStatement) !== 0
25482548
);
25492549
}

0 commit comments

Comments
 (0)