Skip to content

Commit 2627ef0

Browse files
committed
docs: generate docs (#426)
1 parent dacb402 commit 2627ef0

File tree

1 file changed

+58
-10
lines changed

1 file changed

+58
-10
lines changed

README.md

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* [`object-type-delimiter`](#eslint-plugin-flowtype-rules-object-type-delimiter)
3737
* [`require-compound-type-alias`](#eslint-plugin-flowtype-rules-require-compound-type-alias)
3838
* [`require-exact-type`](#eslint-plugin-flowtype-rules-require-exact-type)
39+
* [`require-indexer-name`](#eslint-plugin-flowtype-rules-require-indexer-name)
3940
* [`require-inexact-type`](#eslint-plugin-flowtype-rules-require-inexact-type)
4041
* [`require-parameter-type`](#eslint-plugin-flowtype-rules-require-parameter-type)
4142
* [`require-readonly-react-props`](#eslint-plugin-flowtype-rules-require-readonly-react-props)
@@ -2367,12 +2368,59 @@ type foo = number;
23672368
23682369
23692370
2371+
<a name="eslint-plugin-flowtype-rules-require-indexer-name"></a>
2372+
### <code>require-indexer-name</code>
2373+
2374+
_The `--fix` option on the command line automatically fixes problems reported by this rule._
2375+
2376+
This rule validates Flow object indexer name.
2377+
2378+
<a name="eslint-plugin-flowtype-rules-require-indexer-name-options-4"></a>
2379+
#### Options
2380+
2381+
The rule has a string option:
2382+
2383+
* `"never"` (default): Never report files that are missing an indexer key name.
2384+
* `"always"`: Always report files that are missing an indexer key name.
2385+
2386+
```js
2387+
{
2388+
"rules": {
2389+
"flowtype/require-indexer-name": [
2390+
2,
2391+
"always"
2392+
]
2393+
}
2394+
}
2395+
```
2396+
2397+
The following patterns are considered problems:
2398+
2399+
```js
2400+
type foo = { [string]: number };
2401+
// Message: All indexers must be declared with key name.
2402+
```
2403+
2404+
The following patterns are not considered problems:
2405+
2406+
```js
2407+
type foo = { [key: string]: number };
2408+
2409+
// Options: ["never"]
2410+
type foo = { [key: string]: number };
2411+
2412+
// Options: ["never"]
2413+
type foo = { [string]: number };
2414+
```
2415+
2416+
2417+
23702418
<a name="eslint-plugin-flowtype-rules-require-inexact-type"></a>
23712419
### <code>require-inexact-type</code>
23722420
23732421
This rule enforces explicit inexact object types.
23742422
2375-
<a name="eslint-plugin-flowtype-rules-require-inexact-type-options-4"></a>
2423+
<a name="eslint-plugin-flowtype-rules-require-inexact-type-options-5"></a>
23762424
#### Options
23772425
23782426
The rule has one string option:
@@ -2481,7 +2529,7 @@ type foo = number;
24812529
24822530
Requires that all function parameters have type annotations.
24832531
2484-
<a name="eslint-plugin-flowtype-rules-require-parameter-type-options-5"></a>
2532+
<a name="eslint-plugin-flowtype-rules-require-parameter-type-options-6"></a>
24852533
#### Options
24862534
24872535
You can skip all arrow functions by providing the `excludeArrowFunctions` option with `true`.
@@ -2806,7 +2854,7 @@ function Foo(props: {||}) { return <p /> }
28062854
28072855
Requires that functions have return type annotation.
28082856
2809-
<a name="eslint-plugin-flowtype-rules-require-return-type-options-6"></a>
2857+
<a name="eslint-plugin-flowtype-rules-require-return-type-options-7"></a>
28102858
#### Options
28112859
28122860
You can skip all arrow functions by providing the `excludeArrowFunctions` option with `true`.
@@ -3160,7 +3208,7 @@ async function * foo(): AsyncIterable<number> { yield 2; }
31603208
31613209
Requires all type declarations to be at the top of the file, after any import declarations.
31623210
3163-
<a name="eslint-plugin-flowtype-rules-require-types-at-top-options-7"></a>
3211+
<a name="eslint-plugin-flowtype-rules-require-types-at-top-options-8"></a>
31643212
#### Options
31653213
31663214
The rule has a string option:
@@ -3237,7 +3285,7 @@ This rule validates Flow file annotations.
32373285
32383286
This rule can optionally report missing or missed placed annotations, common typos (e.g. `// @floww`), and enforce a consistant annotation style.
32393287

3240-
<a name="eslint-plugin-flowtype-rules-require-valid-file-annotation-options-8"></a>
3288+
<a name="eslint-plugin-flowtype-rules-require-valid-file-annotation-options-9"></a>
32413289
#### Options
32423290

32433291
The rule has a string option:
@@ -3409,7 +3457,7 @@ a;
34093457
34103458
Requires that all variable declarators have type annotations.
34113459
3412-
<a name="eslint-plugin-flowtype-rules-require-variable-type-options-9"></a>
3460+
<a name="eslint-plugin-flowtype-rules-require-variable-type-options-10"></a>
34133461
#### Options
34143462
34153463
You can exclude variables that match a certain regex by using `excludeVariableMatch`.
@@ -3561,7 +3609,7 @@ Enforces sorting of Object annotations.
35613609

35623610
This rule mirrors ESlint's [sort-keys](http://eslint.org/docs/rules/sort-keys) rule.
35633611
3564-
<a name="eslint-plugin-flowtype-rules-sort-keys-options-10"></a>
3612+
<a name="eslint-plugin-flowtype-rules-sort-keys-options-11"></a>
35653613
#### Options
35663614
35673615
The first option specifies sort order.
@@ -3786,7 +3834,7 @@ _The `--fix` option on the command line automatically fixes problems reported by
37863834
37873835
Enforces consistent spacing after the type annotation colon.
37883836
3789-
<a name="eslint-plugin-flowtype-rules-space-after-type-colon-options-11"></a>
3837+
<a name="eslint-plugin-flowtype-rules-space-after-type-colon-options-12"></a>
37903838
#### Options
37913839
37923840
This rule has a string argument.
@@ -5155,7 +5203,7 @@ type foo = {test: number}; type bar = {...$Exact<foo>}
51555203
51565204
Enforces a consistent naming pattern for type aliases.
51575205
5158-
<a name="eslint-plugin-flowtype-rules-type-id-match-options-12"></a>
5206+
<a name="eslint-plugin-flowtype-rules-type-id-match-options-13"></a>
51595207
#### Options
51605208
51615209
This rule needs a text RegExp to operate with Its signature is as follows:
@@ -5213,7 +5261,7 @@ import {type T, type U, type V} from '...';
52135261
import type {T, U, V} from '...';
52145262
```
52155263
5216-
<a name="eslint-plugin-flowtype-rules-type-import-style-options-13"></a>
5264+
<a name="eslint-plugin-flowtype-rules-type-import-style-options-14"></a>
52175265
#### Options
52185266
52195267
The rule has a string option:

0 commit comments

Comments
 (0)