Skip to content

Commit 138c288

Browse files
committed
docs: generate docs
1 parent fdf7945 commit 138c288

File tree

1 file changed

+44
-19
lines changed

1 file changed

+44
-19
lines changed

README.md

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<a name="eslint-plugin-flowtype"></a>
22
# eslint-plugin-flowtype
33

4-
[![GitSpo Mentions](https://gitspo.com/badges/gajus/eslint-plugin-flowtype?style=flat-square)](https://gitspo.com/mentions/gajus/eslint-plugin-flowtype)
4+
[![GitSpo Mentions](https://gitspo.com/badges/mentions/gajus/eslint-plugin-flowtype?style=flat-square)](https://gitspo.com/mentions/gajus/eslint-plugin-flowtype)
55
[![NPM version](http://img.shields.io/npm/v/eslint-plugin-flowtype.svg?style=flat-square)](https://www.npmjs.org/package/eslint-plugin-flowtype)
66
[![Travis build status](http://img.shields.io/travis/gajus/eslint-plugin-flowtype/master.svg?style=flat-square)](https://travis-ci.org/gajus/eslint-plugin-flowtype)
77
[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
@@ -395,6 +395,10 @@ type X = (?string)[]
395395
// Options: ["verbose"]
396396
// Settings: {"flowtype":{"onlyFilesWithFlowAnnotation":true}}
397397
type X = string[]
398+
399+
type X = Array
400+
401+
type X = typeof Array
398402
```
399403
400404
@@ -512,6 +516,15 @@ declare interface A {}
512516
type X = {Y<AType>(): BType}
513517
// Additional rules: {"no-undef":2}
514518

519+
// Settings: {"flowtype":{"onlyFilesWithFlowAnnotation":true}}
520+
521+
/**
522+
* Copyright 2019 no corp
523+
* @flow
524+
*/
525+
type Foo = $ReadOnly<{}>
526+
// Additional rules: {"no-undef":2}
527+
515528
var a: AType
516529
// Additional rules: {"no-undef":2,"no-use-before-define":[2,"nofunc"]}
517530

@@ -568,6 +581,15 @@ declare interface A {}
568581

569582
type X = {Y<AType>(): BType}
570583
// Additional rules: {"no-undef":2,"no-use-before-define":[2,"nofunc"]}
584+
585+
// Settings: {"flowtype":{"onlyFilesWithFlowAnnotation":true}}
586+
587+
/**
588+
* Copyright 2019 no corp
589+
* @flow
590+
*/
591+
type Foo = $ReadOnly<{}>
592+
// Additional rules: {"no-undef":2,"no-use-before-define":[2,"nofunc"]}
571593
```
572594
573595
@@ -2501,12 +2523,6 @@ const f: fn = (a, b) => { return 42; }
25012523
// Options: ["always",{"annotateUndefined":"never"}]
25022524
(foo) => { return; }
25032525

2504-
// Options: ["always",{"annotateUndefined":"ignore"}]
2505-
(foo): void => { return; }
2506-
2507-
// Options: ["always",{"annotateUndefined":"ignore"}]
2508-
(foo) => { return; }
2509-
25102526
// Options: ["always",{"annotateUndefined":"never"}]
25112527
(foo) => { return undefined; }
25122528

@@ -2530,6 +2546,12 @@ const f: fn = (a, b) => { return 42; }
25302546
// Options: ["always",{"annotateUndefined":"always"}]
25312547
async function doThing(): Promise<void> {}
25322548

2549+
// Options: ["always",{"annotateUndefined":"ignore"}]
2550+
async function doThing(): Promise<void> {}
2551+
2552+
// Options: ["always",{"annotateUndefined":"ignore"}]
2553+
async function doThing() {}
2554+
25332555
// Options: ["always",{"annotateUndefined":"always"}]
25342556
function* doThing(): Generator<number, void, void> { yield 2; }
25352557

@@ -3060,7 +3082,7 @@ type FooType = { a: number, c: number, b: string }
30603082
c: number,
30613083
b: string,
30623084
}
3063-
3085+
30643086
// Message: Expected type annotations to be in ascending order. "b" should be before "c".
30653087
30663088
@@ -3069,7 +3091,7 @@ type FooType = { a: number, c: number, b: string }
30693091
c: number,
30703092
b: string,
30713093
}
3072-
3094+
30733095
// Message: Expected type annotations to be in ascending order. "b" should be before "c".
30743096
30753097
@@ -3078,7 +3100,7 @@ type FooType = { a: number, c: number, b: string }
30783100
c: number,
30793101
b: string,
30803102
}
3081-
3103+
30823104
// Message: Expected type annotations to be in ascending order. "b" should be before "c".
30833105
30843106
@@ -3087,7 +3109,7 @@ type FooType = { a: number, c: number, b: string }
30873109
c: ?number,
30883110
b: string,
30893111
}
3090-
3112+
30913113
// Message: Expected type annotations to be in ascending order. "b" should be before "c".
30923114
30933115
@@ -3096,7 +3118,7 @@ type FooType = { a: number, c: number, b: string }
30963118
c: number,
30973119
b: (param: string) => number,
30983120
}
3099-
3121+
31003122
// Message: Expected type annotations to be in ascending order. "b" should be before "c".
31013123
31023124
@@ -3105,7 +3127,7 @@ type FooType = { a: number, c: number, b: string }
31053127
c: number,
31063128
b: (param: string) => number,
31073129
}
3108-
3130+
31093131
// Message: Expected type annotations to be in ascending order. "b" should be before "c".
31103132
31113133
@@ -3114,7 +3136,7 @@ type FooType = { a: number, c: number, b: string }
31143136
a: number | string | boolean,
31153137
b: (param: string) => number,
31163138
}
3117-
3139+
31183140
// Message: Expected type annotations to be in ascending order. "a" should be before "c".
31193141
31203142
@@ -3127,7 +3149,7 @@ type FooType = { a: number, c: number, b: string }
31273149
a: number | string | boolean,
31283150
b: (param: string) => number,
31293151
}
3130-
3152+
31313153
// Message: Expected type annotations to be in ascending order. "x" should be before "z".
31323154
// Message: Expected type annotations to be in ascending order. "a" should be before "c".
31333155
@@ -3145,7 +3167,7 @@ type FooType = { a: number, c: number, b: string }
31453167
a: number | string | boolean,
31463168
b: (param: string) => number,
31473169
}
3148-
3170+
31493171
// Message: Expected type annotations to be in ascending order. "k" should be before "l".
31503172
// Message: Expected type annotations to be in ascending order. "x" should be before "z".
31513173
// Message: Expected type annotations to be in ascending order. "a" should be before "c".
@@ -3156,7 +3178,7 @@ type FooType = { a: number, c: number, b: string }
31563178
-b: number,
31573179
a: number,
31583180
}
3159-
3181+
31603182
// Message: Expected type annotations to be in ascending order. "b" should be before "c".
31613183
// Message: Expected type annotations to be in ascending order. "a" should be before "b".
31623184
@@ -3166,7 +3188,7 @@ type FooType = { a: number, c: number, b: string }
31663188
-b: number,
31673189
a: number,
31683190
|}
3169-
3191+
31703192
// Message: Expected type annotations to be in ascending order. "b" should be before "c".
31713193
// Message: Expected type annotations to be in ascending order. "a" should be before "b".
31723194
```
@@ -3291,7 +3313,7 @@ The following patterns are considered problems:
32913313
{ a: string, b: number }) => {}
32923314
// Message: There must not be a line break after "foo" parameter type annotation colon.
32933315
3294-
(foo:
3316+
(foo:
32953317
{ a: string, b: number }) => {}
32963318
// Message: There must not be a line break after "foo" parameter type annotation colon.
32973319
@@ -4896,3 +4918,6 @@ function x(foo: string = "1") {}
48964918
48974919
function x(foo: Type = bar()) {}
48984920
```
4921+
4922+
4923+

0 commit comments

Comments
 (0)