diff --git a/types/rc/index.d.ts b/types/rc/index.d.ts index 3ab9cc3a26..07bc827079 100644 --- a/types/rc/index.d.ts +++ b/types/rc/index.d.ts @@ -1,22 +1,24 @@ -// Type definitions for rc +// Type definitions for rc 1.1 // Project: https://github.com/dominictarr/rc // Definitions by: Daniel Rosenwasser +// BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare function rc( - name: string, - defaults?: any, + name: string, + defaults?: { [key: string]: any }, /** * Parsed argv object. For example, if args is `--foo bar`, then this value should be `{foo: 'bar'}` * If `argv` is `null` or `undefined`, then `rc`'s default parser will parse `process.argv`. */ - argv?: {} | null, + argv?: { [key: string]: any } | null, /** * Custom config file parser. * This function will be passed the string contents of each * discovered configuration file should return a parsed object dictionary. */ - parse?: ((content: string) => any) | null -): any; + parse?: ((content: string) => { [key: string]: any }) | null +): { [key: string]: any }; export = rc; diff --git a/types/rc/rc-tests.ts b/types/rc/rc-tests.ts index 9574bec339..81522ccd59 100644 --- a/types/rc/rc-tests.ts +++ b/types/rc/rc-tests.ts @@ -1,15 +1,15 @@ -import rc = require("rc") +import rc = require('rc'); -let confA = rc("appname1", { +const confA = rc('appname1', { port: 2468, views: { - engine: "jade" - } + engine: 'jade', + }, }); //////////////////// -let appCfg = rc("appname2", {}, null, function parse(s) { +const appCfg = rc('appname2', {}, null, function parse(s) { return JSON.parse(s.toLowerCase()); }); @@ -19,15 +19,18 @@ appCfg.config; //////////////////// -let customArgv = rc("appname3", { - option: true -}, -{ - option: false, - envOption: 24, - argv: { - remain: [], - cooked: ['--no-option', '--envOption', '24'], - original: ['--no-option', '--envOption=24'] +const customArgv = rc( + 'appname3', + { + option: true, + }, + { + option: false, + envOption: 24, + argv: { + remain: [], + cooked: ['--no-option', '--envOption', '24'], + original: ['--no-option', '--envOption=24'], + }, } -}); +); diff --git a/types/rc/tslint.json b/types/rc/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/rc/tslint.json +++ b/types/rc/tslint.json @@ -1,79 +1,3 @@ { - "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" }