Skip to content

Commit

Permalink
Prevent generated comments (#2835)
Browse files Browse the repository at this point in the history
* udpate elint packages

* prevent generated comments and fix occurrences

* fix broken libdef

* remove unused package

* fix occurrences where eslint parser fails to parse

* hide warnings when testing libdefs
  • Loading branch information
villesau authored and gantoine committed Oct 18, 2018
1 parent 3b86451 commit 00cdfec
Show file tree
Hide file tree
Showing 17 changed files with 240 additions and 317 deletions.
3 changes: 2 additions & 1 deletion definitions/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"flowtype"
],
"rules": {
"flowtype/no-weak-types": 1
"flowtype/no-weak-types": 1,
"no-warning-comments": [2, { "terms": ["flow-typed signature", "flow-typed version"], "location": "start"}]
}
}
4 changes: 2 additions & 2 deletions definitions/npm/axios_v0.16.x/flow_v0.75.x-/axios_v0.16.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ declare module "axios" {
declare type AxiosPromise<T> = Promise<AxiosXHR<T>>;
declare class Axios {
constructor<T>(config?: AxiosXHRConfigBase<T>): void;
[[call]]<T>(
static <T>(
config: AxiosXHRConfig<T> | string,
config?: AxiosXHRConfig<T>
): AxiosPromise<T>;
Expand Down Expand Up @@ -129,7 +129,7 @@ declare module "axios" {
declare type $AxiosError<T> = AxiosError<T>;

declare interface AxiosExport extends Axios {
[[call]]<T>(
<T>(
config: AxiosXHRConfig<T> | string,
config?: AxiosXHRConfig<T>
): AxiosPromise<T>;
Expand Down
4 changes: 2 additions & 2 deletions definitions/npm/axios_v0.17.x/flow_v0.75.x-/axios_v0.17.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ declare module "axios" {
declare type AxiosPromise<T> = Promise<AxiosXHR<T>>;
declare class Axios {
constructor<T>(config?: AxiosXHRConfigBase<T>): void;
[[call]]<T>(
static <T>(
config: AxiosXHRConfig<T> | string,
config?: AxiosXHRConfig<T>
): AxiosPromise<T>;
Expand Down Expand Up @@ -130,7 +130,7 @@ declare module "axios" {
declare type $AxiosError<T> = AxiosError<T>;

declare interface AxiosExport extends Axios {
[[call]]<T>(
<T>(
config: AxiosXHRConfig<T> | string,
config?: AxiosXHRConfig<T>
): AxiosPromise<T>;
Expand Down
4 changes: 2 additions & 2 deletions definitions/npm/axios_v0.18.x/flow_v0.75.x-/axios_v0.18.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ declare module "axios" {
declare type AxiosPromise<T,R = T> = Promise<AxiosXHR<T,R>>;
declare class Axios {
constructor<T,R>(config?: AxiosXHRConfigBase<T,R>): void;
[[call]]<T,R>(config: AxiosXHRConfig<T,R> | string, config?: AxiosXHRConfig<T,R>): AxiosPromise<T,R>;
static <T,R>(config: AxiosXHRConfig<T,R> | string, config?: AxiosXHRConfig<T,R>): AxiosPromise<T,R>;
request<T,R>(config: AxiosXHRConfig<T,R>): AxiosPromise<T,R>;
delete<T,R>(url: string, config?: AxiosXHRConfigBase<T,R>): AxiosPromise<T,R>;
get<T,R>(url: string, config?: AxiosXHRConfigBase<T,R>): AxiosPromise<T,R>;
Expand Down Expand Up @@ -134,7 +134,7 @@ declare module "axios" {
declare type $AxiosError<T,R = T> = AxiosError<T,R>;

declare interface AxiosExport extends Axios {
[[call]]<T,R>(config: AxiosXHRConfig<T,R> | string, config?: AxiosXHRConfig<T,R>): AxiosPromise<T,R>;
<T,R>(config: AxiosXHRConfig<T,R> | string, config?: AxiosXHRConfig<T,R>): AxiosPromise<T,R>;
Axios: typeof Axios;
Cancel: Class<Cancel>;
CancelToken: Class<CancelToken>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// flow-typed signature: ba506076507fa389f4f828349e657080
// flow-typed version: 60ea71b942/backbone_v1.x.x/flow_>=v0.25.x

type Comparator<T> = (attr: string) => any | ((attrA: T, attrB: T) => number);

declare module "backbone" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ declare class BeeQueue$Queue extends events$EventEmitter {
process(handler: BeeQueue$Handler): void,
process(concurrency: number, handler: BeeQueue$Handler): void,
ready(): Promise<*>,
ready(cb: function): void,
ready(cb: Function): void,
removeJob(jobId: number): Promise<*>,
removeJob(jobId: number, callback: (err: ?Error) => void): void,
settings: {}
Expand Down
3 changes: 0 additions & 3 deletions definitions/npm/bowser_v1.x.x/flow_v0.74.x-/bowser_v1.x.x.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// flow-typed signature: 4fdfa0e8dd0099eab7c89f191a4713f1
// flow-typed version: <<STUB>>/bowser_v1.9.3/flow_v0.74.0

/**
* This is an autogenerated libdef stub for:
*
Expand Down
4 changes: 2 additions & 2 deletions definitions/npm/execa_v0.10.x/flow_v0.75.x-/execa_v0.10.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ declare module 'execa' {
}

declare interface Execa {
[[call]](file: string, args?: $ReadOnlyArray<string>, options?: Options): ThenableChildProcess;
[[call]](file: string, options?: Options): ThenableChildProcess;
(file: string, args?: $ReadOnlyArray<string>, options?: Options): ThenableChildProcess;
(file: string, options?: Options): ThenableChildProcess;

stdout(file: string, args?: $ReadOnlyArray<string>, options?: Options): Promise<string>;
stdout(file: string, options?: Options): Promise<string>;
Expand Down
3 changes: 0 additions & 3 deletions definitions/npm/jest_v14.x.x/flow_v0.25.x-/jest_v14.x.x.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// flow-typed signature: e2130120dcdc34bf09ff82449b0d508c
// flow-typed version: 230d7577ce/jest_v12.0.x/flow_>=v0.23.x

type JestMockFn = {
(...args: Array<any>): any,
mock: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ declare module 'metalsmith' {
declare type IgnoreFunc = (path: string, lstat: Stats) => boolean;

declare class Metalsmith {
static [[call]](directory: string): Metalsmith;
static (directory: string): Metalsmith;

constructor(directory: string): this;

Expand Down
4 changes: 2 additions & 2 deletions definitions/npm/nock_v10.x.x/flow_v0.75.x-/nock_v10.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ declare type $npm$nock$InterceptorOptions = {
};

declare class $npm$nock$NockBack {
[[call]](path: string, cb: (cb: Function) => any): void;
static (path: string, cb: (cb: Function) => any): void;
fixtures: string;
setMode(mode: string): void;
}

declare class $npm$nock$Nock {
static [[call]](
static (
url: string | RegExp,
options?: {
reqheaders?: Object,
Expand Down
4 changes: 2 additions & 2 deletions definitions/npm/nock_v9.x.x/flow_v0.75.x-/nock_v9.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ declare type $npm$nock$InterceptorOptions = {
};

declare class $npm$nock$NockBack {
[[call]](path: string, cb: (cb: Function) => any): void;
static (path: string, cb: (cb: Function) => any): void;
fixtures: string;
setMode(mode: string): void;
}

declare class $npm$nock$Nock {
static [[call]](
static (
url: string | RegExp,
options?: {
reqheaders?: Object,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// flow-typed signature: 7d75bac2d24a91e205a306c0cac0d283
// flow-typed version: <<STUB>>/node-dogstatsd_v0.0.6/flow_v0.48.0

import type { Socket } from 'net';

declare module 'node-dogstatsd' {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import React from "react";
import * as React from "react";
import { connect } from "react-redux";
import type { Connector } from "react-redux";

Expand Down Expand Up @@ -186,4 +186,4 @@ const CC10 = connector10(C3);
//
// ConnectedComponent
//
(CC1.WrappedComponent: C1);
(CC1.WrappedComponent: React.ComponentType<React.ElementProps<typeof C1>>);
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// flow-typed signature: 8db7b853f57c51094bf0ab8b2650fd9c
// flow-typed version: ab8db5f14d/react-redux_v5.x.x/flow_>=v0.30.x

import type { Dispatch, Store } from "redux";

declare module "react-redux" {
Expand Down
18 changes: 10 additions & 8 deletions definitions/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
{
"name": "definitions",
"description": "",
"author": "flowtype",
"license": "MIT",
"author": "flowtype",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"precommit": "lint-staged",
"test": "eslint **/**/test_*"
"test": "eslint **/**/test_* --quiet"
},
"dependencies": {
"babel-eslint": "^8.2.1",
"eslint": "^4.17.0",
"husky": "^0.14.3",
"lint-staged": "^4.0.3",
"prettier": "^1.9.2",
"prettier-package-json": "^1.4.0"
},
"devDependencies": {
"eslint-plugin-flow-typed": "^1.0.0",
"eslint-plugin-flowtype": "^2.42.0",
"eslint-plugin-prettier": "^2.6.0"
"babel-eslint": "^10.0.1",
"eslint": "^5.7.0",
"eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-prettier": "^3.0.0"
},
"lint-staged": {
"gitDir": "../",
Expand All @@ -30,7 +29,10 @@
"prettier --write",
"git add"
],
"*.js": ["eslint --fix", "git add"]
"*.js": [
"eslint --fix",
"git add"
]
}
}
}
Loading

0 comments on commit 00cdfec

Please sign in to comment.