Skip to content

Commit 91421c8

Browse files
author
Andy Hanson
committed
Fix "semicolon" lint rule options (was not enabled)
1 parent 2fc634f commit 91421c8

19 files changed

+32
-34
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19760,7 +19760,7 @@ namespace ts {
1976019760
}
1976119761

1976219762
if (potentialNewTargetCollisions.length) {
19763-
forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope)
19763+
forEach(potentialNewTargetCollisions, checkIfNewTargetIsCapturedInEnclosingScope);
1976419764
potentialNewTargetCollisions.length = 0;
1976519765
}
1976619766

src/compiler/core.ts

Lines changed: 2 additions & 2 deletions
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/moduleNameResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ namespace ts {
958958
const result = cache && cache.get(containingDirectory);
959959
if (result) {
960960
if (traceEnabled) {
961-
trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName)
961+
trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName);
962962
}
963963
return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension } };
964964
}

src/compiler/transformers/es2015.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2581,7 +2581,7 @@ namespace ts {
25812581
if (loopOutParameters.length) {
25822582
copyOutParameters(loopOutParameters, CopyDirection.ToOutParameter, statements);
25832583
}
2584-
addRange(statements, lexicalEnvironment)
2584+
addRange(statements, lexicalEnvironment);
25852585
loopBody = createBlock(statements, /*multiline*/ true);
25862586
}
25872587

src/harness/fourslash.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ namespace FourSlash {
571571
}
572572

573573
private getGoToDefinition(): ts.DefinitionInfo[] {
574-
return this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition)
574+
return this.languageService.getDefinitionAtPosition(this.activeFile.fileName, this.currentCaretPosition);
575575
}
576576

577577
public verifyGoToType(arg0: any, endMarkerNames?: string | string[]) {
@@ -912,7 +912,7 @@ namespace FourSlash {
912912
function rangeToReferenceEntry(r: Range) {
913913
let { isWriteAccess, isDefinition } = (r.marker && r.marker.data) || { isWriteAccess: false, isDefinition: false };
914914
isWriteAccess = !!isWriteAccess; isDefinition = !!isDefinition;
915-
return { fileName: r.fileName, textSpan: { start: r.start, length: r.end - r.start }, isWriteAccess, isDefinition }
915+
return { fileName: r.fileName, textSpan: { start: r.start, length: r.end - r.start }, isWriteAccess, isDefinition };
916916
}
917917
}
918918

src/harness/harness.ts

Lines changed: 1 addition & 1 deletion
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;

src/harness/unittests/compileOnSave.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ namespace ts.projectSystem {
495495
const emitOutput = host.readFile(path + ".js");
496496
assert.equal(emitOutput, f.content + newLine, "content of emit output should be identical with the input + newline");
497497
}
498-
})
498+
});
499499

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

src/harness/unittests/printer.ts

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ namespace ts.projectSystem {
600600

601601
checkProjectActualFiles(service.configuredProjects[0], []);
602602
checkProjectActualFiles(service.inferredProjects[0], [f1.path]);
603-
})
603+
});
604604

605605
it("create configured project without file list", () => {
606606
const configFile: FileOrFolder = {
@@ -1153,7 +1153,7 @@ namespace ts.projectSystem {
11531153

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

11581158
service.openClientFile(f1.path);
11591159
service.openClientFile(f2.path, "let x: string");
@@ -1185,7 +1185,7 @@ namespace ts.projectSystem {
11851185

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

11901190
service.openClientFile(f1.path);
11911191
service.openClientFile(f2.path, "let somelongname: string");
@@ -1868,7 +1868,7 @@ namespace ts.projectSystem {
18681868

18691869
for (const f of [f2, f3]) {
18701870
const scriptInfo = projectService.getScriptInfoForNormalizedPath(server.toNormalizedPath(f.path));
1871-
assert.equal(scriptInfo.containingProjects.length, 0, `expect 0 containing projects for '${f.path}'`)
1871+
assert.equal(scriptInfo.containingProjects.length, 0, `expect 0 containing projects for '${f.path}'`);
18721872
}
18731873
});
18741874

@@ -1984,7 +1984,7 @@ namespace ts.projectSystem {
19841984
projectFileName,
19851985
rootFiles: [toExternalFile(f1.path)],
19861986
options: {}
1987-
})
1987+
});
19881988
projectService.openClientFile(f1.path, "let x = 1;\nlet y = 2;");
19891989

19901990
projectService.checkNumberOfProjects({ externalProjects: 1 });

src/harness/unittests/typingsInstaller.ts

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ namespace ts.server {
689689
const fileName = resolvedTypeReferenceDirective.resolvedFileName;
690690
const typeFilePath = toPath(fileName, currentDirectory, getCanonicalFileName);
691691
referencedFiles.set(typeFilePath, true);
692-
})
692+
});
693693
}
694694

695695
const allFileNames = arrayFrom(referencedFiles.keys()) as Path[];
@@ -711,7 +711,7 @@ namespace ts.server {
711711
const id = nextId;
712712
nextId++;
713713
return makeInferredProjectName(id);
714-
}
714+
};
715715
})();
716716

717717
private _isJsInferredProject = false;

src/server/scriptInfo.ts

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ namespace ts.server {
4646
if (process.env.XDG_CACHE_HOME) {
4747
return process.env.XDG_CACHE_HOME;
4848
}
49-
const usersDir = platformIsDarwin ? "Users" : "home"
49+
const usersDir = platformIsDarwin ? "Users" : "home";
5050
const homePath = (os.homedir && os.homedir()) ||
5151
process.env.HOME ||
5252
((process.env.LOGNAME || process.env.USER) && `/${usersDir}/${process.env.LOGNAME || process.env.USER}`) ||
5353
os.tmpdir();
5454
const cacheFolder = platformIsDarwin
5555
? "Library/Caches"
56-
: ".cache"
56+
: ".cache";
5757
return combinePaths(normalizeSlashes(homePath), cacheFolder);
5858
}
5959

src/server/typingsInstaller/nodeTypingsInstaller.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ namespace ts.server.typingsInstaller {
6161
return combinePaths(normalizeSlashes(globalTypingsCacheLocation), `node_modules/${TypesRegistryPackageName}/index.json`);
6262
}
6363

64-
type ExecSync = {
65-
(command: string, options: { cwd: string, stdio?: "ignore" }): any
66-
}
64+
type ExecSync = (command: string, options: { cwd: string, stdio?: "ignore" }) => any;
6765

6866
export class NodeTypingsInstaller extends TypingsInstaller {
6967
private readonly execSync: ExecSync;

src/services/codefixes/importFixes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ namespace ts.codefix {
33

44
type ImportCodeActionKind = "CodeChange" | "InsertingIntoExistingImport" | "NewImport";
55
interface ImportCodeAction extends CodeAction {
6-
kind: ImportCodeActionKind,
7-
moduleSpecifier?: string
6+
kind: ImportCodeActionKind;
7+
moduleSpecifier?: string;
88
}
99

1010
enum ModuleSpecifierComparison {
@@ -75,7 +75,7 @@ namespace ts.codefix {
7575
getAllActions() {
7676
let result: ImportCodeAction[] = [];
7777
for (const key in this.symbolIdToActionMap) {
78-
result = concatenate(result, this.symbolIdToActionMap[key])
78+
result = concatenate(result, this.symbolIdToActionMap[key]);
7979
}
8080
return result;
8181
}

src/services/findAllReferences.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ namespace ts.FindAllReferences {
414414
name,
415415
textSpan: createTextSpan(0, 1),
416416
displayParts: [{ text: name, kind: ScriptElementKind.keyword }]
417-
}
417+
};
418418
const references: ReferenceEntry[] = [];
419419
for (const sourceFile of sourceFiles) {
420420
cancellationToken.throwIfCancellationRequested();
@@ -610,7 +610,7 @@ namespace ts.FindAllReferences {
610610
const result: Node[] = [];
611611

612612
for (const decl of classSymbol.members.get("__constructor").declarations) {
613-
const ctrKeyword = ts.findChildOfKind(decl, ts.SyntaxKind.ConstructorKeyword, sourceFile)!
613+
const ctrKeyword = ts.findChildOfKind(decl, ts.SyntaxKind.ConstructorKeyword, sourceFile)!;
614614
Debug.assert(decl.kind === SyntaxKind.Constructor && !!ctrKeyword);
615615
result.push(ctrKeyword);
616616
}

tslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"double",
1818
"avoid-escape"
1919
],
20-
"semicolon": [true, "ignore-bound-class-methods"],
20+
"semicolon": [true, "always", "ignore-bound-class-methods"],
2121
"whitespace": [true,
2222
"check-branch",
2323
"check-decl",

0 commit comments

Comments
 (0)