Skip to content

Commit

Permalink
docs: correct examples (fixes #333)
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed May 30, 2018
1 parent 51f4ba2 commit ff4f857
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 35 deletions.
3 changes: 1 addition & 2 deletions .README/rules/no-existential-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ Disallows use of the existential type (*). [See more](https://flow.org/en/docs/t
```


<!-- assertions newlineAfterFlowAnnotation -->

<!-- assertions noExistentialType -->
49 changes: 16 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1277,48 +1277,25 @@ Disallows use of the existential type (*). [See more](https://flow.org/en/docs/t
The following patterns are considered problems:
```js
// @flow
import Foo from './foo';
// Message: Expected newline after flow annotation

// Options: ["always"]
// @flow
import Foo from './foo';
// Message: Expected newline after flow annotation

// Options: ["always-windows"]
// @flow
import Foo from './foo';
// Message: Expected newline after flow annotation

// Options: ["never"]
// @flow
type T = *;
// Message: Unexpected use of existential type (*).

type T = U<*, *>;
// Message: Unexpected use of existential type (*).
// Message: Unexpected use of existential type (*).

// Message: Expected no newline after flow annotation
const f: (*) => null = () => null;
// Message: Unexpected use of existential type (*).
```
The following patterns are not considered problems:
```js
// Options: ["always"]
// @flow

import Foo from './foo';

// Options: ["always-windows"]
// @flow

import Foo from './foo';

// Options: ["never"]
// @flow
import Foo from './foo';
type T = string | null
```
<a name="eslint-plugin-flowtype-rules-no-flow-fix-me-comments"></a>
### <code>no-flow-fix-me-comments</code>
Expand Down Expand Up @@ -2437,8 +2414,6 @@ This rule validates Flow file annotations.
This rule can optionally report missing or missed placed annotations, common typos (e.g. `// @floww`), and enforce a consistant annotation style.

This rule is autofixable with the `--fix` argument. This will autofix files by adding missing flow annotations to the top of each file. To avoid autofixing this rule per-file, you can add a `// @noflow` annotation to the top of individual files.

<a name="eslint-plugin-flowtype-rules-require-valid-file-annotation-options"></a>
#### Options

Expand Down Expand Up @@ -2520,6 +2495,14 @@ a;
// Options: ["always",{"annotationStyle":"block"}]
// @noflow
// Message: Flow file annotation style must be `/* @noflow */`

// Options: ["always"]
a;
// Message: Flow file annotation is missing.

// Options: ["always",{"annotationStyle":"block"}]
a;
// Message: Flow file annotation is missing.
```
The following patterns are not considered problems:
Expand Down

0 comments on commit ff4f857

Please sign in to comment.