diff --git a/BuildServer/lib/builder.ts b/BuildServer/lib/builder.ts index deae832..751612b 100644 --- a/BuildServer/lib/builder.ts +++ b/BuildServer/lib/builder.ts @@ -57,12 +57,12 @@ const notifyStatus = (settings: Settings, options, notifyStatusCallback) => { }); }; -const wrapGitLoader = (skipGitLoader) => { +const wrapGitLoader: (skipGitLoader: boolean) => typeof gitLoader = (skipGitLoader) => { if (!skipGitLoader) { return gitLoader; } - return (gitLoaderOptions, gitLoaderCallback) => process.nextTick(gitLoaderCallback); + return (_gitLoaderOptions, gitLoaderCallback) => process.nextTick(gitLoaderCallback); }; export const build = (settings: Settings, options, buildCallback) => { diff --git a/BuildServer/lib/git/copy.ts b/BuildServer/lib/git/copy.ts index aca540c..9cf393d 100644 --- a/BuildServer/lib/git/copy.ts +++ b/BuildServer/lib/git/copy.ts @@ -39,7 +39,7 @@ const gitToFsCopier = new Copier({ return callback(null, targetSubdir); }); }, - finalizeTargetTree: (targetSubdir, callback) => callback(), + finalizeTargetTree: (_targetSubdir, callback) => callback(), walkSourceTree: (tree) => { const emitter = new EventEmitter(); diff --git a/BuildServer/lib/index.ts b/BuildServer/lib/index.ts index fbd7051..a16c52d 100644 --- a/BuildServer/lib/index.ts +++ b/BuildServer/lib/index.ts @@ -11,7 +11,6 @@ import * as express from "express"; import { createServer } from "http"; import * as methodOverride from "method-override"; import * as morgan from "morgan"; -import { join } from "path"; import * as serveFavicon from "serve-favicon"; import * as serveStatic from "serve-static"; @@ -42,7 +41,7 @@ const run = (settings: Settings) => { app.route("/").get(routes.index); app.route("/github/postreceive") .post(routes.postreceive) - .get((req, res) => res.send("Only automated POST requests are allowed for postreceive route")); + .get((_req, res) => res.send("Only automated POST requests are allowed for postreceive route")); app.route("/manual") .get(routes.manual.get) diff --git a/BuildServer/lib/mail-sender.ts b/BuildServer/lib/mail-sender.ts index 2249d0d..05ba317 100644 --- a/BuildServer/lib/mail-sender.ts +++ b/BuildServer/lib/mail-sender.ts @@ -1,3 +1,7 @@ "use strict"; -export const send = (message, callback) => process.nextTick(callback); +export const send = (message, callback) => { + console.log("Mail sender is not implemented"); + console.log(message.title); + process.nextTick(callback); +}; diff --git a/BuildServer/lib/routes/manual.ts b/BuildServer/lib/routes/manual.ts index 7391572..1e723bf 100644 --- a/BuildServer/lib/routes/manual.ts +++ b/BuildServer/lib/routes/manual.ts @@ -1,12 +1,11 @@ "use strict"; import * as express from "express"; -import * as _ from "underscore"; import { build } from "../builder"; import { getSettings } from "../settings-wrapper"; -export const get: express.RequestHandler = (req, res) => res.render("manual"); +export const get: express.RequestHandler = (_req, res) => res.render("manual"); export const post: express.RequestHandler = (req, res) => { const settings = getSettings(req.app); diff --git a/BuildServer/lib/routes/postreceive.ts b/BuildServer/lib/routes/postreceive.ts index 3d87b13..bf743ce 100644 --- a/BuildServer/lib/routes/postreceive.ts +++ b/BuildServer/lib/routes/postreceive.ts @@ -66,12 +66,6 @@ const processPullRequest = (req: express.Request, res: express.Response, payload headRepoOptions, pullRequestNumber, }; - const masterOptions = { - action, - baseRepoOptions, - headRepoOptions: baseRepoOptions, - pullRequestNumber, - }; console.log(`Got pull request ${action} event, ` + `from ${getBranchDescription(headRepoOptions)} (${headRepoOptions.rev}) to ${getBranchDescription(baseRepoOptions)}`); diff --git a/BuildServer/lib/routes/status.ts b/BuildServer/lib/routes/status.ts index 9cdf802..a19b438 100644 --- a/BuildServer/lib/routes/status.ts +++ b/BuildServer/lib/routes/status.ts @@ -1,7 +1,6 @@ "use strict"; import * as express from "express"; -import * as _ from "underscore"; import { parse } from "url"; import { getSettings } from "../settings-wrapper"; diff --git a/BuildServer/lib/status-processor.ts b/BuildServer/lib/status-processor.ts index b490c3d..91bc24b 100644 --- a/BuildServer/lib/status-processor.ts +++ b/BuildServer/lib/status-processor.ts @@ -2,7 +2,6 @@ import { exists, readFile } from "fs"; import { join } from "path"; -import * as _ from "underscore"; import { loadReport } from "./report-processor"; import { Settings } from "./types"; diff --git a/BuildServer/lib/task-processor.ts b/BuildServer/lib/task-processor.ts index 91b005f..c817ead 100644 --- a/BuildServer/lib/task-processor.ts +++ b/BuildServer/lib/task-processor.ts @@ -1,7 +1,5 @@ "use strict"; -import * as _ from "underscore"; - import tasks from "./tasks"; import { MessagesRoot, ProcessTaskContext, Settings, TaskInfo, TaskProcessor, TaskProcessorCallback, TaskProcessorCore } from "./types"; diff --git a/BuildServer/lib/tasks/cleanupafterdotnetbuild.ts b/BuildServer/lib/tasks/cleanupafterdotnetbuild.ts index 79fb82d..6d93699 100644 --- a/BuildServer/lib/tasks/cleanupafterdotnetbuild.ts +++ b/BuildServer/lib/tasks/cleanupafterdotnetbuild.ts @@ -4,7 +4,7 @@ import * as glob from "glob"; import { Task } from "../types"; -export default ((params, processor) => () => glob("**/obj/{Debug,Release}/*.{dll,pdb,xml}", { +export default ((_params, processor) => () => glob("**/obj/{Debug,Release}/*.{dll,pdb,xml}", { cwd: processor.context.exported, dot: true, }, (err, files) => { diff --git a/BuildServer/lib/tasks/dotnetbuilderwrapper.ts b/BuildServer/lib/tasks/dotnetbuilderwrapper.ts index fc9763a..6d11b12 100644 --- a/BuildServer/lib/tasks/dotnetbuilderwrapper.ts +++ b/BuildServer/lib/tasks/dotnetbuilderwrapper.ts @@ -31,7 +31,7 @@ const wrapBuilder = (builder: ChildProcess, input: string, onExit: (code: number }); }); - const builderPromise = new Promise((resolve, reject) => { + const builderPromise = new Promise((resolve) => { builder.stdin.write(input); builder.stdin.end(); builder.on("exit", resolve); diff --git a/BuildServer/lib/tasks/dotnetcompile.ts b/BuildServer/lib/tasks/dotnetcompile.ts index faac647..3461226 100644 --- a/BuildServer/lib/tasks/dotnetcompile.ts +++ b/BuildServer/lib/tasks/dotnetcompile.ts @@ -1,9 +1,8 @@ "use strict"; import { join } from "path"; -import * as _ from "underscore"; -import { Settings, Task } from "../types"; +import { Task } from "../types"; import dotnetbuilderwrapper from "./dotnetbuilderwrapper"; export default ((params, processor) => { diff --git a/BuildServer/lib/tasks/dotnetnugetpack.ts b/BuildServer/lib/tasks/dotnetnugetpack.ts index 05179b0..6ec0071 100644 --- a/BuildServer/lib/tasks/dotnetnugetpack.ts +++ b/BuildServer/lib/tasks/dotnetnugetpack.ts @@ -1,7 +1,5 @@ "use strict"; -import * as _ from "underscore"; - import { Task } from "../types"; import dotnetnugetprocessinternal from "./dotnetnugetprocessinternal"; diff --git a/BuildServer/lib/tasks/dotnetnugetpush.ts b/BuildServer/lib/tasks/dotnetnugetpush.ts index 226c895..fb1d964 100644 --- a/BuildServer/lib/tasks/dotnetnugetpush.ts +++ b/BuildServer/lib/tasks/dotnetnugetpush.ts @@ -1,7 +1,5 @@ "use strict"; -import * as _ from "underscore"; - import { Task } from "../types"; import dotnetnugetprocessinternal from "./dotnetnugetprocessinternal"; diff --git a/BuildServer/lib/tasks/dotnetrewrite.ts b/BuildServer/lib/tasks/dotnetrewrite.ts index bae6f19..3775ac3 100644 --- a/BuildServer/lib/tasks/dotnetrewrite.ts +++ b/BuildServer/lib/tasks/dotnetrewrite.ts @@ -5,7 +5,7 @@ import { readFile, writeFile } from "fs"; import * as glob from "glob"; import { join } from "path"; -import { Settings, Task, TaskProcessor } from "../types"; +import { Task, TaskProcessor } from "../types"; const flagDoneName = "dotnetrewriterDone"; @@ -17,7 +17,7 @@ const processAssemblyInfo = (params, processor: TaskProcessor, appendInformation const publicKey = processor.settings.codeSigningPublicKey; const pattern = /InternalsVisibleTo\s*\(\s*"([\w.]+)"\s*\)/g; - const replacer = (match, p1) => `InternalsVisibleTo("${p1},PublicKey=${publicKey}")`; + const replacer = (_match, p1) => `InternalsVisibleTo("${p1},PublicKey=${publicKey}")`; return content.replace(pattern, replacer); }; diff --git a/BuildServer/lib/tasks/eslintbrowser.ts b/BuildServer/lib/tasks/eslintbrowser.ts index 56612af..211ee0a 100644 --- a/BuildServer/lib/tasks/eslintbrowser.ts +++ b/BuildServer/lib/tasks/eslintbrowser.ts @@ -3,7 +3,7 @@ import { CLIEngine } from "eslint"; import { join } from "path"; -import { Settings, Task } from "../types"; +import { Task } from "../types"; const errorSeverity = 2; diff --git a/BuildServer/lib/tasks/noop.ts b/BuildServer/lib/tasks/noop.ts index 6c5eaa1..899dd24 100644 --- a/BuildServer/lib/tasks/noop.ts +++ b/BuildServer/lib/tasks/noop.ts @@ -2,4 +2,4 @@ import { Task } from "../types"; -export default ((params, processor) => processor.done()) as Task; +export default ((_params, processor) => processor.done()) as Task; diff --git a/BuildServer/tsconfig.json b/BuildServer/tsconfig.json index c430d98..e445ecc 100644 --- a/BuildServer/tsconfig.json +++ b/BuildServer/tsconfig.json @@ -2,6 +2,13 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "alwaysStrict": true, + "forceConsistentCasingInFileNames": true, + "noEmitOnError": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "strictNullChecks": true, "typeRoots": [ "node_modules/@types" diff --git a/BuildServer/tslint.json b/BuildServer/tslint.json index 0af5928..b26eb18 100644 --- a/BuildServer/tslint.json +++ b/BuildServer/tslint.json @@ -5,6 +5,7 @@ ], "rules": { "no-console": false, - "max-line-length": false + "max-line-length": false, + "variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore"] } } \ No newline at end of file