Code cleanup

dependabot/npm_and_yarn/BuildServer/eslint-7.2.0
Inga 🏳‍🌈 7 years ago
parent 554080d193
commit 58c17fd975
  1. 4
      BuildServer/lib/builder.ts
  2. 2
      BuildServer/lib/git/copy.ts
  3. 3
      BuildServer/lib/index.ts
  4. 6
      BuildServer/lib/mail-sender.ts
  5. 3
      BuildServer/lib/routes/manual.ts
  6. 6
      BuildServer/lib/routes/postreceive.ts
  7. 1
      BuildServer/lib/routes/status.ts
  8. 1
      BuildServer/lib/status-processor.ts
  9. 2
      BuildServer/lib/task-processor.ts
  10. 2
      BuildServer/lib/tasks/cleanupafterdotnetbuild.ts
  11. 2
      BuildServer/lib/tasks/dotnetbuilderwrapper.ts
  12. 3
      BuildServer/lib/tasks/dotnetcompile.ts
  13. 2
      BuildServer/lib/tasks/dotnetnugetpack.ts
  14. 2
      BuildServer/lib/tasks/dotnetnugetpush.ts
  15. 4
      BuildServer/lib/tasks/dotnetrewrite.ts
  16. 2
      BuildServer/lib/tasks/eslintbrowser.ts
  17. 2
      BuildServer/lib/tasks/noop.ts
  18. 7
      BuildServer/tsconfig.json
  19. 3
      BuildServer/tslint.json

@ -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) => {

@ -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();

@ -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)

@ -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);
};

@ -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);

@ -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)}`);

@ -1,7 +1,6 @@
"use strict";
import * as express from "express";
import * as _ from "underscore";
import { parse } from "url";
import { getSettings } from "../settings-wrapper";

@ -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";

@ -1,7 +1,5 @@
"use strict";
import * as _ from "underscore";
import tasks from "./tasks";
import { MessagesRoot, ProcessTaskContext, Settings, TaskInfo, TaskProcessor, TaskProcessorCallback, TaskProcessorCore } from "./types";

@ -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) => {

@ -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);

@ -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) => {

@ -1,7 +1,5 @@
"use strict";
import * as _ from "underscore";
import { Task } from "../types";
import dotnetnugetprocessinternal from "./dotnetnugetprocessinternal";

@ -1,7 +1,5 @@
"use strict";
import * as _ from "underscore";
import { Task } from "../types";
import dotnetnugetprocessinternal from "./dotnetnugetprocessinternal";

@ -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);
};

@ -3,7 +3,7 @@
import { CLIEngine } from "eslint";
import { join } from "path";
import { Settings, Task } from "../types";
import { Task } from "../types";
const errorSeverity = 2;

@ -2,4 +2,4 @@
import { Task } from "../types";
export default ((params, processor) => processor.done()) as Task;
export default ((_params, processor) => processor.done()) as Task;

@ -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"

@ -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"]
}
}
Loading…
Cancel
Save