From 4af081994e1cbf1ed0eb952f3c4c63c9ef83b92b Mon Sep 17 00:00:00 2001 From: Dmitri1337 Date: Wed, 16 Jan 2019 18:40:10 +0200 Subject: [PATCH] Fixed "typedef-whitesapce" lint rule --- types/async/index.d.ts | 20 ++++++++++---------- types/async/test/index.ts | 24 ++++++++++++------------ types/async/tslint.json | 1 - 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 6260eb9344..5b7797bde0 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -93,7 +93,7 @@ export interface AsyncPriorityQueue { export interface AsyncCargo { length(): number; payload?: number; - push(task: any, callback? : Function): void; + push(task: any, callback?: Function): void; saturated(): void; empty(): void; drain(): void; @@ -172,9 +172,9 @@ export function whilst(test: () => boolean, fn: AsyncVoidFunction, export function doWhilst(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; export function until(test: () => boolean, fn: AsyncVoidFunction, callback: ErrorCallback): void; export function doUntil(fn: AsyncFunctionEx, test: (...results: T[]) => boolean, callback: ErrorCallback): void; -export function during(test: (testCallback : AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; +export function during(test: (testCallback: AsyncBooleanResultCallback) => void, fn: AsyncVoidFunction, callback: ErrorCallback): void; export function doDuring(fn: AsyncVoidFunction, test: (testCallback: AsyncBooleanResultCallback) => void, callback: ErrorCallback): void; -export function forever(next: (next : ErrorCallback) => void, errBack: ErrorCallback) : void; +export function forever(next: (next: ErrorCallback) => void, errBack: ErrorCallback): void; export function waterfall(tasks: Function[], callback?: AsyncResultCallback): void; export function compose(...fns: Function[]): Function; export function seq(...fns: Function[]): Function; @@ -183,18 +183,18 @@ export function applyEachSeries(fns: Function[], ...argsAndCallback: any[]): voi export function queue(worker: AsyncWorker, concurrency?: number): AsyncQueue; export function queue(worker: AsyncResultIterator, concurrency?: number): AsyncQueue; export function priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; -export function cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; +export function cargo(worker: (tasks: any[], callback: ErrorCallback) => void, payload?: number): AsyncCargo; export function auto, E = Error>(tasks: AsyncAutoTasks, concurrency?: number, callback?: AsyncResultCallback): void; export function auto, E = Error>(tasks: AsyncAutoTasks, callback?: AsyncResultCallback): void; export function autoInject(tasks: any, callback?: AsyncResultCallback): void; -export function retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; -export function retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; +export function retry(opts: number, task: (callback: AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; +export function retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; export function retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; export function apply(fn: Function, ...args: any[]): AsyncFunction; export function nextTick(callback: Function, ...args: any[]): void; export const setImmediate: typeof nextTick; -export function reflect(fn: AsyncFunction) : (callback: (err: null, result: {error?: E, value?: T}) => void) => void; +export function reflect(fn: AsyncFunction): (callback: (err: null, result: {error?: E, value?: T}) => void) => void; export function reflectAll(tasks: Array>): Array<(callback: (err: null, result: {error?: E, value?: T}) => void) => void>; export function timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; @@ -207,10 +207,10 @@ export function timesLimit(n: number, limit: number, iterator: Asy export function transform(arr: T[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; export function transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: number, callback: (error?: E) => void) => void, callback?: AsyncResultArrayCallback): void; -export function transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; -export function transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; +export function transform(arr: {[key: string]: T}, iteratee: (acc: {[key: string]: R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; +export function transform(arr: {[key: string]: T}, acc: {[key: string]: R}, iteratee: (acc: {[key: string]: R}, item: T, key: string, callback: (error?: E) => void) => void, callback?: AsyncResultObjectCallback): void; -export function race(tasks: Array>, callback: AsyncResultCallback) : void; +export function race(tasks: Array>, callback: AsyncResultCallback): void; // Utils export function memoize(fn: Function, hasher?: Function): Function; diff --git a/types/async/test/index.ts b/types/async/test/index.ts index 5117199024..f2dd5bb2aa 100644 --- a/types/async/test/index.ts +++ b/types/async/test/index.ts @@ -307,11 +307,11 @@ q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (err) { console.log('finished processing bar'); }); -var qLength : number = q.length(); -var qStarted : boolean = q.started; -var qPaused : boolean = q.paused; -var qProcessingCount : number = q.running(); -var qIsIdle : boolean = q.idle(); +var qLength: number = q.length(); +var qStarted: boolean = q.started; +var qPaused: boolean = q.paused; +var qProcessingCount: number = q.running(); +var qIsIdle: boolean = q.idle(); q.saturated = function() { console.log('queue is saturated.'); @@ -367,7 +367,7 @@ var aq = async.queue(function (level: number, callback: (error?: callback(undefined, level + 1); }); -aq.push(1, function (err : Error, newLevel : number) { +aq.push(1, function (err: Error, newLevel: number) { console.log('finished processing bar' + newLevel); }); @@ -738,32 +738,32 @@ async.some({ // timeout -function myFunction1(foo : any, callback: (err?: Error, result?: any) => void ) : void { +function myFunction1(foo: any, callback: (err?: Error, result?: any) => void ): void { console.log(`async.timeout 1 ${foo}`); return callback(undefined, foo); } var wrapped1 = async.timeout(myFunction1, 1000); -wrapped1({ bar: 'bar' }, function(err : Error, data : any) { +wrapped1({ bar: 'bar' }, function(err: Error, data: any) { console.log(`async.timeout 1 end ${data}`); }); -function myFunction2(callback: (err?: Error, result?: any) => void ) : void { +function myFunction2(callback: (err?: Error, result?: any) => void ): void { console.log(`async.timeout 2`); return callback(undefined, { bar: 'bar' }); } var wrapped2 = async.timeout(myFunction2, 1000); -wrapped2( function(err : Error, data : any) { +wrapped2( function(err: Error, data: any) { console.log(`async.timeout 2 end ${data}`); }); -function myFunction3(callback: (err?: Error, result?: any) => void ) : void { +function myFunction3(callback: (err?: Error, result?: any) => void ): void { console.log(`async.timeout 3`); return callback(undefined, { bar: 'bar' }); } var wrapped3 = async.timeout(myFunction3, 1000, { bar: 'bar' }); -wrapped3( function(err : Error, data : any) { +wrapped3( function(err: Error, data: any) { console.log(`async.timeout 3 end ${data}`); }); diff --git a/types/async/tslint.json b/types/async/tslint.json index 220166f178..1da4c92ed9 100644 --- a/types/async/tslint.json +++ b/types/async/tslint.json @@ -20,7 +20,6 @@ "prefer-template": false, // HAS ISSUES "space-before-function-paren": false, // HAS ISSUES "space-within-parens": false, // HAS ISSUES - "typedef-whitespace": false, // HAS ISSUES "unified-signatures": false // HAS ISSUES } }