From ce6b458166c1021f3a0a9f22f6bd5d0ae9c535bd Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 5 Feb 2016 09:33:38 +0100 Subject: [PATCH] more linting --- src/vs/base/node/encoding.ts | 2 +- src/vs/base/node/extfs.ts | 2 +- src/vs/base/node/flow.ts | 6 +++--- src/vs/base/node/processes.ts | 4 ++-- src/vs/base/node/proxy.ts | 1 - src/vs/base/node/request.ts | 10 +++++++--- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/vs/base/node/encoding.ts b/src/vs/base/node/encoding.ts index c55889a5256..96754fb811e 100644 --- a/src/vs/base/node/encoding.ts +++ b/src/vs/base/node/encoding.ts @@ -41,7 +41,7 @@ export function detectEncodingByBOMFromBuffer(buffer: NodeBuffer, bytesRead: num } return null; -}; +} /** * Detects the Byte Order Mark in a given file. diff --git a/src/vs/base/node/extfs.ts b/src/vs/base/node/extfs.ts index 6151276e05e..197ddef7ae1 100644 --- a/src/vs/base/node/extfs.ts +++ b/src/vs/base/node/extfs.ts @@ -32,7 +32,7 @@ export function readdir(path: string, callback: (error: Error, files: string[]) } return readdirNormalize(path, callback); -}; +} function readdirNormalize(path: string, callback: (error: Error, files: string[]) => void): void { fs.readdir(path, (error, children) => { diff --git a/src/vs/base/node/flow.ts b/src/vs/base/node/flow.ts index 88d901bb8e4..4e8d4c5245a 100644 --- a/src/vs/base/node/flow.ts +++ b/src/vs/base/node/flow.ts @@ -37,7 +37,7 @@ export function parallel(list: T[], fn: (item: T, callback: (err: Error, r } }); }); -}; +} /** * Executes the given function (fn) over the given array of items (param) in sequential order and returns the first occurred error or the result as @@ -117,7 +117,7 @@ export function loop(param: any, fn: (item: any, callback: (error: Error, res // Start looping with first element in array looper(0); } -}; +} function Sequence(sequences: { (...param: any[]): void; }[]): void { @@ -186,4 +186,4 @@ export function sequence(errorHandler: (error: Error) => void, ...sequences: Fun export function sequence(sequences: Function[]): void; export function sequence(sequences: any): void { Sequence((Array.isArray(sequences)) ? sequences : Array.prototype.slice.call(arguments)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/vs/base/node/processes.ts b/src/vs/base/node/processes.ts index 5b194467cee..ac6cb80fd2f 100644 --- a/src/vs/base/node/processes.ts +++ b/src/vs/base/node/processes.ts @@ -204,7 +204,7 @@ export abstract class AbstractProcess { result.cmdCode = data; } cc(result); - } + }; if (this.shell && Platform.isWindows) { let options: any = Objects.clone(this.options); options.windowsVerbatimArguments = true; @@ -228,7 +228,7 @@ export abstract class AbstractProcess { ]; if (quotedCommand) { if (quotedArg) { - args.push('"' + commandLine.join(' ') + '"') + args.push('"' + commandLine.join(' ') + '"'); } else if (commandLine.length > 1) { args.push('"' + commandLine[0] + '"' + ' ' + commandLine.slice(1).join(' ')); } else { diff --git a/src/vs/base/node/proxy.ts b/src/vs/base/node/proxy.ts index 3a0ab367329..5c6e5c829c4 100644 --- a/src/vs/base/node/proxy.ts +++ b/src/vs/base/node/proxy.ts @@ -7,7 +7,6 @@ import { Url, parse as parseUrl } from 'url'; import { isBoolean } from 'vs/base/common/types'; -import { assign } from 'vs/base/common/objects'; import HttpProxyAgent = require('http-proxy-agent'); import HttpsProxyAgent = require('https-proxy-agent'); diff --git a/src/vs/base/node/request.ts b/src/vs/base/node/request.ts index e62d4422925..29aa020065c 100644 --- a/src/vs/base/node/request.ts +++ b/src/vs/base/node/request.ts @@ -9,7 +9,7 @@ import { Promise, TPromise } from 'vs/base/common/winjs.base'; import { isBoolean } from 'vs/base/common/types'; import https = require('https'); import http = require('http'); -import { Url, parse as parseUrl } from 'url'; +import { parse as parseUrl } from 'url'; import { createWriteStream } from 'fs'; import { assign } from 'vs/base/common/objects'; @@ -64,8 +64,12 @@ export function request(options: IRequestOptions): TPromise { }); req.on('error', e); - if (options.timeout) req.setTimeout(options.timeout); - if (options.data) req.write(options.data); + if (options.timeout) { + req.setTimeout(options.timeout); + } + if (options.data) { + req.write(options.data); + } req.end(); },