mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Merge pull request #21300 from segayuu/bluebird-retry-cleanup-ignore-lint-errors
[Bluebird Retry] cleanup ignore lint errors
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import Promise = require('bluebird');
|
||||
import retry = require('bluebird-retry');
|
||||
|
||||
function promiseSuccess(text:string) {
|
||||
function promiseSuccess(text: string) {
|
||||
return Promise.resolve(text);
|
||||
};
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
let count = 0;
|
||||
function myfunc() {
|
||||
console.log('myfunc called ' + (++count) + ' times');
|
||||
console.log(`myfunc called ${++count} times`);
|
||||
if (count < 3) {
|
||||
throw new Error('i fail the first two times');
|
||||
} else {
|
||||
@@ -16,18 +16,17 @@ function myfunc() {
|
||||
}
|
||||
|
||||
retry(myfunc)
|
||||
.done(function(result) { console.log(result); } );
|
||||
.done(result => { console.log(result); });
|
||||
|
||||
|
||||
//Options example
|
||||
// Options example
|
||||
function logFail() {
|
||||
console.log(new Date().toISOString());
|
||||
throw new Error('bail');
|
||||
}
|
||||
|
||||
var options:retry.Options = {
|
||||
const options: retry.Options = {
|
||||
max_tries: 4,
|
||||
interval: 500
|
||||
};
|
||||
|
||||
retry(logFail, options);
|
||||
retry(logFail, options);
|
||||
|
||||
7
types/bluebird-retry/index.d.ts
vendored
7
types/bluebird-retry/index.d.ts
vendored
@@ -1,17 +1,15 @@
|
||||
// Type definitions for bluebird-retry
|
||||
// Type definitions for bluebird-retry 0.11
|
||||
// Project: https://github.com/jut-io/bluebird-retry
|
||||
// Definitions by: Pascal Vomhoff <https://github.com/pvomhoff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
|
||||
import Promise = require('bluebird');
|
||||
|
||||
declare function retry<T>(func: (param: T) => void, options?: retry.Options): Promise<T>;
|
||||
|
||||
declare namespace retry {
|
||||
export interface Options {
|
||||
interface Options {
|
||||
interval?: number;
|
||||
backoff?: number;
|
||||
max_interval?: number;
|
||||
@@ -22,7 +20,6 @@ declare namespace retry {
|
||||
context?: any;
|
||||
args?: any;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export = retry;
|
||||
|
||||
@@ -1,79 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
Reference in New Issue
Block a user