From 61ba997a57d977185eb073599c5a25fa4497f7f1 Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 7 Nov 2017 12:53:53 +0900 Subject: [PATCH 1/7] Activate unnecessarily ignored rules --- types/acorn/tslint.json | 62 +---------------------------------------- 1 file changed, 1 insertion(+), 61 deletions(-) diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json index a41bf5d19a..82b4a07c3c 100644 --- a/types/acorn/tslint.json +++ b/types/acorn/tslint.json @@ -1,79 +1,19 @@ { "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 + "typedef-whitespace": false } } From 916ddd19bd12992fdab84027990520a9a333301e Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 7 Nov 2017 12:56:09 +0900 Subject: [PATCH 2/7] cleanup ignore lint error: only-arrow-functions --- types/acorn/acorn-tests.ts | 4 ++-- types/acorn/tslint.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/types/acorn/acorn-tests.ts b/types/acorn/acorn-tests.ts index 72ca71d2f6..fb25a80831 100644 --- a/types/acorn/acorn-tests.ts +++ b/types/acorn/acorn-tests.ts @@ -41,7 +41,7 @@ class LooseParser { } } -acorn.addLooseExports(function () { +acorn.addLooseExports(() => { return { type: 'Program', sourceType: 'script', @@ -63,7 +63,7 @@ acorn.isIdentifierChar(56); acorn.getLineInfo('string', 56); -acorn.plugins['test'] = function (p: acorn.Parser, config: any) { +acorn.plugins['test'] = (p: acorn.Parser, config: any) => { } acorn.tokenizer('console.log("hello world)', {locations: true}).getToken(); diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json index 82b4a07c3c..7ae2899fe7 100644 --- a/types/acorn/tslint.json +++ b/types/acorn/tslint.json @@ -11,7 +11,6 @@ "no-unnecessary-class": false, "no-var-keyword": false, "no-trailing-whitespace": false, - "only-arrow-functions": false, "semicolon": false, "space-before-function-paren": false, "typedef-whitespace": false From c28f8bf286821bb959ed54cd5022cb19763e9140 Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 7 Nov 2017 12:59:27 +0900 Subject: [PATCH 3/7] cleanup ignore lint format errors: no-padding, no-trailing-whitespace, semicolon, space-before-function-paren, typedef-whitespace --- types/acorn/acorn-tests.ts | 13 ++++--------- types/acorn/index.d.ts | 14 ++++++-------- types/acorn/tslint.json | 7 +------ 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/types/acorn/acorn-tests.ts b/types/acorn/acorn-tests.ts index fb25a80831..9e8c3d42b9 100644 --- a/types/acorn/acorn-tests.ts +++ b/types/acorn/acorn-tests.ts @@ -32,14 +32,10 @@ const parser = new acorn.Parser({}, 'export default ""', 0); const node = new acorn.Node(parser, 1, 1); class LooseParser { - constructor(input: string, options = {}) { - - } + constructor(input: string, options = {}) {} // this means you can extend LooseParser - test() { - - } + test() {} } acorn.addLooseExports(() => { return { @@ -50,7 +46,7 @@ acorn.addLooseExports(() => { type: 'EmptyStatement' } ] - } + }; }, LooseParser, {}); acorn.parseExpressionAt('string', 2); @@ -63,8 +59,7 @@ acorn.isIdentifierChar(56); acorn.getLineInfo('string', 56); -acorn.plugins['test'] = (p: acorn.Parser, config: any) => { -} +acorn.plugins['test'] = (p: acorn.Parser, config: any) => {}; acorn.tokenizer('console.log("hello world)', {locations: true}).getToken(); acorn.tokenizer('console.log("hello world)', {locations: true})[Symbol.iterator]().next(); diff --git a/types/acorn/index.d.ts b/types/acorn/index.d.ts index ce7da6d368..15b8f1797e 100644 --- a/types/acorn/index.d.ts +++ b/types/acorn/index.d.ts @@ -181,7 +181,7 @@ declare namespace acorn { _typeof: TokenType; _void: TokenType; _delete: TokenType; - } + }; class TokContext { constructor(token: string, isExpr: boolean, preserveSpace: boolean, override: (p: Parser) => void); @@ -239,10 +239,10 @@ declare namespace acorn { function parseExpressionAt(input: string, pos?: number, options?: Options): ESTree.Expression; interface ITokenizer { - getToken() : Token, - [Symbol.iterator](): Iterator + getToken(): Token; + [Symbol.iterator](): Iterator; } - + function tokenizer(input: string, options: Options): ITokenizer; let parse_dammit: IParse | undefined; @@ -250,12 +250,10 @@ declare namespace acorn { let pluginsLoose: PluginsObject | undefined; interface ILooseParserClass { - new (input: string, options?: Options): ILooseParser + new (input: string, options?: Options): ILooseParser; } - interface ILooseParser { - - } + interface ILooseParser {} function addLooseExports(parse: IParse, parser: ILooseParserClass, plugins: PluginsObject): void; } diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json index 7ae2899fe7..e1b07b5581 100644 --- a/types/acorn/tslint.json +++ b/types/acorn/tslint.json @@ -6,13 +6,8 @@ "export-just-namespace": false, "interface-name": false, "no-empty-interface": false, - "no-padding": false, "no-reference-import": false, "no-unnecessary-class": false, - "no-var-keyword": false, - "no-trailing-whitespace": false, - "semicolon": false, - "space-before-function-paren": false, - "typedef-whitespace": false + "no-var-keyword": false } } From 4858efccf5a9dba6ca3daca5795f61fb8bc874fb Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 7 Nov 2017 13:01:31 +0900 Subject: [PATCH 4/7] cleanup ignore lint error: no-var-keyword --- types/acorn/acorn-tests.ts | 14 +++++++------- types/acorn/tslint.json | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/types/acorn/acorn-tests.ts b/types/acorn/acorn-tests.ts index 9e8c3d42b9..7574df2481 100644 --- a/types/acorn/acorn-tests.ts +++ b/types/acorn/acorn-tests.ts @@ -1,13 +1,13 @@ import acorn = require('acorn'); import * as ESTree from 'estree'; -declare var token: acorn.Token; -declare var tokens: acorn.Token[]; -declare var comment: acorn.Comment; -declare var comments: acorn.Comment[]; -declare var program: ESTree.Program; -var any: any; -var string: string; +declare let token: acorn.Token; +declare let tokens: acorn.Token[]; +declare let comment: acorn.Comment; +declare let comments: acorn.Comment[]; +declare let program: ESTree.Program; +let any: any; +let string: string; // acorn string = acorn.version; diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json index e1b07b5581..4c1016fadc 100644 --- a/types/acorn/tslint.json +++ b/types/acorn/tslint.json @@ -7,7 +7,6 @@ "interface-name": false, "no-empty-interface": false, "no-reference-import": false, - "no-unnecessary-class": false, - "no-var-keyword": false + "no-unnecessary-class": false } } From 62798c507dae098edfeb0da67f9d7a07fef723f3 Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 7 Nov 2017 13:05:12 +0900 Subject: [PATCH 5/7] cleanup ignore lint error: no-reference-import --- types/acorn/index.d.ts | 2 -- types/acorn/tslint.json | 1 - 2 files changed, 3 deletions(-) diff --git a/types/acorn/index.d.ts b/types/acorn/index.d.ts index 15b8f1797e..5d4babd5c4 100644 --- a/types/acorn/index.d.ts +++ b/types/acorn/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: RReverser , e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - export as namespace acorn; export = acorn; import * as ESTree from 'estree'; diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json index 4c1016fadc..692404bfa1 100644 --- a/types/acorn/tslint.json +++ b/types/acorn/tslint.json @@ -6,7 +6,6 @@ "export-just-namespace": false, "interface-name": false, "no-empty-interface": false, - "no-reference-import": false, "no-unnecessary-class": false } } From 6ee0e959ce87b34db7d21e2351fdf6a53fde78f1 Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 7 Nov 2017 13:06:38 +0900 Subject: [PATCH 6/7] cleanup ignore lint error: dt-header --- types/acorn/index.d.ts | 2 +- types/acorn/tslint.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/types/acorn/index.d.ts b/types/acorn/index.d.ts index 5d4babd5c4..c82c24fa23 100644 --- a/types/acorn/index.d.ts +++ b/types/acorn/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Acorn v4.0.3 +// Type definitions for Acorn 4.0 // Project: https://github.com/marijnh/acorn // Definitions by: RReverser , e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json index 692404bfa1..9ca4ce24d0 100644 --- a/types/acorn/tslint.json +++ b/types/acorn/tslint.json @@ -2,7 +2,6 @@ "extends": "dtslint/dt.json", "rules": { "callable-types": false, - "dt-header": false, "export-just-namespace": false, "interface-name": false, "no-empty-interface": false, From dc75da079b4524d5e8ec3afc6d540604b873b395 Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 7 Nov 2017 13:11:07 +0900 Subject: [PATCH 7/7] cleanup ignore lint error: callable-types --- types/acorn/index.d.ts | 5 ++--- types/acorn/tslint.json | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/types/acorn/index.d.ts b/types/acorn/index.d.ts index c82c24fa23..5d02bd716c 100644 --- a/types/acorn/index.d.ts +++ b/types/acorn/index.d.ts @@ -228,9 +228,8 @@ declare namespace acorn { const version: string; - interface IParse { - (input: string, options?: Options): ESTree.Program; - } + // TODO: rename type. + type IParse = (input: string, options?: Options) => ESTree.Program; const parse: IParse; diff --git a/types/acorn/tslint.json b/types/acorn/tslint.json index 9ca4ce24d0..2d05b8507c 100644 --- a/types/acorn/tslint.json +++ b/types/acorn/tslint.json @@ -1,7 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "callable-types": false, "export-just-namespace": false, "interface-name": false, "no-empty-interface": false,