Fix linting errors

This commit is contained in:
believer
2018-02-14 04:54:45 +01:00
parent ea50fe268c
commit 80aba5492e
2 changed files with 8 additions and 107 deletions

View File

@@ -1,31 +1,24 @@
// Type definitions for bytes v3.0.0
// Type definitions for bytes 3.0
// Project: https://github.com/visionmedia/bytes.js
// Definitions by: Zhiyuan Wang <https://github.com/danny8002>
// Rickard Laurin <https://github.com/believer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface BytesOptions {
decimalPlaces?: number,
thousandsSeparator?: string,
unitSeparator?: string,
fixedDecimals?: boolean,
unit?: string
decimalPlaces?: number;
thousandsSeparator?: string;
unitSeparator?: string;
fixedDecimals?: boolean;
unit?: string;
}
/**
* Convert the given value in bytes into a string.
*
* @param {number} value
* @param {BytesFormatOptions} [options]
* @returns {string}
*/
declare function bytes(value: number, options?: BytesOptions): string;
/**
* Parse string to an integer in bytes.
*
* @param {string} value
* @returns {number}
*/
declare function bytes(value: string): number;
@@ -35,31 +28,15 @@ declare namespace bytes {
*
* If the value is negative, it is kept as such.
* If it is a float, it is rounded.
*
* @param {number} value
* @param {BytesFormatOptions} [options]
* @returns {string}
*/
function format(value: number, options?: BytesOptions): string;
/**
* Just return the input number value.
*
* @param {number} value
* @returns {number}
*/
function parse(value: number): number;
/**
* Parse the string value into an integer in bytes.
*
* If no unit is given, it is assumed the value is in bytes.
*
* @param {string} value
* @returns {number}
*/
function parse(value: string): number;
function parse(value: string | number): number;
}
export = bytes;

View File

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