Skip to content

Commit 6d7bc65

Browse files
author
Andy
authored
Merge pull request microsoft#13999 from Microsoft/semicolon
Fix "semicolon" lint rule options (was not enabled)
2 parents 5abb8f3 + 3bc1254 commit 6d7bc65

27 files changed

+55
-57
lines changed

src/compiler/checker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ namespace ts {
141141
getAugmentedPropertiesOfType,
142142
getRootSymbols,
143143
getContextualType: node => {
144-
node = getParseTreeNode(node, isExpression)
144+
node = getParseTreeNode(node, isExpression);
145145
return node ? getContextualType(node) : undefined;
146146
},
147147
getFullyQualifiedName,
@@ -20674,7 +20674,7 @@ namespace ts {
2067420674
}
2067520675

2067620676
if (potentialNewTargetCollisions.length) {
20677-
forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope)
20677+
forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope);
2067820678
potentialNewTargetCollisions.length = 0;
2067920679
}
2068020680

src/compiler/core.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace ts {
8484
this.index++;
8585
return { value: this.selector(this.data, this.keys[index]), done: false };
8686
}
87-
return { value: undefined as never, done: true }
87+
return { value: undefined as never, done: true };
8888
}
8989
}
9090

@@ -140,7 +140,7 @@ namespace ts {
140140
action(this.data[key], key);
141141
}
142142
}
143-
}
143+
};
144144
}
145145

146146
export function createFileMap<T>(keyMapper?: (key: string) => string): FileMap<T> {

src/compiler/declarationEmitter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ namespace ts {
11641164
emitTypeParameters(node.typeParameters);
11651165
const baseTypeNode = getClassExtendsHeritageClauseElement(node);
11661166
if (baseTypeNode) {
1167-
node.name
1167+
node.name;
11681168
emitHeritageClause(node.name, [baseTypeNode], /*isImplementsList*/ false);
11691169
}
11701170
emitHeritageClause(node.name, getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true);

src/compiler/moduleNameResolver.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ namespace ts {
675675
}
676676

677677
export function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations {
678-
return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, /* jsOnly*/ false);
678+
return nodeModuleNameResolverWorker(moduleName, containingFile, compilerOptions, host, cache, /*jsOnly*/ false);
679679
}
680680

681681
/* @internal */
@@ -962,7 +962,7 @@ namespace ts {
962962
const result = cache && cache.get(containingDirectory);
963963
if (result) {
964964
if (traceEnabled) {
965-
trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName)
965+
trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName);
966966
}
967967
return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } };
968968
}

src/compiler/transformer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ namespace ts {
121121
enableEmitNotification,
122122
isSubstitutionEnabled,
123123
isEmitNotificationEnabled,
124-
get onSubstituteNode() { return onSubstituteNode },
124+
get onSubstituteNode() { return onSubstituteNode; },
125125
set onSubstituteNode(value) {
126126
Debug.assert(state < TransformationState.Initialized, "Cannot modify transformation hooks after initialization has completed.");
127127
Debug.assert(value !== undefined, "Value must not be 'undefined'");
128128
onSubstituteNode = value;
129129
},
130-
get onEmitNode() { return onEmitNode },
130+
get onEmitNode() { return onEmitNode; },
131131
set onEmitNode(value) {
132132
Debug.assert(state < TransformationState.Initialized, "Cannot modify transformation hooks after initialization has completed.");
133133
Debug.assert(value !== undefined, "Value must not be 'undefined'");

src/compiler/transformers/es2015.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2690,7 +2690,7 @@ namespace ts {
26902690
if (loopOutParameters.length) {
26912691
copyOutParameters(loopOutParameters, CopyDirection.ToOutParameter, statements);
26922692
}
2693-
addRange(statements, lexicalEnvironment)
2693+
addRange(statements, lexicalEnvironment);
26942694
loopBody = createBlock(statements, /*multiline*/ true);
26952695
}
26962696

src/compiler/transformers/module/module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ namespace ts {
11521152
createIdentifier("__esModule"),
11531153
createLiteral(true)
11541154
)
1155-
)
1155+
);
11561156
}
11571157
else {
11581158
statement = createStatement(

src/compiler/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3297,7 +3297,7 @@
32973297
}
32983298

32993299
export interface PluginImport {
3300-
name: string
3300+
name: string;
33013301
}
33023302

33033303
export type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike<string[]> | PluginImport[];

src/harness/fourslash.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ namespace FourSlash {
585585
}
586586

587587
private getGoToDefinition(): ts.DefinitionInfo[] {
588-
return this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition)
588+
return this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition);
589589
}
590590

591591
public verifyGoToType(arg0: any, endMarkerNames?: string | string[]) {
@@ -926,7 +926,7 @@ namespace FourSlash {
926926
function rangeToReferenceEntry(r: Range) {
927927
let { isWriteAccess, isDefinition } = (r.marker && r.marker.data) || { isWriteAccess: false, isDefinition: false };
928928
isWriteAccess = !!isWriteAccess; isDefinition = !!isDefinition;
929-
return { fileName: r.fileName, textSpan: { start: r.start, length: r.end - r.start }, isWriteAccess, isDefinition }
929+
return { fileName: r.fileName, textSpan: { start: r.start, length: r.end - r.start }, isWriteAccess, isDefinition };
930930
}
931931
}
932932

@@ -2136,7 +2136,7 @@ namespace FourSlash {
21362136

21372137
const result = includeWhiteSpace
21382138
? actualText === expectedText
2139-
: this.removeWhitespace(actualText) === this.removeWhitespace(expectedText)
2139+
: this.removeWhitespace(actualText) === this.removeWhitespace(expectedText);
21402140

21412141
if (!result) {
21422142
this.raiseError(`Actual text doesn't match expected text. Actual:\n'${actualText}'\nExpected:\n'${expectedText}'`);
@@ -2173,7 +2173,7 @@ namespace FourSlash {
21732173
start: diagnostic.start,
21742174
length: diagnostic.length,
21752175
code: diagnostic.code
2176-
}
2176+
};
21772177
});
21782178
const dedupedDiagnositcs = ts.deduplicate(diagnosticsForCodeFix, ts.equalOwnProperties);
21792179

src/harness/harness.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ declare namespace NodeJS {
4444
declare var window: {};
4545
declare var XMLHttpRequest: {
4646
new(): XMLHttpRequest;
47-
}
47+
};
4848
interface XMLHttpRequest {
4949
readonly readyState: number;
5050
readonly responseText: string;
@@ -1017,7 +1017,7 @@ namespace Harness {
10171017
}
10181018
else {
10191019
if (!es6TestLibFileNameSourceFileMap.get(libFileName)) {
1020-
es6TestLibFileNameSourceFileMap.set(libFileName, createSourceFileAndAssertInvariants(libFileName, IO.readFile(libFileName), scriptTarget))
1020+
es6TestLibFileNameSourceFileMap.set(libFileName, createSourceFileAndAssertInvariants(libFileName, IO.readFile(libFileName), scriptTarget));
10211021
}
10221022
}
10231023
}

src/harness/harnessLanguageService.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ namespace Harness.LanguageService {
779779
start: 0
780780
});
781781
return prev;
782-
}
782+
};
783783
return proxy;
784784
}
785785
}),

src/harness/unittests/compileOnSave.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ namespace ts.projectSystem {
496496
const emitOutput = host.readFile(path + ".js");
497497
assert.equal(emitOutput, f.content + newLine, "content of emit output should be identical with the input + newline");
498498
}
499-
})
499+
});
500500

501501
it("should emit specified file", () => {
502502
const file1 = {

src/harness/unittests/printer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace ts {
99
Harness.Baseline.runBaseline(`printerApi/${prefix}.${name}.js`, () =>
1010
printCallback(createPrinter({ newLine: NewLineKind.CarriageReturnLineFeed, ...options })));
1111
});
12-
}
12+
};
1313
}
1414

1515
describe("printFile", () => {

src/harness/unittests/textStorage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ namespace ts.textStorage {
6565

6666
ts1.getLineInfo(0);
6767
assert.isTrue(ts1.hasScriptVersionCache(), "have script version cache - 2");
68-
})
68+
});
6969
});
7070
}

src/harness/unittests/tsserverProjectSystem.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ namespace ts.projectSystem {
628628

629629
checkProjectActualFiles(service.configuredProjects[0], []);
630630
checkProjectActualFiles(service.inferredProjects[0], [f1.path]);
631-
})
631+
});
632632

633633
it("create configured project without file list", () => {
634634
const configFile: FileOrFolder = {
@@ -1181,7 +1181,7 @@ namespace ts.projectSystem {
11811181

11821182
const host = createServerHost([f1, f2, libFile]);
11831183
const service = createProjectService(host);
1184-
service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: toExternalFiles([f1.path, f2.path]), options: {} })
1184+
service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: toExternalFiles([f1.path, f2.path]), options: {} });
11851185

11861186
service.openClientFile(f1.path);
11871187
service.openClientFile(f2.path, "let x: string");
@@ -1213,7 +1213,7 @@ namespace ts.projectSystem {
12131213

12141214
const host = createServerHost([f1, f2, libFile]);
12151215
const service = createProjectService(host);
1216-
service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: [{ fileName: f1.path }, { fileName: f2.path, hasMixedContent: true }], options: {} })
1216+
service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: [{ fileName: f1.path }, { fileName: f2.path, hasMixedContent: true }], options: {} });
12171217

12181218
service.openClientFile(f1.path);
12191219
service.openClientFile(f2.path, "let somelongname: string");
@@ -2040,7 +2040,7 @@ namespace ts.projectSystem {
20402040

20412041
for (const f of [f2, f3]) {
20422042
const scriptInfo = projectService.getScriptInfoForNormalizedPath(server.toNormalizedPath(f.path));
2043-
assert.equal(scriptInfo.containingProjects.length, 0, `expect 0 containing projects for '${f.path}'`)
2043+
assert.equal(scriptInfo.containingProjects.length, 0, `expect 0 containing projects for '${f.path}'`);
20442044
}
20452045
});
20462046

@@ -2156,7 +2156,7 @@ namespace ts.projectSystem {
21562156
projectFileName,
21572157
rootFiles: [toExternalFile(f1.path)],
21582158
options: {}
2159-
})
2159+
});
21602160
projectService.openClientFile(f1.path, "let x = 1;\nlet y = 2;");
21612161

21622162
projectService.checkNumberOfProjects({ externalProjects: 1 });
@@ -3307,12 +3307,12 @@ namespace ts.projectSystem {
33073307
isCancellationRequested: () => false,
33083308
setRequest: requestId => {
33093309
if (expectedRequestId === undefined) {
3310-
assert.isTrue(false, "unexpected call")
3310+
assert.isTrue(false, "unexpected call");
33113311
}
33123312
assert.equal(requestId, expectedRequestId);
33133313
},
33143314
resetRequest: noop
3315-
}
3315+
};
33163316
const session = createSession(host, /*typingsInstaller*/ undefined, /*projectServiceEventHandler*/ undefined, cancellationToken);
33173317

33183318
expectedRequestId = session.getNextSeq();
@@ -3359,13 +3359,13 @@ namespace ts.projectSystem {
33593359
currentId = requestId;
33603360
},
33613361
resetRequest(requestId) {
3362-
assert.equal(requestId, currentId, "unexpected request id in cancellation")
3362+
assert.equal(requestId, currentId, "unexpected request id in cancellation");
33633363
currentId = undefined;
33643364
},
33653365
isCancellationRequested() {
33663366
return requestToCancel === currentId;
33673367
}
3368-
}
3368+
};
33693369
})();
33703370
const host = createServerHost([f1, config]);
33713371
const session = createSession(host, /*typingsInstaller*/ undefined, () => {}, cancellationToken);

src/harness/unittests/typingsInstaller.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace ts.projectSystem {
5656
path: "/a/config.js",
5757
content: "export let x = 1"
5858
};
59-
const typesCache = "/cache"
59+
const typesCache = "/cache";
6060
const typesConfig = {
6161
path: typesCache + "/node_modules/@types/config/index.d.ts",
6262
content: "export let y: number;"
@@ -74,7 +74,7 @@ namespace ts.projectSystem {
7474
super(host, { typesRegistry: createTypesRegistry("config"), globalTypingsCacheLocation: typesCache });
7575
}
7676
installWorker(_requestId: number, _args: string[], _cwd: string, _cb: server.typingsInstaller.RequestCompletedAction) {
77-
assert(false, "should not be called")
77+
assert(false, "should not be called");
7878
}
7979
})();
8080
const service = createProjectService(host, { typingsInstaller: installer });

src/server/editorServices.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ namespace ts.server {
140140
getScriptKind: _ => undefined,
141141
hasMixedContent: (fileName, extraFileExtensions) => {
142142
const mixedContentExtensions = ts.map(ts.filter(extraFileExtensions, item => item.isMixedContent), item => item.extension);
143-
return forEach(mixedContentExtensions, extension => fileExtensionIs(fileName, extension))
143+
return forEach(mixedContentExtensions, extension => fileExtensionIs(fileName, extension));
144144
}
145145
};
146146

@@ -1377,7 +1377,7 @@ namespace ts.server {
13771377

13781378
// close projects that were missing in the input list
13791379
forEachKey(projectsToClose, externalProjectName => {
1380-
this.closeExternalProject(externalProjectName, /*suppressRefresh*/ true)
1380+
this.closeExternalProject(externalProjectName, /*suppressRefresh*/ true);
13811381
});
13821382

13831383
this.refreshInferredProjects();

src/server/project.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ namespace ts.server {
723723
const fileName = resolvedTypeReferenceDirective.resolvedFileName;
724724
const typeFilePath = toPath(fileName, currentDirectory, getCanonicalFileName);
725725
referencedFiles.set(typeFilePath, true);
726-
})
726+
});
727727
}
728728

729729
const allFileNames = arrayFrom(referencedFiles.keys()) as Path[];
@@ -745,7 +745,7 @@ namespace ts.server {
745745
const id = nextId;
746746
nextId++;
747747
return makeInferredProjectName(id);
748-
}
748+
};
749749
})();
750750

751751
private _isJsInferredProject = false;

src/server/scriptInfo.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace ts.server {
4848

4949
public reloadFromFile(tempFileName?: string) {
5050
if (this.svc || (tempFileName !== this.fileName)) {
51-
this.reload(this.getFileText(tempFileName))
51+
this.reload(this.getFileText(tempFileName));
5252
}
5353
else {
5454
this.setText(undefined);

src/server/server.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ namespace ts.server {
4747
if (process.env.XDG_CACHE_HOME) {
4848
return process.env.XDG_CACHE_HOME;
4949
}
50-
const usersDir = platformIsDarwin ? "Users" : "home"
50+
const usersDir = platformIsDarwin ? "Users" : "home";
5151
const homePath = (os.homedir && os.homedir()) ||
5252
process.env.HOME ||
5353
((process.env.LOGNAME || process.env.USER) && `/${usersDir}/${process.env.LOGNAME || process.env.USER}`) ||
5454
os.tmpdir();
5555
const cacheFolder = platformIsDarwin
5656
? "Library/Caches"
57-
: ".cache"
57+
: ".cache";
5858
return combinePaths(normalizeSlashes(homePath), cacheFolder);
5959
}
6060

@@ -653,7 +653,7 @@ namespace ts.server {
653653
// this drive is unsafe - return no-op watcher
654654
return { close() { } };
655655
}
656-
}
656+
};
657657
}
658658

659659
// Override sys.write because fs.writeSync is not reliable on Node 4

0 commit comments

Comments
 (0)