diff --git a/.eslintrc b/.eslintrc index 9d473154a84..769447e1295 100644 --- a/.eslintrc +++ b/.eslintrc @@ -46,7 +46,7 @@ "@typescript-eslint/prefer-interface": "off", "@typescript-eslint/prefer-namespace-keyword": "off", "semi": "off", - "@typescript-eslint/semi": "off", + "@typescript-eslint/semi": "error", "@typescript-eslint/type-annotation-spacing": "off", "@typescript-eslint/unified-signatures": "off", diff --git a/scripts/authors.ts b/scripts/authors.ts index f92511ed6ef..c05d7106913 100644 --- a/scripts/authors.ts +++ b/scripts/authors.ts @@ -71,7 +71,7 @@ function getKnownAuthorMaps() { } function deduplicate(array: T[]): T[] { - let result: T[] = [] + let result: T[] = []; if (array) { for (const item of array) { if (result.indexOf(item) < 0) { diff --git a/scripts/buildProtocol.ts b/scripts/buildProtocol.ts index 006608323cf..08dd56b5657 100644 --- a/scripts/buildProtocol.ts +++ b/scripts/buildProtocol.ts @@ -28,11 +28,11 @@ class DeclarationsWalker { : ""; if (walker.removedTypes) { text += "\ndeclare namespace ts {\n"; - text += " // these types are empty stubs for types from services and should not be used directly\n" + text += " // these types are empty stubs for types from services and should not be used directly\n"; for (const type of walker.removedTypes) { text += ` export type ${type.symbol!.name} = never;\n`; } - text += "}" + text += "}"; } return text; } @@ -142,7 +142,7 @@ function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptSer getCanonicalFileName: function (f) { return f; }, getCurrentDirectory: function() { return '.'; }, getNewLine: function() { return "\r\n"; } - } + }; const diags = emitResult.diagnostics.map(d => ts.formatDiagnostic(d, diagHost)).join("\r\n"); throw new Error(`Declaration file for protocol.ts is not generated:\r\n${diags}`); } @@ -161,7 +161,7 @@ function writeProtocolFile(outputFile: string, protocolTs: string, typeScriptSer return ts.createSourceFile(fileName, protocolDts, options.target); } return originalGetSourceFile.apply(host, [fileName]); - } + }; const rootFiles = includeTypeScriptServices ? [protocolFileName, typeScriptServicesDts] : [protocolFileName]; return ts.createProgram(rootFiles, options, host); } diff --git a/scripts/configurePrerelease.ts b/scripts/configurePrerelease.ts index 5e3ac5653d7..68befbb8bcd 100644 --- a/scripts/configurePrerelease.ts +++ b/scripts/configurePrerelease.ts @@ -48,7 +48,7 @@ function main(): void { // Finally write the changes to disk. // Modify the package.json structure packageJsonValue.version = `${majorMinor}.${prereleasePatch}`; - writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4)) + writeFileSync(packageJsonFilePath, JSON.stringify(packageJsonValue, /*replacer:*/ undefined, /*space:*/ 4)); writeFileSync(tsFilePath, modifiedTsFileContents); } diff --git a/scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.ts b/scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.ts index 1ae3725fff2..e984a72a2d0 100644 --- a/scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.ts +++ b/scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.ts @@ -11,16 +11,16 @@ declare var process: { argv: string[]; env: Map; exit(exitCode?: number): void; -} +}; main(); function main() { const [, progName, tscRoot, definitelyTypedRoot] = process.argv; if (process.argv.length !== 4) { if (process.argv.length < 2) { - throw "Expected at least 2 argv elements." + throw "Expected at least 2 argv elements."; } - console.log("Usage:") + console.log("Usage:"); console.log(` node ${path.relative(__dirname, progName)} [TypeScript Repo Root] [DefinitelyTyped Repo Root]`); return; } @@ -52,7 +52,7 @@ function importDefinitelyTypedTest(tscPath: string, rwcTestPath: string, testCas cmd += " @" + responseFile; } - let testDirectoryName = testCaseName + "_" + Math.floor((Math.random() * 10000) + 1); + let testDirectoryName = testCaseName + "_" + Math.floor((Math.random() * 10000) + 1); let testDirectoryPath = path.join(process.env["temp"], testDirectoryName); if (fs.existsSync(testDirectoryPath)) { throw new Error("Could not create test directory"); @@ -156,6 +156,6 @@ function importDefinitelyTypedTests(tscPath: string, rwcTestPath: string, defini } } }); - }) + }); }); -} \ No newline at end of file +} diff --git a/scripts/open-cherry-pick-pr.ts b/scripts/open-cherry-pick-pr.ts index 8bdeb05e4a2..eed8f33d374 100644 --- a/scripts/open-cherry-pick-pr.ts +++ b/scripts/open-cherry-pick-pr.ts @@ -34,7 +34,7 @@ async function main() { logText = `Cherry-pick PR #${process.env.SOURCE_ISSUE} into ${process.env.TARGET_BRANCH} Component commits: -${logText.trim()}` +${logText.trim()}`; const logpath = path.join(__dirname, "../", "logmessage.txt"); runSequence([ ["git", ["checkout", "-b", "temp-branch"]], @@ -51,7 +51,7 @@ ${logText.trim()}` runSequence([ ["git", ["checkout", process.env.TARGET_BRANCH]], // checkout the target branch ["git", ["checkout", "-b", branchName]], // create a new branch - ["git", ["cherry-pick", squashSha.trim()]], // + ["git", ["cherry-pick", squashSha.trim()]], // ["git", ["remote", "add", "fork", remoteUrl]], // Add the remote fork ["git", ["push", "--set-upstream", "fork", branchName, "-f"]] // push the branch ]); @@ -102,4 +102,4 @@ main().catch(async e => { body: `Hey @${process.env.REQUESTING_USER}, I couldn't open a PR with the cherry-pick. ([You can check the log here](https://typescript.visualstudio.com/TypeScript/_build/index?buildId=${process.env.BUILD_BUILDID}&_a=summary)). You may need to squash and pick this PR into ${process.env.TARGET_BRANCH} manually.` }); } -}); \ No newline at end of file +}); diff --git a/scripts/processDiagnosticMessages.ts b/scripts/processDiagnosticMessages.ts index f296a62de78..cc93117f4d0 100644 --- a/scripts/processDiagnosticMessages.ts +++ b/scripts/processDiagnosticMessages.ts @@ -20,7 +20,7 @@ function main(): void { function writeFile(fileName: string, contents: string) { fs.writeFile(path.join(path.dirname(inputFilePath), fileName), contents, { encoding: "utf-8" }, err => { if (err) throw err; - }) + }); } const inputFilePath = process.argv[2].replace(/\\/g, "/"); diff --git a/src/typingsInstaller/nodeTypingsInstaller.ts b/src/typingsInstaller/nodeTypingsInstaller.ts index 27be0107d8f..56b490e709d 100644 --- a/src/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/typingsInstaller/nodeTypingsInstaller.ts @@ -15,7 +15,7 @@ namespace ts.server.typingsInstaller { isEnabled = () => { return typeof this.logFile === "string"; - } + }; writeLine = (text: string) => { if (typeof this.logFile !== "string") return; @@ -25,7 +25,7 @@ namespace ts.server.typingsInstaller { catch (e) { this.logFile = undefined; } - } + }; } /** Used if `--npmLocation` is not passed. */