From 5bf5228d712d2ec11a32017df1db6810cfca5ab6 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 14 Apr 2017 09:15:37 -0700 Subject: [PATCH] Fix additional lint errors from the new dtslint (#15865) --- README.md | 2 +- types/algebra.js/index.d.ts | 2 +- types/csvtojson/index.d.ts | 2 +- types/ej.web.all/tslint.json | 10 ---------- types/mithril-global/tslint.json | 5 +++-- types/react-ga/index.d.ts | 2 +- types/react-native/index.d.ts | 2 -- types/react-router-redux/v4/index.d.ts | 8 ++++---- types/react-router-redux/v4/tslint.json | 7 +------ types/react-router/v3/lib/match.d.ts | 6 +++--- 10 files changed, 15 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 7cf7e2a768..a5e7fa67ab 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ If a `tslint.json` turns rules off, this is because that hasn't been fixed yet. "extends": "dtslint/dt.json", "rules": { // This package uses the Function type, and it will take effort to fix. - "forbidden-types": false + "ban-types": false } } ``` diff --git a/types/algebra.js/index.d.ts b/types/algebra.js/index.d.ts index 5f5ebbf8a2..3a6c7cb29e 100644 --- a/types/algebra.js/index.d.ts +++ b/types/algebra.js/index.d.ts @@ -16,7 +16,7 @@ declare class Variable { toString(): string; } -declare type Union = string | number | algebra.js.Fraction | Term; +type Union = string | number | algebra.js.Fraction | Term; declare namespace algebra.js { function parse(input: string): Equation | Expression; diff --git a/types/csvtojson/index.d.ts b/types/csvtojson/index.d.ts index c0ff659dd3..87e8286867 100644 --- a/types/csvtojson/index.d.ts +++ b/types/csvtojson/index.d.ts @@ -235,7 +235,7 @@ declare namespace csvtojson { * @param {Function} listener listener function * @return {this} returns this object for chaining */ - // tslint:disable-next-line:forbidden-types + // tslint:disable-next-line ban-types on(event: string, listener: Function | JsonEventHandler | CsvEventHandler | DataEventHandler | ErrorEventHandler | RecordParsedEventHandler | EndEventHandler | EndParsedEventHandler | DoneEventHandler): this; diff --git a/types/ej.web.all/tslint.json b/types/ej.web.all/tslint.json index 0b41224bc0..f85abff699 100644 --- a/types/ej.web.all/tslint.json +++ b/types/ej.web.all/tslint.json @@ -1,13 +1,4 @@ { -<<<<<<< HEAD - "extends": "../tslint.json", - "rules": { - "comment-format": false, - "no-consecutive-blank-lines": false, - "no-padding": false, - "strict-export-declare-modifiers": false - } -======= "extends": "dtslint/dt.json", "rules": { "comment-format": false, @@ -15,5 +6,4 @@ "no-padding": false, "strict-export-declare-modifiers": false } ->>>>>>> master } diff --git a/types/mithril-global/tslint.json b/types/mithril-global/tslint.json index 250b1b7b5f..7d1eda1e0d 100644 --- a/types/mithril-global/tslint.json +++ b/types/mithril-global/tslint.json @@ -1,5 +1,5 @@ { - "extends": "../tslint.json", + "extends": "dtslint/dt.json", "rules": { "array-type": [false, "array"], "quotemark": [false, "double"], @@ -7,9 +7,10 @@ "space-before-function-paren": [false, "always"], "max-line-length": [false, 200], "no-empty-interface": false, - "no-redundant-modifiers": false, + "no-reference-import": false, "only-arrow-functions": [false], "prefer-for-of": false, + "strict-export-declare-modifiers": false, "unified-signatures": false, "whitespace": [ false, diff --git a/types/react-ga/index.d.ts b/types/react-ga/index.d.ts index 66e8140299..83d7a7218e 100644 --- a/types/react-ga/index.d.ts +++ b/types/react-ga/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-ga 2.1.2 +// Type definitions for react-ga 2.1 // Project: https://github.com/react-ga/react-ga // Definitions by: Tim Aldridge // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index ae05a7185f..1e6c084df7 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -4709,7 +4709,6 @@ export interface SystraceStatic { */ measureMethods(object: any, objectName: string, methodNames: Array): void - // tslint:disable:forbidden-types /** * Returns an profiled version of the input function. For example, you can: * JSON.parse = Systrace.measure('JSON', 'parse', JSON.parse); @@ -4720,7 +4719,6 @@ export interface SystraceStatic { * @return {function} replacement function */ measure(objName: string, fnName: string, func: T): T - // tslint:enable:forbidden-types } /** diff --git a/types/react-router-redux/v4/index.d.ts b/types/react-router-redux/v4/index.d.ts index 90d403da24..2dfbdf520e 100644 --- a/types/react-router-redux/v4/index.d.ts +++ b/types/react-router-redux/v4/index.d.ts @@ -23,9 +23,9 @@ export interface RouterAction extends Action { payload?: LocationActionPayload; } -type LocationAction = (nextLocation: LocationDescriptor) => RouterAction; -type GoAction = (n: number) => RouterAction; -type NavigateAction = () => RouterAction; +export type LocationAction = (nextLocation: LocationDescriptor) => RouterAction; +export type GoAction = (n: number) => RouterAction; +export type NavigateAction = () => RouterAction; export const push: LocationAction; export const replace: LocationAction; @@ -33,7 +33,7 @@ export const go: GoAction; export const goBack: NavigateAction; export const goForward: NavigateAction; -interface RouteActions { +export interface RouteActions { push: typeof push; replace: typeof replace; go: typeof go; diff --git a/types/react-router-redux/v4/tslint.json b/types/react-router-redux/v4/tslint.json index 127883804f..3db14f85ea 100644 --- a/types/react-router-redux/v4/tslint.json +++ b/types/react-router-redux/v4/tslint.json @@ -1,6 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "forbidden-types": false - } -} +{ "extends": "dtslint/dt.json" } diff --git a/types/react-router/v3/lib/match.d.ts b/types/react-router/v3/lib/match.d.ts index 82c19e83f6..77a35afafd 100644 --- a/types/react-router/v3/lib/match.d.ts +++ b/types/react-router/v3/lib/match.d.ts @@ -1,19 +1,19 @@ import { Basename, History, LocationDescriptor } from "history"; import { ParseQueryString, RouteConfig, StringifyQuery } from "react-router"; -interface MatchArgs { +export interface MatchArgs { routes: RouteConfig; basename?: Basename; parseQueryString?: ParseQueryString; stringifyQuery?: StringifyQuery; } -interface MatchLocationArgs extends MatchArgs { +export interface MatchLocationArgs extends MatchArgs { location: LocationDescriptor; history?: History; } -interface MatchHistoryArgs extends MatchArgs { +export interface MatchHistoryArgs extends MatchArgs { location?: LocationDescriptor; history: History; }