{"id":13431944,"url":"https://github.com/gajus/eslint-plugin-flowtype","last_synced_at":"2025-05-14T02:08:28.533Z","repository":{"id":45049677,"uuid":"51695863","full_name":"gajus/eslint-plugin-flowtype","owner":"gajus","description":"Flow type linting rules for ESLint.","archived":false,"fork":false,"pushed_at":"2024-02-29T06:26:46.000Z","size":1450,"stargazers_count":1074,"open_issues_count":40,"forks_count":154,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-10T11:01:45.112Z","etag":null,"topics":["eslint","flow","flowtype"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gajus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"gajus","patreon":"gajus"}},"created_at":"2016-02-14T13:32:34.000Z","updated_at":"2025-03-15T20:58:15.000Z","dependencies_parsed_at":"2022-08-12T11:40:53.555Z","dependency_job_id":null,"html_url":"https://github.com/gajus/eslint-plugin-flowtype","commit_stats":{"total_commits":525,"total_committers":79,"mean_commits":"6.6455696202531644","dds":0.5657142857142857,"last_synced_commit":"449cb99f1b6d3bbbb66f5be55f497667f5b2cb31"},"previous_names":[],"tags_count":185,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-flowtype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-flowtype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-flowtype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-flowtype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gajus","download_url":"https://codeload.github.com/gajus/eslint-plugin-flowtype/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254053175,"owners_count":22006717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","flow","flowtype"],"created_at":"2024-07-31T02:01:07.241Z","updated_at":"2025-05-14T02:08:23.499Z","avatar_url":"https://github.com/gajus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/gajus","https://patreon.com/gajus"],"categories":["JavaScript","Plugins","Tools"],"sub_categories":["Languages and Environments"],"readme":"\u003ca name=\"eslint-plugin-flowtype\"\u003e\u003c/a\u003e\n# eslint-plugin-flowtype\n\n[![NPM version](http://img.shields.io/npm/v/eslint-plugin-flowtype.svg?style=flat-square)](https://www.npmjs.org/package/eslint-plugin-flowtype)\n[![Travis build status](http://img.shields.io/travis/gajus/eslint-plugin-flowtype/master.svg?style=flat-square)](https://travis-ci.com/github/gajus/eslint-plugin-flowtype)\n[![js-canonical-style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n\n[Flow type](http://flowtype.org/) linting rules for ESLint.\n\n* [eslint-plugin-flowtype](#eslint-plugin-flowtype)\n    * [Installation](#eslint-plugin-flowtype-installation)\n    * [Configuration](#eslint-plugin-flowtype-configuration)\n        * [Shareable configurations](#eslint-plugin-flowtype-configuration-shareable-configurations)\n        * [Community maintained configurations](#eslint-plugin-flowtype-configuration-community-maintained-configurations)\n    * [Settings](#eslint-plugin-flowtype-settings)\n        * [`onlyFilesWithFlowAnnotation`](#eslint-plugin-flowtype-settings-onlyfileswithflowannotation)\n    * [Rules](#eslint-plugin-flowtype-rules)\n        * [`array-style-complex-type`](#eslint-plugin-flowtype-rules-array-style-complex-type)\n        * [`array-style-simple-type`](#eslint-plugin-flowtype-rules-array-style-simple-type)\n        * [`arrow-parens`](#eslint-plugin-flowtype-rules-arrow-parens)\n        * [`boolean-style`](#eslint-plugin-flowtype-rules-boolean-style)\n        * [`define-flow-type`](#eslint-plugin-flowtype-rules-define-flow-type)\n        * [`delimiter-dangle`](#eslint-plugin-flowtype-rules-delimiter-dangle)\n        * [`enforce-line-break`](#eslint-plugin-flowtype-rules-enforce-line-break)\n        * [`generic-spacing`](#eslint-plugin-flowtype-rules-generic-spacing)\n        * [`interface-id-match`](#eslint-plugin-flowtype-rules-interface-id-match)\n        * [`newline-after-flow-annotation`](#eslint-plugin-flowtype-rules-newline-after-flow-annotation)\n        * [`no-dupe-keys`](#eslint-plugin-flowtype-rules-no-dupe-keys)\n        * [`no-duplicate-type-union-intersection-members`](#eslint-plugin-flowtype-rules-no-duplicate-type-union-intersection-members)\n        * [`no-existential-type`](#eslint-plugin-flowtype-rules-no-existential-type)\n        * [`no-flow-fix-me-comments`](#eslint-plugin-flowtype-rules-no-flow-fix-me-comments)\n        * [`no-internal-flow-type`](#eslint-plugin-flowtype-rules-no-internal-flow-type)\n        * [`no-mixed`](#eslint-plugin-flowtype-rules-no-mixed)\n        * [`no-mutable-array`](#eslint-plugin-flowtype-rules-no-mutable-array)\n        * [`no-primitive-constructor-types`](#eslint-plugin-flowtype-rules-no-primitive-constructor-types)\n        * [`no-types-missing-file-annotation`](#eslint-plugin-flowtype-rules-no-types-missing-file-annotation)\n        * [`no-unused-expressions`](#eslint-plugin-flowtype-rules-no-unused-expressions)\n        * [`no-weak-types`](#eslint-plugin-flowtype-rules-no-weak-types)\n        * [`object-type-curly-spacing`](#eslint-plugin-flowtype-rules-object-type-curly-spacing)\n        * [`object-type-delimiter`](#eslint-plugin-flowtype-rules-object-type-delimiter)\n        * [`quotes`](#eslint-plugin-flowtype-rules-quotes)\n        * [`require-compound-type-alias`](#eslint-plugin-flowtype-rules-require-compound-type-alias)\n        * [`require-exact-type`](#eslint-plugin-flowtype-rules-require-exact-type)\n        * [`require-indexer-name`](#eslint-plugin-flowtype-rules-require-indexer-name)\n        * [`require-inexact-type`](#eslint-plugin-flowtype-rules-require-inexact-type)\n        * [`require-parameter-type`](#eslint-plugin-flowtype-rules-require-parameter-type)\n        * [`require-readonly-react-props`](#eslint-plugin-flowtype-rules-require-readonly-react-props)\n        * [`require-return-type`](#eslint-plugin-flowtype-rules-require-return-type)\n        * [`require-types-at-top`](#eslint-plugin-flowtype-rules-require-types-at-top)\n        * [`require-valid-file-annotation`](#eslint-plugin-flowtype-rules-require-valid-file-annotation)\n        * [`require-variable-type`](#eslint-plugin-flowtype-rules-require-variable-type)\n        * [`semi`](#eslint-plugin-flowtype-rules-semi)\n        * [`sort-keys`](#eslint-plugin-flowtype-rules-sort-keys)\n        * [`sort-type-union-intersection-members`](#eslint-plugin-flowtype-rules-sort-type-union-intersection-members)\n        * [`space-after-type-colon`](#eslint-plugin-flowtype-rules-space-after-type-colon)\n        * [`space-before-generic-bracket`](#eslint-plugin-flowtype-rules-space-before-generic-bracket)\n        * [`space-before-type-colon`](#eslint-plugin-flowtype-rules-space-before-type-colon)\n        * [`spread-exact-type`](#eslint-plugin-flowtype-rules-spread-exact-type)\n        * [`type-id-match`](#eslint-plugin-flowtype-rules-type-id-match)\n        * [`type-import-style`](#eslint-plugin-flowtype-rules-type-import-style)\n        * [`union-intersection-spacing`](#eslint-plugin-flowtype-rules-union-intersection-spacing)\n        * [`use-flow-type`](#eslint-plugin-flowtype-rules-use-flow-type)\n        * [`use-read-only-spread`](#eslint-plugin-flowtype-rules-use-read-only-spread)\n        * [`valid-syntax`](#eslint-plugin-flowtype-rules-valid-syntax)\n\n\n\u003ca name=\"eslint-plugin-flowtype-installation\"\u003e\u003c/a\u003e\n## Installation\n\n```bash\nnpm install eslint --save-dev\nnpm install @babel/eslint-parser --save-dev\nnpm install eslint-plugin-flowtype --save-dev\n```\n\n\u003ca name=\"eslint-plugin-flowtype-configuration\"\u003e\u003c/a\u003e\n## Configuration\n\n1. Set `parser` property to `@babel/eslint-parser`.\n1. Add `plugins` section and specify `eslint-plugin-flowtype` as a plugin.\n1. Enable rules.\n\n\u003c!-- --\u003e\n\n```json\n{\n  \"parser\": \"@babel/eslint-parser\",\n  \"plugins\": [\n    \"flowtype\"\n  ],\n  \"rules\": {\n    \"flowtype/boolean-style\": [\n      2,\n      \"boolean\"\n    ],\n    \"flowtype/define-flow-type\": 1,\n    \"flowtype/delimiter-dangle\": [\n      2,\n      \"never\"\n    ],\n    \"flowtype/generic-spacing\": [\n      2,\n      \"never\"\n    ],\n    \"flowtype/interface-id-match\": [\n      2,\n      \"^([A-Z][a-z0-9]+)+Type$\"\n    ],\n    \"flowtype/no-mixed\": 2,\n    \"flowtype/no-primitive-constructor-types\": 2,\n    \"flowtype/no-types-missing-file-annotation\": 2,\n    \"flowtype/no-weak-types\": 2,\n    \"flowtype/object-type-delimiter\": [\n      2,\n      \"comma\"\n    ],\n    \"flowtype/require-parameter-type\": 2,\n    \"flowtype/require-readonly-react-props\": 0,\n    \"flowtype/require-return-type\": [\n      2,\n      \"always\",\n      {\n        \"annotateUndefined\": \"never\"\n      }\n    ],\n    \"flowtype/require-valid-file-annotation\": 2,\n    \"flowtype/semi\": [\n      2,\n      \"always\"\n    ],\n    \"flowtype/space-after-type-colon\": [\n      2,\n      \"always\"\n    ],\n    \"flowtype/space-before-generic-bracket\": [\n      2,\n      \"never\"\n    ],\n    \"flowtype/space-before-type-colon\": [\n      2,\n      \"never\"\n    ],\n    \"flowtype/type-id-match\": [\n      2,\n      \"^([A-Z][a-z0-9]+)+Type$\"\n    ],\n    \"flowtype/union-intersection-spacing\": [\n      2,\n      \"always\"\n    ],\n    \"flowtype/use-flow-type\": 1,\n    \"flowtype/valid-syntax\": 1\n  },\n  \"settings\": {\n    \"flowtype\": {\n      \"onlyFilesWithFlowAnnotation\": false\n    }\n  }\n}\n```\n\n\u003ca name=\"eslint-plugin-flowtype-configuration-shareable-configurations\"\u003e\u003c/a\u003e\n### Shareable configurations\n\n\u003ca name=\"eslint-plugin-flowtype-configuration-shareable-configurations-recommended\"\u003e\u003c/a\u003e\n#### Recommended\n\nThis plugin exports a [recommended configuration](./src/configs/recommended.json) that enforces Flow type good practices.\n\nTo enable this configuration use the extends property in your `.eslintrc` config file:\n\n```json\n{\n  \"extends\": [\n    \"plugin:flowtype/recommended\"\n  ],\n  \"plugins\": [\n    \"flowtype\"\n  ]\n}\n```\n\nSee [ESLint documentation](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) for more information about extending configuration files.\n\n\u003ca name=\"eslint-plugin-flowtype-configuration-community-maintained-configurations\"\u003e\u003c/a\u003e\n### Community maintained configurations\n\nThe following are third-party submitted/ maintained configurations of `eslint-plugin-flowtype`:\n\n* https://github.com/wemake-services/eslint-config-flowtype-essential\n\n\u003ca name=\"eslint-plugin-flowtype-settings\"\u003e\u003c/a\u003e\n## Settings\n\n\u003ca name=\"eslint-plugin-flowtype-settings-onlyfileswithflowannotation\"\u003e\u003c/a\u003e\n### \u003ccode\u003eonlyFilesWithFlowAnnotation\u003c/code\u003e\n\nWhen `true`, only checks files with a [`@flow` annotation](http://flowtype.org/docs/about-flow.html#gradual) in the first comment.\n\n```js\n{\n  \"settings\": {\n    \"flowtype\": {\n      \"onlyFilesWithFlowAnnotation\": true\n    }\n  }\n}\n```\n\n\u003ca name=\"eslint-plugin-flowtype-rules\"\u003e\u003c/a\u003e\n## Rules\n\n\u003c!-- Rules are sorted alphabetically. --\u003e\n\n\u003ca name=\"eslint-plugin-flowtype-rules-array-style-complex-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003earray-style-complex-type\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nEnforces a particular annotation style of complex types.\n\nType is considered complex in these cases:\n\n* [Maybe type](https://flow.org/en/docs/types/maybe/)\n* [Function type](https://flow.org/en/docs/types/functions/)\n* [Object type](https://flow.org/en/docs/types/objects/)\n* [Tuple type](https://flow.org/en/docs/types/tuples/)\n* [Union type](https://flow.org/en/docs/types/unions/)\n* [Intersection type](https://flow.org/en/docs/types/intersections/)\n\nThis rule takes one argument.\n\nIf it is `'verbose'` then a problem is raised when using `Type[]` instead of `Array\u003cType\u003e`.\n\nIf it is `'shorthand'` then a problem is raised when using `Array\u003cType\u003e` instead of `Type[]`.\n\nThe default value is `'verbose'`.\n\nThe following patterns are considered problems:\n\n```js\ntype X = (?string)[]\n// Message: Use \"Array\u003c?string\u003e\", not \"(?string)[]\"\n\n// Options: [\"verbose\"]\ntype X = (?string)[]\n// Message: Use \"Array\u003c?string\u003e\", not \"(?string)[]\"\n\n// Options: [\"shorthand\"]\ntype X = Array\u003c?string\u003e\n// Message: Use \"(?string)[]\", not \"Array\u003c?string\u003e\"\n\n// Options: [\"shorthand\"]\ntype X = Array\u003c{foo: string}\u003e\n// Message: Use \"{foo: string}[]\", not \"Array\u003c{foo: string}\u003e\"\n\ntype X = (string | number)[]\n// Message: Use \"Array\u003cstring | number\u003e\", not \"(string | number)[]\"\n\ntype X = (string \u0026 number)[]\n// Message: Use \"Array\u003cstring \u0026 number\u003e\", not \"(string \u0026 number)[]\"\n\ntype X = [string, number][]\n// Message: Use \"Array\u003c[string, number]\u003e\", not \"[string, number][]\"\n\ntype X = {foo: string}[]\n// Message: Use \"Array\u003c{foo: string}\u003e\", not \"{foo: string}[]\"\n\ntype X = (string =\u003e number)[]\n// Message: Use \"Array\u003cstring =\u003e number\u003e\", not \"(string =\u003e number)[]\"\n\ntype X = {\n    foo: string,\n    bar: number\n}[]\n// Message: Use \"Array\u003c{ foo: string, bar: number }\u003e\", not \"{ foo: string, bar: number }[]\"\n\ntype X = {\n    foo: string,\n    bar: number,\n    quo: boolean,\n    hey: Date\n}[]\n// Message: Use \"Array\u003cType\u003e\", not \"Type[]\"\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = Array\u003c?string\u003e\n\n// Options: [\"verbose\"]\ntype X = Array\u003c?string\u003e\n\n// Options: [\"shorthand\"]\ntype X = (?string)[]\n\n// Options: [\"shorthand\"]\ntype X = Array\u003cstring\u003e\n\n// Options: [\"shorthand\"]\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\ntype X = Array\u003c?string\u003e\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-array-style-simple-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003earray-style-simple-type\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nEnforces a particular array type annotation style of simple types.\n\nType is considered simple in these cases:\n\n* [Primitive types](https://flow.org/en/docs/types/primitives/)\n* [Literal types](https://flow.org/en/docs/types/literals/)\n* [Mixed type](https://flow.org/en/docs/types/mixed/)\n* [Any type](https://flow.org/en/docs/types/any/)\n* [Class type](https://flow.org/en/docs/types/classes/)\n* [Generic type](https://flow.org/en/docs/types/generics/)\n* Array type [shorthand notation](https://flow.org/en/docs/types/arrays/#toc-array-type-shorthand-syntax)\n\nThis rule takes one argument.\n\nIf it is `'verbose'` then a problem is raised when using `Type[]` instead of `Array\u003cType\u003e`.\n\nIf it is `'shorthand'` then a problem is raised when using `Array\u003cType\u003e` instead of `Type[]`.\n\nThe default value is `'verbose'`.\n\nThe following patterns are considered problems:\n\n```js\ntype X = string[]\n// Message: Use \"Array\u003cstring\u003e\", not \"string[]\"\n\n// Options: [\"verbose\"]\ntype X = string[]\n// Message: Use \"Array\u003cstring\u003e\", not \"string[]\"\n\n// Options: [\"shorthand\"]\ntype X = Array\u003cstring\u003e\n// Message: Use \"string[]\", not \"Array\u003cstring\u003e\"\n\ntype X = Date[]\n// Message: Use \"Array\u003cDate\u003e\", not \"Date[]\"\n\ntype X = Promise\u003cstring\u003e[]\n// Message: Use \"Array\u003cPromise\u003cstring\u003e\u003e\", not \"Promise\u003cstring\u003e[]\"\n\ntype X = $Keys\u003c{foo: string}\u003e[]\n// Message: Use \"Array\u003c$Keys\u003c{foo: string}\u003e\u003e\", not \"$Keys\u003c{foo: string}\u003e[]\"\n\ntype X = any[]\n// Message: Use \"Array\u003cany\u003e\", not \"any[]\"\n\ntype X = mixed[]\n// Message: Use \"Array\u003cmixed\u003e\", not \"mixed[]\"\n\ntype X = void[]\n// Message: Use \"Array\u003cvoid\u003e\", not \"void[]\"\n\ntype X = null[]\n// Message: Use \"Array\u003cnull\u003e\", not \"null[]\"\n\ntype X = Promise\u003c{\n    foo: string,\n    bar: number\n}\u003e[]\n// Message: Use \"Array\u003cPromise\u003c{ foo: string, bar: number }\u003e\u003e\", not \"Promise\u003c{ foo: string, bar: number }\u003e[]\"\n\ntype X = Promise\u003c{\n    foo: string,\n    bar: number,\n    quo: boolean\n}\u003e[]\n// Message: Use \"Array\u003cType\u003e\", not \"Type[]\"\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = Array\u003cstring\u003e\n\n// Options: [\"verbose\"]\ntype X = Array\u003cstring\u003e\n\n// Options: [\"shorthand\"]\ntype X = string[]\n\ntype X = Array\u003cArray\u003cstring\u003e\u003e\n\n// Options: [\"verbose\"]\ntype X = (?string)[]\n\n// Options: [\"verbose\"]\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\ntype X = string[]\n\ntype X = Array\n\ntype X = typeof Array\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-arrow-parens\"\u003e\u003c/a\u003e\n### \u003ccode\u003earrow-parens\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nEnforces the consistent use of parentheses in arrow functions.\n\nThis rule has a string option and an object one.\n\nString options are:\n\n- `\"always\"` (default) requires parens around arguments in all cases.\n- `\"as-needed\"` enforces no braces where they can be omitted.\n\nObject properties for variants of the `\"as-needed\"` option:\n\n- `\"requireForBlockBody\": true` modifies the as-needed rule in order to require parens if the function body is in an instructions block (surrounded by braces).\n\nThe following patterns are considered problems:\n\n```js\na =\u003e {}\n// Message: undefined\n\na =\u003e a\n// Message: undefined\n\na =\u003e {\n}\n// Message: undefined\n\na.then(foo =\u003e {});\n// Message: undefined\n\na.then(foo =\u003e a);\n// Message: undefined\n\na(foo =\u003e { if (true) {}; });\n// Message: undefined\n\na(async foo =\u003e { if (true) {}; });\n// Message: undefined\n\n// Options: [\"as-needed\"]\n(a) =\u003e a\n// Message: undefined\n\n// Options: [\"as-needed\"]\n(a,) =\u003e a\n// Message: undefined\n\n// Options: [\"as-needed\"]\nasync (a) =\u003e a\n// Message: undefined\n\n// Options: [\"as-needed\"]\nasync(a) =\u003e a\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\na =\u003e {}\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a) =\u003e a\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync a =\u003e {}\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync (a) =\u003e a\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync(a) =\u003e a\n// Message: undefined\n```\n\nThe following patterns are not considered problems:\n\n```js\n() =\u003e {}\n\n(a) =\u003e {}\n\n(a) =\u003e a\n\n(a) =\u003e {\n}\n\na.then((foo) =\u003e {});\n\na.then((foo) =\u003e { if (true) {}; });\n\na.then(async (foo) =\u003e { if (true) {}; });\n\n// Options: [\"always\"]\n() =\u003e {}\n\n// Options: [\"always\"]\n(a) =\u003e {}\n\n// Options: [\"always\"]\n(a) =\u003e a\n\n// Options: [\"always\"]\n(a) =\u003e {\n}\n\n// Options: [\"always\"]\na.then((foo) =\u003e {});\n\n// Options: [\"always\"]\na.then((foo) =\u003e { if (true) {}; });\n\n// Options: [\"always\"]\na.then(async (foo) =\u003e { if (true) {}; });\n\n// Options: [\"as-needed\"]\n() =\u003e {}\n\n// Options: [\"as-needed\"]\na =\u003e {}\n\n// Options: [\"as-needed\"]\na =\u003e a\n\n// Options: [\"as-needed\"]\n([a, b]) =\u003e {}\n\n// Options: [\"as-needed\"]\n({ a, b }) =\u003e {}\n\n// Options: [\"as-needed\"]\n(a = 10) =\u003e {}\n\n// Options: [\"as-needed\"]\n(...a) =\u003e a[0]\n\n// Options: [\"as-needed\"]\n(a, b) =\u003e {}\n\n// Options: [\"as-needed\"]\nasync ([a, b]) =\u003e {}\n\n// Options: [\"as-needed\"]\nasync (a, b) =\u003e {}\n\n// Options: [\"as-needed\"]\n(a: T) =\u003e a\n\n// Options: [\"as-needed\"]\n(a): T =\u003e a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n() =\u003e {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\na =\u003e a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n([a, b]) =\u003e {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n([a, b]) =\u003e a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n({ a, b }) =\u003e {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n({ a, b }) =\u003e a + b\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a = 10) =\u003e {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(...a) =\u003e a[0]\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a, b) =\u003e {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\na =\u003e ({})\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync a =\u003e ({})\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync a =\u003e a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a: T) =\u003e a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a): T =\u003e a\n\n// Options: [\"always\",{\"requireForBlockBody\":true}]\n\u003cT\u003e(a: T) =\u003e a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":false}]\n\u003cT\u003e(a: T) =\u003e { return a; }\n\n// Options: [\"always\",{\"requireForBlockBody\":true}]\n\u003cT\u003e(a: T) =\u003e { return a; }\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n\u003cT\u003e(a: T) =\u003e { return a; }\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a): %checks =\u003e typeof a === \"number\"\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-boolean-style\"\u003e\u003c/a\u003e\n### \u003ccode\u003eboolean-style\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nEnforces a particular style for boolean type annotations. This rule takes one argument.\n\nIf it is `'boolean'` then a problem is raised when using `bool` instead of `boolean`.\n\nIf it is `'bool'` then a problem is raised when using `boolean` instead of `bool`.\n\nThe default value is `'boolean'`.\n\nThe following patterns are considered problems:\n\n```js\ntype X = bool\n// Message: Use \"boolean\", not \"bool\"\n\n// Options: [\"boolean\"]\ntype X = bool\n// Message: Use \"boolean\", not \"bool\"\n\n// Options: [\"bool\"]\ntype X = boolean\n// Message: Use \"bool\", not \"boolean\"\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = boolean\n\n// Options: [\"boolean\"]\ntype X = boolean\n\n// Options: [\"bool\"]\ntype X = bool\n\n// Options: [\"boolean\"]\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\ntype X = bool\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-define-flow-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003edefine-flow-type\u003c/code\u003e\n\nMarks Flow type identifiers as defined.\n\nUsed to suppress [`no-undef`](http://eslint.org/docs/rules/no-undef) reporting of type identifiers.\n\nThe following patterns are not considered problems:\n\n```js\nvar a: AType\n// Additional rules: {\"no-undef\":2}\n\nvar a: AType; var b: AType\n// Additional rules: {\"no-undef\":2}\n\nvar a; (a: AType)\n// Additional rules: {\"no-undef\":2}\n\nvar a: AType\u003cBType\u003e\n// Additional rules: {\"no-undef\":2}\n\ntype A = AType\n// Additional rules: {\"no-undef\":2}\n\ndeclare type A = number\n// Additional rules: {\"no-undef\":2}\n\nopaque type A = AType\n// Additional rules: {\"no-undef\":2}\n\nfunction f(a: AType) {}\n// Additional rules: {\"no-undef\":2}\n\nfunction f(a: AType.a) {}\n// Additional rules: {\"no-undef\":2}\n\nfunction f(a: AType.a.b) {}\n// Additional rules: {\"no-undef\":2}\n\nfunction f(a): AType {}; var a: AType\n// Additional rules: {\"no-undef\":2}\n\nfunction f(a): AType {}\n// Additional rules: {\"no-undef\":2}\n\nclass C { a: AType }\n// Additional rules: {\"no-undef\":2}\n\nclass C { a: AType.a }\n// Additional rules: {\"no-undef\":2}\n\nclass C { a: AType.a.b }\n// Additional rules: {\"no-undef\":2}\n\nclass C implements AType {}\n// Additional rules: {\"no-undef\":2}\n\ndeclare interface A {}\n// Additional rules: {\"no-undef\":2}\n\n({ a: ({b() {}}: AType) })\n// Additional rules: {\"no-undef\":2}\n\ntype X = {Y\u003cAType\u003e(): BType}\n// Additional rules: {\"no-undef\":2}\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\n\n/**\n* Copyright 2019 no corp\n* @flow\n*/\ntype Foo = $ReadOnly\u003c{}\u003e\n// Additional rules: {\"no-undef\":2}\n\nvar a: AType\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nvar a: AType; var b: AType\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nvar a; (a: AType)\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nvar a: AType\u003cBType\u003e\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\ntype A = AType\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\ndeclare type A = number\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nopaque type A = AType\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nfunction f(a: AType) {}\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nfunction f(a: AType.a) {}\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nfunction f(a: AType.a.b) {}\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nfunction f(a): AType {}; var a: AType\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nfunction f(a): AType {}\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nclass C { a: AType }\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nclass C { a: AType.a }\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nclass C { a: AType.a.b }\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\nclass C implements AType {}\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\ndeclare interface A {}\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\n({ a: ({b() {}}: AType) })\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\ntype X = {Y\u003cAType\u003e(): BType}\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\n\n/**\n* Copyright 2019 no corp\n* @flow\n*/\ntype Foo = $ReadOnly\u003c{}\u003e\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-delimiter-dangle\"\u003e\u003c/a\u003e\n### \u003ccode\u003edelimiter-dangle\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nEnforces consistent use of trailing commas in Object and Tuple annotations.\n\nThis rule takes three arguments where the possible values are the same as ESLint's default `comma-dangle` rule:\n\n1. The first argument is for Object and Tuple annotations. The default value is `'never'`.\n2. The second argument is used for Interface annotations. This defaults to the value of the first argument.\n3. The third argument is used for inexact object notation (trailing `...`). The default value is `'never'`.\n\nIf it is `'never'` then a problem is raised when there is a trailing comma.\n\nIf it is `'always'` then a problem is raised when there is no trailing comma.\n\nIf it is `'always-multiline'` then a problem is raised when there is no trailing comma on a multi-line definition, or there _is_ a trailing comma on a single-line definition.\n\nIf it is `'only-multiline'` then a problem is raised when there is a trailing comma on a single-line definition. It allows, but does not enforce, trailing commas on multi-line definitions.\n\nThe following patterns are considered problems:\n\n```js\ntype X = { foo: string, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = { foo: string, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = { foo: string; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = {\nfoo: string,\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always\"]\ntype X = { foo: string }\n// Message: Missing trailing delimiter\n\n// Options: [\"always\"]\ntype X = {\nfoo: string\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = { foo: string, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = {\nfoo: string\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"only-multiline\"]\ntype X = { foo: string; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always\",\"never\"]\ninterface X { foo: string; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = { [key: string]: number, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always\"]\ntype X = { [key: string]: number }\n// Message: Missing trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = { [key: string]: number, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = {\n[key: string]: number\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"only-multiline\"]\ntype X = { [key: string]: number; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = { [key: string]: number, foo: string, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = {\n[key: string]: number,\nfoo: string,\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = {\n[key: string]: number,\naReallyLongPropertyNameHere: string,\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always\"]\ntype X = { [key: string]: number, foo: string }\n// Message: Missing trailing delimiter\n\n// Options: [\"always\"]\ntype X = {\n[key: string]: number;\nfoo: string\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = { [key: string]: number, foo: string, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = {\n[key: string]: number,\nfoo: string\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"only-multiline\"]\ntype X = { [key: string]: number, foo: string, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = { foo: string, [key: string]: number, }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = {\nfoo: string,\n[key: string]: number,\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = {\naReallyLongPropertyNameHere: string,\n[key: string]: number,\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always\"]\ntype X = { foo: string, [key: string]: number }\n// Message: Missing trailing delimiter\n\n// Options: [\"always\"]\ntype X = { foo: string; [key: string]: number }\n// Message: Missing trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = { foo: string, [key: string]: number; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = {\nfoo: string,\n[key: string]: number\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"only-multiline\"]\ntype X = { foo: string, [key: string]: number; }\n// Message: Unexpected trailing delimiter\n\ntype X = { ..., }\n// Message: Unexpected trailing delimiter\n\ntype X = { ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = { ... }\n// Message: Missing trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { ...; }\n// Message: Unexpected trailing delimiter\n\ntype X = {\n...,\n}\n// Message: Unexpected trailing delimiter\n\ntype X = {\n...;\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\n...,\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\n...;\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\n...\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\n...\n}\n// Message: Missing trailing delimiter\n\ntype X = { foo: string, ..., }\n// Message: Unexpected trailing delimiter\n\ntype X = { foo: string; ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { foo: string, ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { foo: string; ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = { foo: string, ... }\n// Message: Missing trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { foo: string, ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { foo: string; ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { foo: string, ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { foo: string; ...; }\n// Message: Unexpected trailing delimiter\n\ntype X = {\nfoo: string,\n...,\n}\n// Message: Unexpected trailing delimiter\n\ntype X = {\nfoo: string;\n...;\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\nfoo: string,\n...,\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\nfoo: string;\n...;\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\nfoo: string,\n...\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\nfoo: string,\n...\n}\n// Message: Missing trailing delimiter\n\ntype X = { [key: string]: number, ..., }\n// Message: Unexpected trailing delimiter\n\ntype X = { [key: string]: number; ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { [key: string]: number, ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { [key: string]: number; ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = { [key: string]: number, ... }\n// Message: Missing trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { [key: string]: number, ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { [key: string]: number; ...; }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { [key: string]: number, ..., }\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { [key: string]: number; ...; }\n// Message: Unexpected trailing delimiter\n\ntype X = {\n[key: string]: number,\n...,\n}\n// Message: Unexpected trailing delimiter\n\ntype X = {\n[key: string]: number;\n...;\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\n[key: string]: number,\n...,\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\n[key: string]: number;\n...;\n}\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\n[key: string]: number,\n...\n}\n// Message: Missing trailing delimiter\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\n[key: string]: number,\n...\n}\n// Message: Missing trailing delimiter\n\ntype X = [string, number,]\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = [string, number,]\n// Message: Unexpected trailing delimiter\n\n// Options: [\"never\"]\ntype X = [\nstring,\nnumber,\n]\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always\"]\ntype X = [string, number]\n// Message: Missing trailing delimiter\n\n// Options: [\"always\"]\ntype X = [\nstring,\nnumber\n]\n// Message: Missing trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = [string, number,]\n// Message: Unexpected trailing delimiter\n\n// Options: [\"always-multiline\"]\ntype X = [\nfoo, string\n]\n// Message: Missing trailing delimiter\n\n// Options: [\"only-multiline\"]\ntype X = [ number, string, ]\n// Message: Unexpected trailing delimiter\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = { foo: string }\n\n// Options: [\"never\"]\ntype X = { foo: string }\n\n// Options: [\"always\"]\ntype X = { foo: string, }\n\n// Options: [\"always\"]\ntype X = { foo: string; }\n\n// Options: [\"never\"]\ntype X = {\nfoo: string\n}\n\n// Options: [\"always\"]\ntype X = {\nfoo: string,\n}\n\n// Options: [\"always-multiline\"]\ntype X = { foo: string }\n\n// Options: [\"always-multiline\"]\ntype X = {\nfoo: string,\n}\n\n// Options: [\"always-multiline\"]\ntype X = {\nfoo: string;\n}\n\n// Options: [\"only-multiline\"]\ntype X = { foo: string }\n\n// Options: [\"only-multiline\"]\ntype X = {\nfoo: string\n}\n\n// Options: [\"only-multiline\"]\ntype X = {\nfoo: string,\n}\n\n// Options: [\"only-multiline\"]\ntype X = {\nfoo: string;\n}\n\n// Options: [\"never\",\"always\"]\ninterface X { foo: string; }\n\n// Options: [\"never\"]\ntype X = {}\n\n// Options: [\"always\"]\ntype X = {}\n\n// Options: [\"always-multiline\"]\ntype X = {}\n\n// Options: [\"only-multiline\"]\ntype X = {}\n\n// Options: [\"never\"]\ntype X = { [key: string]: number }\n\n// Options: [\"always\"]\ntype X = { [key: string]: number, }\n\n// Options: [\"always\"]\ntype X = { [key: string]: number; }\n\n// Options: [\"always-multiline\"]\ntype X = { [key: string]: number }\n\n// Options: [\"always-multiline\"]\ntype X = {\n[key: string]: number,\n}\n\n// Options: [\"only-multiline\"]\ntype X = {\n[key: string]: number,\n}\n\n// Options: [\"only-multiline\"]\ntype X = {\n[key: string]: number\n}\n\n// Options: [\"only-multiline\"]\ntype X = { [key: string]: number }\n\n// Options: [\"never\"]\ntype X = { [key: string]: number, foo: string }\n\n// Options: [\"always\"]\ntype X = { [key: string]: number, foo: string, }\n\n// Options: [\"always\"]\ntype X = { [key: string]: number; foo: string; }\n\n// Options: [\"always-multiline\"]\ntype X = { [key: string]: number, foo: string }\n\n// Options: [\"always-multiline\"]\ntype X = {\n[key: string]: number,\nfoo: string,\n}\n\n// Options: [\"only-multiline\"]\ntype X = {\n[key: string]: number,\nfoo: string,\n}\n\n// Options: [\"only-multiline\"]\ntype X = {\n[key: string]: number;\nfoo: string\n}\n\n// Options: [\"only-multiline\"]\ntype X = { [key: string]: number, foo: string }\n\n// Options: [\"never\"]\ntype X = { foo: string, [key: string]: number }\n\n// Options: [\"always\"]\ntype X = { foo: string, [key: string]: number, }\n\n// Options: [\"always\"]\ntype X = { foo: string; [key: string]: number; }\n\n// Options: [\"always-multiline\"]\ntype X = { foo: string, [key: string]: number }\n\n// Options: [\"always-multiline\"]\ntype X = {\nfoo: string,\n[key: string]: number,\n}\n\n// Options: [\"only-multiline\"]\ntype X = {\nfoo: string,\n[key: string]: number,\n}\n\n// Options: [\"only-multiline\"]\ntype X = {\nfoo: string;\n[key: string]: number\n}\n\n// Options: [\"only-multiline\"]\ntype X = { foo: string, [key: string]: number }\n\ntype X = { ... }\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { ... }\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = { ..., }\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { ... }\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { ... }\n\ntype X = {\n...\n}\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\n...\n}\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\n...,\n }\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\n...;\n }\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\n...,\n}\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\n...;\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\n...\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\n...,\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\n...;\n}\n\ntype X = { foo: string, ... }\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { foo: string, ... }\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = { foo: string, ..., }\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = { foo: string; ...; }\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { foo: string, ... }\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { foo: string, ... }\n\ntype X = {\nfoo: string,\n...\n}\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\nfoo: string,\n...\n}\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\nfoo: string,\n...,\n}\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\nfoo: string;\n...;\n}\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\nfoo: string,\n...,\n}\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\nfoo: string;\n...;\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\nfoo: string,\n...\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\nfoo: string,\n...,\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\nfoo: string,\n...;\n}\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = { [key: string]: number, ... }\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = { [key: string]: number, ..., }\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = { [key: string]: number; ...; }\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = { [key: string]: number, ... }\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = { [key: string]: number, ... }\n\n// Options: [\"never\",\"never\",\"never\"]\ntype X = {\n[key: string]: number,\n...\n}\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\n[key: string]: number,\n...,\n}\n\n// Options: [\"never\",\"never\",\"always\"]\ntype X = {\n[key: string]: number;\n...;\n}\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\n[key: string]: number,\n...,\n}\n\n// Options: [\"never\",\"never\",\"always-multiline\"]\ntype X = {\n[key: string]: number;\n...;\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\n[key: string]: number,\n...\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\n[key: string]: number,\n...,\n}\n\n// Options: [\"never\",\"never\",\"only-multiline\"]\ntype X = {\n[key: string]: number;\n...;\n}\n\ntype X = [string, number]\n\n// Options: [\"never\"]\ntype X = [string, number]\n\n// Options: [\"never\"]\ntype X = [\nstring,\nnumber\n]\n\n// Options: [\"always\"]\ntype X = [string, number,]\n\n// Options: [\"always\"]\ntype X = [\nstring,\nnumber,\n]\n\n// Options: [\"always-multiline\"]\ntype X = [ foo, string ]\n\n// Options: [\"always-multiline\"]\ntype X = [\nfoo, string,\n]\n\n// Options: [\"only-multiline\"]\ntype X = [ number, string ]\n\n// Options: [\"only-multiline\"]\ntype X = [\nnumber,\nstring\n]\n\n// Options: [\"only-multiline\"]\ntype X = [\nnumber,\nstring,\n]\n\n// Options: [\"never\"]\ntype X = []\n\n// Options: [\"always\"]\ntype X = []\n\n// Options: [\"always-multiline\"]\ntype X = []\n\n// Options: [\"only-multiline\"]\ntype X = []\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-enforce-line-break\"\u003e\u003c/a\u003e\n### \u003ccode\u003eenforce-line-break\u003c/code\u003e\n\nThis rule enforces line breaks between type definitions.\n\nThe following patterns are considered problems:\n\n```js\ntype baz = 6;\nconst hi = 2;\n// Message: New line required below type declaration\n\nconst foo = 6;\ntype hi = 2;\n\n// Message: New line required above type declaration\n\nconst som = \"jes\";\n// a comment\ntype fed = \"hed\";\n\n// Message: New line required above type declaration\n\ntype som = \"jes\";\n// a comment\nconst fed = \"hed\";\n\n// Message: New line required below type declaration\n\ntype hello = 34;\nconst som = \"jes\";\ntype fed = \"hed\";\n\n// Message: New line required below type declaration\n// Message: New line required above type declaration\n\nconst a = 5;\nexport type hello = 34;\n\n// Message: New line required above type declaration\n\nconst a = 5;\n// a comment\nexport type hello = 34;\n\n// Message: New line required above type declaration\n\nconst a = 5;\n/**\n * a jsdoc block\n */\ntype hello = 34;\n// Message: New line required above type declaration\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype gjs = 6;\n\ntype gjs = 6;\n\ntype hi = 2;\n\n\ntype X = 4;\n\nconst red = \"serpent\";\nconsole.log(\"hello\");\n\n// number or string\ntype Y = string | number;\n\n// resting + sleep\ntype snooze = \"dreaming\" | \"\";\n\ntype Props = {\n  accountBalance: string | number,\n  accountNumber: string | number,\n};\n\nconst x = 4;\nconst y = 489;\n\n// Some Comment\ntype Props = {\n  accountBalance: string | number,\n  accountNumber: string | number,\n};\n\ntype RoadT = \"grass\" | \"gravel\" | \"cement\";\n\n// @flow\ntype A = string\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-generic-spacing\"\u003e\u003c/a\u003e\n### \u003ccode\u003egeneric-spacing\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nEnforces consistent spacing within generic type annotation parameters.\n\nThis rule takes one argument. If it is `'never'` then a problem is raised when there is a space surrounding the generic type parameters. If it is `'always'` then a problem is raised when there is no space surrounding the generic type parameters.\n\nThe default value is `'never'`.\n\nThe following patterns are considered problems:\n\n```js\ntype X = Promise\u003c string\u003e\n// Message: There must be no space at start of \"Promise\" generic type annotation\n\n// Options: [\"never\"]\ntype X = Promise\u003c  string\u003e\n// Message: There must be no space at start of \"Promise\" generic type annotation\n\ntype X = FooBar\u003cstring \u003e\n// Message: There must be no space at end of \"FooBar\" generic type annotation\n\ntype X = Promise\u003c string \u003e\n// Message: There must be no space at start of \"Promise\" generic type annotation\n// Message: There must be no space at end of \"Promise\" generic type annotation\n\ntype X = Promise\u003c (foo), bar, (((baz))) \u003e\n// Message: There must be no space at start of \"Promise\" generic type annotation\n// Message: There must be no space at end of \"Promise\" generic type annotation\n\n// Options: [\"always\"]\ntype X = Promise\u003cstring \u003e\n// Message: There must be a space at start of \"Promise\" generic type annotation\n\n// Options: [\"always\"]\ntype X = FooBar\u003c string\u003e\n// Message: There must be a space at end of \"FooBar\" generic type annotation\n\n// Options: [\"always\"]\ntype X = Promise\u003cstring\u003e\n// Message: There must be a space at start of \"Promise\" generic type annotation\n// Message: There must be a space at end of \"Promise\" generic type annotation\n\n// Options: [\"always\"]\ntype X = Promise\u003c(foo), bar, (((baz)))\u003e\n// Message: There must be a space at start of \"Promise\" generic type annotation\n// Message: There must be a space at end of \"Promise\" generic type annotation\n\n// Options: [\"always\"]\ntype X = FooBar\u003c  string \u003e\n// Message: There must be one space at start of \"FooBar\" generic type annotation\n\n// Options: [\"always\"]\ntype X = FooBar\u003c string  \u003e\n// Message: There must be one space at end of \"FooBar\" generic type annotation\n\n// Options: [\"always\"]\ntype X = Promise\u003c  (foo), bar, (((baz)))  \u003e\n// Message: There must be one space at start of \"Promise\" generic type annotation\n// Message: There must be one space at end of \"Promise\" generic type annotation\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = Promise\u003cstring\u003e\n\ntype X = Promise\u003c(string)\u003e\n\ntype X = Promise\u003c(foo), bar, (((baz)))\u003e\n\ntype X = Promise\u003c\n  (foo),\n  bar,\n  (((baz)))\n\u003e\n\ntype X =  Promise\u003c\r\n    (foo),\r\n    bar,\r\n    (((baz)))\r\n\u003e\n\n// Options: [\"always\"]\ntype X = Promise\u003c string \u003e\n\n// Options: [\"always\"]\ntype X = Promise\u003c (string) \u003e\n\n// Options: [\"always\"]\ntype X = Promise\u003c (foo), bar, (((baz))) \u003e\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-interface-id-match\"\u003e\u003c/a\u003e\n### \u003ccode\u003einterface-id-match\u003c/code\u003e\n\nEnforces a consistent naming pattern for interfaces.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-interface-id-match-options\"\u003e\u003c/a\u003e\n#### Options\n\nThis rule requires a text RegExp:\n\n```js\n{\n    \"rules\": {\n        \"flowtype/interface-id-match\": [\n            2,\n            \"^([A-Z][a-z0-9]*)+Type$\"\n        ]\n    }\n}\n```\n\n`'^([A-Z][a-z0-9]*)+Type$$'` is the default pattern.\n\nThe following patterns are considered problems:\n\n```js\ninterface foo{};\n// Message: Interface identifier 'foo' does not match pattern '/^([A-Z][a-z0-9]*)+Type$/u'.\n\n// Options: [\"^foo$\"]\ninterface FooType{};\n// Message: Interface identifier 'FooType' does not match pattern '/^foo$/u'.\n```\n\nThe following patterns are not considered problems:\n\n```js\ninterface FooType {};\n\n// Options: [\"^foo$\"]\ninterface foo {};\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\ninterface foo {};\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-newline-after-flow-annotation\"\u003e\u003c/a\u003e\n### \u003ccode\u003enewline-after-flow-annotation\u003c/code\u003e\n\nThis rule requires an empty line after the Flow annotation.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-newline-after-flow-annotation-options-1\"\u003e\u003c/a\u003e\n#### Options\n\nThe rule has a string option:\n\n* `\"always\"` (default): Enforces that `@flow` annotations be followed by an empty line, separated by newline (LF)\n* `\"always-windows\"`: Identical to \"always\", but will use a CRLF when autofixing\n* `\"never\"`: Enforces that `@flow` annotations are not followed by empty lines\n\n```js\n{\n  \"rules\": {\n    \"flowtype/newline-after-flow-annotation\": [\n      2,\n      \"always\"\n    ]\n  }\n}\n```\n\n\nThe following patterns are considered problems:\n\n```js\n// @flow\nimport Foo from './foo';\n// Message: Expected newline after flow annotation\n\n// Options: [\"always\"]\n// @flow\nimport Foo from './foo';\n// Message: Expected newline after flow annotation\n\n// Options: [\"always-windows\"]\n// @flow\r\nimport Foo from './foo';\n// Message: Expected newline after flow annotation\n\n// Options: [\"never\"]\n// @flow\n\n\n// Message: Expected no newline after flow annotation\n```\n\nThe following patterns are not considered problems:\n\n```js\n// Options: [\"always\"]\n// @flow\n\nimport Foo from './foo';\n\n// Options: [\"always-windows\"]\n// @flow\r\n\r\nimport Foo from './foo';\n\n// Options: [\"never\"]\n// @flow\nimport Foo from './foo';\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-dupe-keys\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-dupe-keys\u003c/code\u003e\n\nChecks for duplicate properties in Object annotations.\n\nThis rule mirrors ESLint's [no-dupe-keys](http://eslint.org/docs/rules/no-dupe-keys) rule.\n\n```js\n{\n    \"rules\": {\n        \"flowtype/no-dupe-keys\": 2\n    }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\ntype f = { a: number, b: string, a: number }\n// Message: Duplicate property.\n\ntype f = { a: number, b: string, a: string }\n// Message: Duplicate property.\n\ntype f = { get(key: \"a\"): string, get(key: \"a\"): string }\n// Message: Duplicate property.\n\ntype f = { get(key: 1): string, get(key: 1): string }\n// Message: Duplicate property.\n\ntype f = { get(key: 1.1): string, get(key: 1.1): string }\n// Message: Duplicate property.\n\ntype f = { get(key: true): string, get(key: true): string }\n// Message: Duplicate property.\n\ntype f = { get(key: {a: 1}): string, get(key: {a: 1}):string }\n// Message: Duplicate property.\n\nvar a = \"a\"; type f = { get(key: a): string, get(key: a): string }\n// Message: Duplicate property.\n\nvar b = 1; type f = { get(key: b): string, get(key: b): string }\n// Message: Duplicate property.\n\nvar c = true; type f = { get(key: c): string, get(key: c): string }\n// Message: Duplicate property.\n\nvar d = {}; type f = { get(key: d): string, get(key: d): string }\n// Message: Duplicate property.\n\nvar e = []; type f = { get(key: e): string, get(key: e): string }\n// Message: Duplicate property.\n\nvar e = [1, \"a\"]; type f = { get(key: e): string, get(key: e): string }\n// Message: Duplicate property.\n\nfunction fn() {}; type f = { get(key: fn): string, get(key: fn): string }\n// Message: Duplicate property.\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype FooType = { a: number, b: string, c: number }\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\ntype FooType = { a: number, b: string, a: number }\n\ntype f = { get(key: \"a\"): string, get(key: \"b\"): string }\n\ntype f = { get(key: 1): string, get(key: 2): string }\n\ntype f = { get(key: 1.1): string, get(key: 1.2): string }\n\ntype f = { get(key: true): string, get(key: false): string }\n\ntype f = { get(key: [\"a\", 1]): string, get(key: [\"a\", 2]): string }\n\ntype f = { get(key: [\"a\", [\"b\", 1]]): string, get(key: [\"a\", [\"b\", 2]]): string }\n\ntype f = { a: number, b: string, c: number }\n\ntype f = { get(key: \"a\"): string, get(key: \"b\"): string }\n\ntype f = { get(key: \"a\"): string, get(key: \"a\", key2: \"b\"): string }\n\ntype f = { get(key: \"a\"): string, get(key: 1): string }\n\ntype f = { get(key: { a: 1 }): string, get(key: { a: 2 }): string}\n\nvar a = {}; var b = {}; type f = { get(key: a): string, get(key: b): string }\n\nvar a = 1; var b = 1; type f = { get(key: a): string, get(key: b): string }\n\ntype a = { b: \u003cC\u003e(config: { ...C, key: string}) =\u003e C }\n\nexport interface Foo { get foo(): boolean; get bar(): string; }\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-duplicate-type-union-intersection-members\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-duplicate-type-union-intersection-members\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nChecks for duplicate members of a type union/intersection.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-duplicate-type-union-intersection-members-options-2\"\u003e\u003c/a\u003e\n#### Options\n\nYou can disable checking intersection types using `checkIntersections`.\n\n* `true` (default) - check for duplicate members of intersection members.\n* `false` - do not check for duplicate members of intersection members.\n\n```js\n{\n  \"rules\": {\n    \"flowtype/no-duplicate-type-union-intersection-members\": [\n      2,\n      {\n        \"checkIntersections\": true\n      }\n    ]\n  }\n}\n```\n\nYou can disable checking union types using `checkUnions`.\n\n* `true` (default) - check for duplicate members of union members.\n* `false` - do not check for duplicate members of union members.\n\n```js\n{\n  \"rules\": {\n    \"flowtype/no-duplicate-type-union-intersection-members\": [\n      2,\n      {\n        \"checkUnions\": true\n      }\n    ]\n  }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\ntype A = 1 | 2 | 3 | 1;\n// Message: Duplicate union member found \"1\".\n\ntype B = 'foo' | 'bar' | 'foo';\n// Message: Duplicate union member found \"'foo'\".\n\ntype C = A | B | A | B;\n// Message: Duplicate union member found \"A\".\n// Message: Duplicate union member found \"B\".\n\ntype C = A \u0026 B \u0026 A \u0026 B;\n// Message: Duplicate intersection member found \"A\".\n// Message: Duplicate intersection member found \"B\".\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype A = 1 | 2 | 3;\n\ntype B = 'foo' | 'bar';\n\ntype C = A | B;\n\ntype C = A \u0026 B;\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-existential-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-existential-type\u003c/code\u003e\n\nDisallows use of the existential type (*). [See more](https://flow.org/en/docs/types/utilities/#toc-existential-type)\n\n```js\n{\n  \"rules\": {\n    \"flowtype/no-existential-type\": 2\n  }\n}\n```\n\n\nThe following patterns are considered problems:\n\n```js\ntype T = *;\n// Message: Unexpected use of existential type (*).\n\ntype T = U\u003c*, *\u003e;\n// Message: Unexpected use of existential type (*).\n// Message: Unexpected use of existential type (*).\n\nconst f: (*) =\u003e null = () =\u003e null;\n// Message: Unexpected use of existential type (*).\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype T = string | null\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-flow-fix-me-comments\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-flow-fix-me-comments\u003c/code\u003e\n\nDisallows `$FlowFixMe` comment suppressions.\n\nThis is especially useful as a warning to ensure instances of `$FlowFixMe` in your codebase get fixed over time.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-flow-fix-me-comments-options-3\"\u003e\u003c/a\u003e\n#### Options\n\nThis rule takes an optional RegExp that comments a text RegExp that makes the supression valid.\n\n```js\n{\n    \"rules\": {\n        \"flowtype/no-flow-fix-me-comments\": [\n            1,\n            \"TODO\\s+[0-9]+\"\n        ]\n    }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\n// $FlowFixMe I am doing something evil here\nconst text = 'HELLO';\n// Message: $FlowFixMe is treated as `any` and must be fixed.\n\n// Options: [\"TODO [0-9]+\"]\n// $FlowFixMe I am doing something evil here\nconst text = 'HELLO';\n// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.\n\n// Options: [\"TODO [0-9]+\"]\n// $FlowFixMe TODO abc 47 I am doing something evil here\nconst text = 'HELLO';\n// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.\n\n// $$FlowFixMeProps I am doing something evil here\nconst text = 'HELLO';\n// Message: $FlowFixMe is treated as `any` and must be fixed.\n\n// Options: [\"TODO [0-9]+\"]\n// $FlowFixMeProps I am doing something evil here\nconst text = 'HELLO';\n// Message: $FlowFixMe is treated as `any` and must be fixed. Fix it or match `/TODO [0-9]+/u`.\n```\n\nThe following patterns are not considered problems:\n\n```js\nconst text = 'HELLO';\n\n// Options: [\"TODO [0-9]+\"]\n// $FlowFixMe TODO 48\nconst text = 'HELLO';\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-internal-flow-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-internal-flow-type\u003c/code\u003e\n\nWarns against using internal Flow types such as `React$Node`, `React$Ref` and others and suggests using public alternatives instead (`React.Node`, `React.Ref`, …).\n\nThe following patterns are considered problems:\n\n```js\ntype X = React$AbstractComponent\u003cConfig, Instance\u003e\n// Message: Type identifier 'React$AbstractComponent' is not allowed. Use 'React.AbstractComponent' instead.\n\ntype X = React$ChildrenArray\u003cstring\u003e\n// Message: Type identifier 'React$ChildrenArray' is not allowed. Use 'React.ChildrenArray' instead.\n\ntype X = React$ComponentType\u003cProps\u003e\n// Message: Type identifier 'React$ComponentType' is not allowed. Use 'React.ComponentType' instead.\n\ntype X = React$Config\u003cProsp, DefaultProps\u003e\n// Message: Type identifier 'React$Config' is not allowed. Use 'React.Config' instead.\n\ntype X = React$Element\u003ctypeof Component\u003e\n// Message: Type identifier 'React$Element' is not allowed. Use 'React.Element' instead.\n\ntype X = React$ElementConfig\u003ctypeof Component\u003e\n// Message: Type identifier 'React$ElementConfig' is not allowed. Use 'React.ElementConfig' instead.\n\ntype X = React$ElementProps\u003ctypeof Component\u003e\n// Message: Type identifier 'React$ElementProps' is not allowed. Use 'React.ElementProps' instead.\n\ntype X = React$ElementRef\u003ctypeof Component\u003e\n// Message: Type identifier 'React$ElementRef' is not allowed. Use 'React.ElementRef' instead.\n\ntype X = React$ElementType\n// Message: Type identifier 'React$ElementType' is not allowed. Use 'React.ElementType' instead.\n\ntype X = React$Key\n// Message: Type identifier 'React$Key' is not allowed. Use 'React.Key' instead.\n\ntype X = React$Node\n// Message: Type identifier 'React$Node' is not allowed. Use 'React.Node' instead.\n\ntype X = React$Ref\u003ctypeof Component\u003e\n// Message: Type identifier 'React$Ref' is not allowed. Use 'React.Ref' instead.\n\ntype X = React$StatelessFunctionalComponent\u003cProps\u003e\n// Message: Type identifier 'React$StatelessFunctionalComponent' is not allowed. Use 'React.StatelessFunctionalComponent' instead.\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = React.AbstractComponent\u003cConfig, Instance\u003e\n\ntype X = React.ChildrenArray\u003cstring\u003e\n\ntype X = React.ComponentType\u003cProps\u003e\n\ntype X = React.Config\u003cProps, DefaultProps\u003e\n\ntype X = React.Element\u003ctypeof Component\u003e\n\ntype X = React.ElementConfig\u003ctypeof Component\u003e\n\ntype X = React.ElementProps\u003ctypeof Component\u003e\n\ntype X = React.ElementRef\u003ctypeof Component\u003e\n\ntype X = React.ElementType\n\ntype X = React.Key\n\ntype X = React.Node\n\ntype X = React.Ref\u003ctypeof Component\u003e\n\ntype X = React.StatelessFunctionalComponent\u003cProps\u003e\n\ntype X = React$Rocks\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-mixed\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-mixed\u003c/code\u003e\n\nWarns against \"mixed\" type annotations.\nThese types are not strict enough and could often be made more specific.\n\nThe following patterns are considered problems:\n\nThe following patterns are considered problems:\n\n```js\nfunction foo(thing): mixed {}\n// Message: Unexpected use of mixed type\n\nfunction foo(thing): Promise\u003cmixed\u003e {}\n// Message: Unexpected use of mixed type\n\nfunction foo(thing): Promise\u003cPromise\u003cmixed\u003e\u003e {}\n// Message: Unexpected use of mixed type\n```\n\nThe following patterns are not considered problems:\n\n```js\nfunction foo(thing): string {}\n\nfunction foo(thing): Promise\u003cstring\u003e {}\n\nfunction foo(thing): Promise\u003cPromise\u003cstring\u003e\u003e {}\n\n(foo?: string) =\u003e {}\n\n(foo: ?string) =\u003e {}\n\n(foo: { a: string }) =\u003e {}\n\n(foo: { a: ?string }) =\u003e {}\n\n(foo: string[]) =\u003e {}\n\ntype Foo = string\n\ntype Foo = { a: string }\n\ntype Foo = { (a: string): string }\n\nfunction foo(thing: string) {}\n\nvar foo: string\n\nclass Foo { props: string }\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-mutable-array\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-mutable-array\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nRequires use of [`$ReadOnlyArray`](https://github.com/facebook/flow/blob/v0.46.0/lib/core.js#L185) instead of just `Array` or array [shorthand notation](https://flow.org/en/docs/types/arrays/#toc-array-type-shorthand-syntax). `$ReadOnlyArray` is immutable array collection type and the superclass of Array and tuple types in Flow. Use of `$ReadOnlyArray` instead of `Array` can solve some \"problems\" in typing with Flow (e.g., [1](https://github.com/facebook/flow/issues/3425), [2](https://github.com/facebook/flow/issues/4251)).\n\nGeneral reasons for using immutable data structures:\n\n* They are simpler to construct, test, and use\n* They help to avoid temporal coupling\n* Their usage is side-effect free (no defensive copies)\n* Identity mutability problem is avoided\n* They always have failure atomicity\n* They are much easier to cache\n\nNote that initialization of a variable with an empty array is considered valid (e.g., `const values: Array\u003cstring\u003e = [];`). This behavior resembles the behavior of Flow's [unsealed objects](https://flow.org/en/docs/types/objects/#toc-unsealed-objects), as it is assumed that empty array is intended to be mutated.\n\nThe following patterns are considered problems:\n\n```js\ntype X = Array\u003cstring\u003e\n// Message: Use \"$ReadOnlyArray\" instead of \"Array\"\n\ntype X = string[]\n// Message: Use \"$ReadOnlyArray\" instead of array shorthand notation\n\nconst values: Array\u003cArray\u003cstring\u003e\u003e = [];\n// Message: Use \"$ReadOnlyArray\" instead of \"Array\"\n\nlet values: Array\u003cArray\u003cstring\u003e\u003e;\n// Message: Use \"$ReadOnlyArray\" instead of \"Array\"\n// Message: Use \"$ReadOnlyArray\" instead of \"Array\"\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = $ReadOnlyArray\u003cstring\u003e\n\nconst values: Array\u003c$ReadOnlyArray\u003cstring\u003e\u003e = [];\n\nconst values: $ReadOnlyArray\u003cstring\u003e[] = [];\n\nconst values: Array\u003c$ReadOnlyArray\u003cstring\u003e\u003e = new Array();\n\nconst values: Array\u003c$ReadOnlyArray\u003cstring\u003e\u003e = Array();\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-primitive-constructor-types\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-primitive-constructor-types\u003c/code\u003e\n\nDisallows use of primitive constructors as types, such as `Boolean`, `Number` and `String`. [See more](https://flowtype.org/docs/builtins.html).\n\n```js\n{\n    \"rules\": {\n        \"flowtype/no-primitive-constructor-types\": 2\n    }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\ntype x = Number\n// Message: Unexpected use of Number constructor type.\n\ntype x = String\n// Message: Unexpected use of String constructor type.\n\ntype x = Boolean\n// Message: Unexpected use of Boolean constructor type.\n\ntype x = { a: Number }\n// Message: Unexpected use of Number constructor type.\n\ntype x = { a: String }\n// Message: Unexpected use of String constructor type.\n\ntype x = { a: Boolean }\n// Message: Unexpected use of Boolean constructor type.\n\n(x: Number) =\u003e {}\n// Message: Unexpected use of Number constructor type.\n\n(x: String) =\u003e {}\n// Message: Unexpected use of String constructor type.\n\n(x: Boolean) =\u003e {}\n// Message: Unexpected use of Boolean constructor type.\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype x = number\n\ntype x = string\n\ntype x = boolean\n\ntype x = { a: number }\n\ntype x = { a: string }\n\ntype x = { a: boolean }\n\n(x: number) =\u003e {}\n\n(x: string) =\u003e {}\n\n(x: boolean) =\u003e {}\n\ntype x = MyNumber\n\ntype x = MyString\n\ntype x = MyBoolean\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-types-missing-file-annotation\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-types-missing-file-annotation\u003c/code\u003e\n\nDisallows Flow type imports, aliases, and annotations in files missing a valid Flow file declaration (or a @noflow annotation).\n\n```js\n{\n    \"rules\": {\n        \"flowtype/no-types-missing-file-annotation\": 2\n    }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\nconst x: number = 42;\n// Message: Type annotations require valid Flow declaration.\n\ntype FooType = number;\n// Message: Type aliases require valid Flow declaration.\n\nimport type A from \"a\"\n// Message: Type imports require valid Flow declaration.\n\nimport type {A} from \"a\"\n// Message: Type imports require valid Flow declaration.\n\nimport {type A} from \"a\"\n// Message: Type imports require valid Flow declaration.\n\nexport type {A} from \"a\"\n// Message: Type exports require valid Flow declaration.\n\nfunction t\u003cT\u003e(): T{}\n// Message: Type annotations require valid Flow declaration.\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\nconst x: number = 42;\n// Message: Type annotations require valid Flow declaration.\n```\n\nThe following patterns are not considered problems:\n\n```js\n// @flow\nconst x: number = 42;\n\n/* @flow weak */\ntype FooType = number;\n\n/* @noflow */\ntype FooType = number;\n\n/* @noflow */\nimport type A from \"a\"\n\n/* @noflow */\nimport {type A} from \"a\"\n\n/* @noflow */\nexport type {A} from \"a\"\n\n// an unrelated comment\n// @flow\nexport type {A} from \"a\"\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-unused-expressions\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-unused-expressions\u003c/code\u003e\n\nAn extension of [ESLint's `no-unused-expressions`](https://eslint.org/docs/rules/no-unused-expressions).\nThis rule ignores type cast expressions and optional call expressions, but otherwise behaves the same as ESLint's\n`no-unused-expressions`.\n\nBare type casts are useful, for example to assert the exhaustiveness of a `switch`:\n\n```js\ntype Action\n  = { type: 'FOO', doFoo: (_: number) =\u003e void }\n  | { type: 'BAR', doBar: (_: string) =\u003e void };\n\ntype State = { foo: number, bar: string };\n\nfunction runFooBar(action: Action, state: State): void {\n  switch (action.type) {\n    case 'FOO':\n      doFoo(state.foo);\n      break;\n    case 'BAR':\n      doBar(state.bar);\n      break;\n    default:\n      (action: empty);  // type error when `Action` is extended with new types\n      console.error(`Impossible action: ${action.toString()}`);\n  }\n}\n```\n\nThis rule takes the same arguments as ESLint's `no-unused-expressions`. See\n[that rule's documentation](https://eslint.org/docs/rules/no-unused-expressions) for details.\n\nThe following patterns are considered problems:\n\n```js\nfoo + 1\n// Message: Expected an assignment or function call and instead saw an expression.\n\nx?.y\n// Message: Expected an assignment or function call and instead saw an expression.\n```\n\nThe following patterns are not considered problems:\n\n```js\n(foo: number)\n\nx?.y()\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-no-weak-types\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-weak-types\u003c/code\u003e\n\nWarns against weak type annotations *any*, *Object* and *Function*.\nThese types can cause flow to silently skip over portions of your code,\nwhich would have otherwise caused type errors.\n\nThis rule optionally takes one argument, an object to configure which type warnings to enable. By default, all of the\nwarnings are enabled. e.g. to disable the `any` warning (allowing it to exist in your code), while continuing to warn\nabout `Object` and `Function`:\n\n```js\n{\n    \"rules\": {\n        \"flowtype/no-weak-types\": [2, {\n            \"any\": false,\n            \"Object\": true,\n            \"Function\": true\n        }]\n    }\n}\n\n// or, the following is equivalent as default is true:\n\n{\n    \"rules\": {\n        \"flowtype/no-weak-types\": [2, {\n            \"any\": false\n        }]\n    }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\nfunction foo(thing): any {}\n// Message: Unexpected use of weak type \"any\"\n\nfunction foo(thing): Promise\u003cany\u003e {}\n// Message: Unexpected use of weak type \"any\"\n\nfunction foo(thing): Promise\u003cPromise\u003cany\u003e\u003e {}\n// Message: Unexpected use of weak type \"any\"\n\nfunction foo(thing): Object {}\n// Message: Unexpected use of weak type \"Object\"\n\nfunction foo(thing): Promise\u003cObject\u003e {}\n// Message: Unexpected use of weak type \"Object\"\n\nfunction foo(thing): Promise\u003cPromise\u003cObject\u003e\u003e {}\n// Message: Unexpected use of weak type \"Object\"\n\nfunction foo(thing): Function {}\n// Message: Unexpected use of weak type \"Function\"\n\nfunction foo(thing): Promise\u003cFunction\u003e {}\n// Message: Unexpected use of weak type \"Function\"\n\nfunction foo(thing): Promise\u003cPromise\u003cFunction\u003e\u003e {}\n// Message: Unexpected use of weak type \"Function\"\n\n(foo: any) =\u003e {}\n// Message: Unexpected use of weak type \"any\"\n\n(foo: Function) =\u003e {}\n// Message: Unexpected use of weak type \"Function\"\n\n(foo?: any) =\u003e {}\n// Message: Unexpected use of weak type \"any\"\n\n(foo?: Function) =\u003e {}\n// Message: Unexpected use of weak type \"Function\"\n\n(foo: { a: any }) =\u003e {}\n// Message: Unexpected use of weak type \"any\"\n\n(foo: { a: Object }) =\u003e {}\n// Message: Unexpected use of weak type \"Object\"\n\n(foo: any[]) =\u003e {}\n// Message: Unexpected use of weak type \"any\"\n\ntype Foo = any\n// Message: Unexpected use of weak type \"any\"\n\ntype Foo = Function\n// Message: Unexpected use of weak type \"Function\"\n\ntype Foo = { a: any }\n// Message: Unexpected use of weak type \"any\"\n\ntype Foo = { a: Object }\n// Message: Unexpected use of weak type \"Object\"\n\ntype Foo = { (a: Object): string }\n// Message: Unexpected use of weak type \"Object\"\n\ntype Foo = { (a: string): Function }\n// Message: Unexpected use of weak type \"Function\"\n\nfunction foo(thing: any) {}\n// Message: Unexpected use of weak type \"any\"\n\nfunction foo(thing: Object) {}\n// Message: Unexpected use of weak type \"Object\"\n\nvar foo: Function\n// Message: Unexpected use of weak type \"Function\"\n\nvar foo: Object\n// Message: Unexpected use of weak type \"Object\"\n\nclass Foo { props: any }\n// Message: Unexpected use of weak type \"any\"\n\nclass Foo { props: Object }\n// Message: Unexpected use of weak type \"Object\"\n\nvar foo: any\n// Message: Unexpected use of weak type \"any\"\n\n// Options: [{\"Function\":false}]\ntype X = any; type Y = Function; type Z = Object\n// Message: Unexpected use of weak type \"any\"\n// Message: Unexpected use of weak type \"Object\"\n\n// Options: [{\"any\":false,\"Object\":false}]\ntype X = any; type Y = Function; type Z = Object\n// Message: Unexpected use of weak type \"Function\"\n```\n\nThe following patterns are not considered problems:\n\n```js\nfunction foo(thing): string {}\n\nfunction foo(thing): Promise\u003cstring\u003e {}\n\nfunction foo(thing): Promise\u003cPromise\u003cstring\u003e\u003e {}\n\n(foo?: string) =\u003e {}\n\n(foo: ?string) =\u003e {}\n\n(foo: { a: string }) =\u003e {}\n\n(foo: { a: ?string }) =\u003e {}\n\n(foo: string[]) =\u003e {}\n\ntype Foo = string\n\ntype Foo = { a: string }\n\ntype Foo = { (a: string): string }\n\nfunction foo(thing: string) {}\n\nvar foo: string\n\nclass Foo { props: string }\n\n// Options: [{\"any\":false,\"Object\":false}]\ntype X = any; type Y = Object\n\n// Options: [{\"Function\":false}]\ntype X = Function\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\nfunction foo(thing): Function {}\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-object-type-curly-spacing\"\u003e\u003c/a\u003e\n### \u003ccode\u003eobject-type-curly-spacing\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nThis rule enforces consistent spacing inside braces of object types.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-object-type-curly-spacing-options-4\"\u003e\u003c/a\u003e\n#### Options\n\nThe rule has a string option:\n\n* `\"never\"` (default): disallows spacing inside of braces.\n* `\"always\"`: requires spacing inside of braces.\n\n\nThe following patterns are considered problems:\n\n```js\ntype obj = { \"foo\": \"bar\" }\n// Message: There must be no space after \"{\".\n// Message: There must be no space before \"}\".\n\ntype obj = {\"foo\": \"bar\" }\n// Message: There must be no space before \"}\".\n\ntype obj = {\"foo\": \"bar\", ... }\n// Message: There must be no space before \"}\".\n\ntype obj = {|\"foo\": \"bar\" |}\n// Message: There must be no space before \"|}\".\n\ntype obj = {\"foo\": \"bar\", [key: string]: string }\n// Message: There must be no space before \"}\".\n\ntype obj = {\n\"foo\": \"bar\", [key: string]: string }\n// Message: There must be no space before \"}\".\n\ntype obj = { baz: {\"foo\": \"qux\"}, bar: 4}\n// Message: There must be no space after \"{\".\n\n// Options: [\"always\"]\ntype obj = {\"foo\": \"bar\"}\n// Message: A space is required after \"{\".\n// Message: A space is required before \"}\".\n\n// Options: [\"always\"]\ntype obj = {\"foo\": \"bar\" }\n// Message: A space is required after \"{\".\n\n// Options: [\"always\"]\ntype obj = { baz: {\"foo\": \"qux\"}, bar: 4}\n// Message: A space is required before \"}\".\n// Message: A space is required after \"{\".\n// Message: A space is required before \"}\".\n\n// Options: [\"always\"]\ntype obj = { baz: { \"foo\": \"qux\" }, bar: 4}\n// Message: A space is required before \"}\".\n\n// Options: [\"always\"]\ntype obj = { \"foo\": \"bar\", ...}\n// Message: A space is required before \"}\".\n\n// Options: [\"always\"]\ntype obj = {|\"foo\": \"bar\" |}\n// Message: A space is required after \"{|\".\n\n// Options: [\"always\"]\ntype obj = {\"foo\": \"bar\", [key: string]: string }\n// Message: A space is required after \"{\".\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype obj = {baz: {\"foo\": \"qux\"}, bar: 4}\n\ntype obj = {foo: {\"foo\": \"qux\"}}\n\ntype obj = {foo: \"bar\"}\n\ntype obj = {foo: \"bar\"\n}\n\ntype obj = {\nfoo: \"bar\"}\n\ntype obj = {\nfoo: \"bar\"\n}\n\ntype obj = {\nfoo: \"bar\",\nee: \"bar\",\n}\n\ntype obj = {\nfoo: \"bar\",\nee: \"bar\",\n             }\n\ntype obj = {|\"foo\": \"bar\"|}\n\ntype obj = {\"foo\": \"bar\", [key: string]: string}\n\n// Options: [\"always\"]\ntype obj = { baz: { \"foo\": \"qux\" }, bar: 4 }\n\n// Options: [\"always\"]\ntype obj = {}\n\n// Options: [\"always\"]\ntype obj = {\nfoo: \"bar\"\n}\n\n// Options: [\"always\"]\ntype obj = { baz: 4 }\n\n// Options: [\"always\"]\ntype obj = {| \"foo\": \"bar\" |}\n\n// Options: [\"always\"]\ntype obj = { \"foo\": \"bar\", [key: string]: string }\n\n// Options: [\"always\"]\ntype obj = {  baz: { \"foo\": \"qux\" }, bar: 4  }\n\n// Options: [\"always\"]\ntype obj = {\n  baz: { \"foo\": \"qux\" }, bar: 4\n}\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-object-type-delimiter\"\u003e\u003c/a\u003e\n### \u003ccode\u003eobject-type-delimiter\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nEnforces consistent separators between properties in Flow object types.\n\nThis rule takes one argument.\n\nIf it is `'comma'` then a problem is raised when using `;` as a separator.\n\nIf it is `'semicolon'` then a problem is raised when using `,` as a separator.\n\nThe default value is `'comma'`.\n\n_This rule is ported from `babel/flow-object-type`, however the default option was changed._\n\nThe following patterns are considered problems:\n\n```js\n// Options: [\"semicolon\"]\ntype Foo = { a: Foo, b: Bar }\n// Message: Prefer semicolons to commas in object and class types\n\n// Options: [\"comma\"]\ntype Foo = { a: Foo; b: Bar }\n// Message: Prefer commas to semicolons in object and class types\n\n// Options: [\"semicolon\"]\ntype Foo = { [a: string]: Foo, [b: string]: Bar }\n// Message: Prefer semicolons to commas in object and class types\n\n// Options: [\"comma\"]\ntype Foo = { [a: string]: Foo; [b: string]: Bar }\n// Message: Prefer commas to semicolons in object and class types\n\n// Options: [\"semicolon\"]\ntype Foo = { (): Foo, (): Bar }\n// Message: Prefer semicolons to commas in object and class types\n\n// Options: [\"comma\"]\ntype Foo = { (): Foo; (): Bar }\n// Message: Prefer commas to semicolons in object and class types\n\n// Options: [\"semicolon\"]\ndeclare class Foo { a: Foo, }\n// Message: Prefer semicolons to commas in object and class types\n\n// Options: [\"comma\"]\ndeclare class Foo { a: Foo; }\n// Message: Prefer commas to semicolons in object and class types\n\n// Options: [\"semicolon\"]\ndeclare class Foo { [a: string]: Foo, }\n// Message: Prefer semicolons to commas in object and class types\n\n// Options: [\"comma\"]\ndeclare class Foo { a: Foo; }\n// Message: Prefer commas to semicolons in object and class types\n\n// Options: [\"semicolon\"]\ndeclare class Foo { (): Foo, }\n// Message: Prefer semicolons to commas in object and class types\n\n// Options: [\"comma\"]\ndeclare class Foo { (): Foo; }\n// Message: Prefer commas to semicolons in object and class types\n\n// Options: [\"semicolon\"]\ndeclare class Foo { static (): Foo, }\n// Message: Prefer semicolons to commas in object and class types\n\n// Options: [\"comma\"]\ndeclare class Foo { static (): Foo; }\n// Message: Prefer commas to semicolons in object and class types\n```\n\nThe following patterns are not considered problems:\n\n```js\n// Options: [\"semicolon\"]\ntype Foo = { a: Foo; b: Bar }\n\n// Options: [\"comma\"]\ntype Foo = { a: Foo, b: Bar }\n\n// Options: [\"semicolon\"]\ntype Foo = { [a: string]: Foo; [b: string]: Bar }\n\n// Options: [\"comma\"]\ntype Foo = { [a: string]: Foo, [b: string]: Bar }\n\n// Options: [\"semicolon\"]\ntype Foo = { (): Foo; (): Bar }\n\n// Options: [\"comma\"]\ntype Foo = { (): Foo, (): Bar }\n\ntype Foo = { a: Foo, b: Bar }\n\ntype Foo = { [a: string]: Foo, [b: string]: Bar }\n\ntype Foo = { (): Foo, (): Bar }\n\n// Options: [\"semicolon\"]\ndeclare class Foo { a: Foo; }\n\n// Options: [\"comma\"]\ndeclare class Foo { a: Foo, }\n\n// Options: [\"semicolon\"]\ndeclare class Foo { [a: string]: Foo; }\n\n// Options: [\"comma\"]\ndeclare class Foo { [a: string]: Foo, }\n\n// Options: [\"semicolon\"]\ndeclare class Foo { (): Foo; }\n\n// Options: [\"comma\"]\ndeclare class Foo { (): Foo, }\n\n// Options: [\"semicolon\"]\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\ntype Foo = { a: Foo, b: Bar }\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-quotes\"\u003e\u003c/a\u003e\n### \u003ccode\u003equotes\u003c/code\u003e\n\nEnforces single quotes or double quotes around string literals.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-quotes-options-5\"\u003e\u003c/a\u003e\n#### Options\n\nThe rule has string options of:\n\n* `\"double\"` (default) requires double quotes around string literals.\n* `\"single\"` requires single quotes around string literals.\n\nThe following patterns are considered problems:\n\n```js\ntype T = 'hi'\n// Message: String literals must use double quote.\n\n// Options: [\"double\"]\ntype T = { test: 'hello' | 'test' }\n// Message: String literals must use double quote.\n// Message: String literals must use double quote.\n\n// Options: [\"double\"]\ntype T = { test: \"hello\" | 'test', t: 'hello' }\n// Message: String literals must use double quote.\n// Message: String literals must use double quote.\n\n// Options: [\"single\"]\ntype T = \"hi\"\n// Message: String literals must use single quote.\n\n// Options: [\"single\"]\ntype T = { test: \"hello\" | \"test\" }\n// Message: String literals must use single quote.\n// Message: String literals must use single quote.\n\n// Options: [\"single\"]\ntype T = { test: \"hello\" | 'test', t: 'hello' }\n// Message: String literals must use single quote.\n```\n\nThe following patterns are not considered problems:\n\n```js\n// Options: [\"double\"]\ntype T = \"hi\"\n\n// Options: [\"double\"]\ntype T = { test: \"hello\" | \"test\" }\n\n// Options: [\"double\"]\ntype T = { test: \"hello\" | \"test\", t: \"hello\" }\n\n// Options: [\"single\"]\ntype FooType = 'hi'\n\n// Options: [\"single\"]\ntype T = { test: 'hello' | 'test' }\n\n// Options: [\"single\"]\ntype T = { test: 'hello' | 'test', t: 'hello' }\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-compound-type-alias\"\u003e\u003c/a\u003e\n### \u003ccode\u003erequire-compound-type-alias\u003c/code\u003e\n\nRequires to make a type alias for all [union](https://flow.org/en/docs/types/unions/) and [intersection](https://flow.org/en/docs/types/intersections/) types. If these are used in \"raw\" forms it might be tempting to just copy \u0026 paste them around the code. However, this brings sort of a source code pollution and unnecessary changes on several parts when these compound types need to be changed.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-compound-type-alias-options-6\"\u003e\u003c/a\u003e\n#### Options\n\nThe rule has two options:\n\n1. a string option\n\n* `\"always\"` (default)\n* `\"never\"`\n\n2. an object\n\n```js\n{\n  \"rules\": {\n    \"flowtype/require-compound-type-alias\": [\n      2,\n      \"always\",\n      {\n        \"allowNull\": true\n      }\n    ]\n  }\n}\n```\n\n* `allowNull` – allows compound types where one of the members is a `null`, e.g. `string | null`.\n\nThe following patterns are considered problems:\n\n```js\n// Options: [\"always\",{\"allowNull\":false}]\nconst foo: string | null = null;\n// Message: All union types must be declared with named type alias.\n\nfunction foo(bar: \"A\" | \"B\") {}\n// Message: All union types must be declared with named type alias.\n\nconst foo: \"A\" | \"B\" = \"A\";\n// Message: All union types must be declared with named type alias.\n\ntype Foo = { bar: \"A\" | \"B\" };\n// Message: All union types must be declared with named type alias.\n\nfunction foo(bar: { n: number } | { s: string }) {}\n// Message: All union types must be declared with named type alias.\n\nfunction foo(bar: { n: number } \u0026 { s: string }) {}\n// Message: All intersection types must be declared with named type alias.\n\nconst foo: { n: number } \u0026 { s: string } = { n: 0, s: \"\" };\n// Message: All intersection types must be declared with named type alias.\n\ntype Foo = { bar: { n: number } \u0026 { s: string } };\n// Message: All intersection types must be declared with named type alias.\n\nfunction foo(bar: { n: number } \u0026 { s: string }) {}\n// Message: All intersection types must be declared with named type alias.\n```\n\nThe following patterns are not considered problems:\n\n```js\nconst foo: string | null = null;\n\n// Options: [\"always\",{\"allowNull\":true}]\nconst foo: string | null = null;\n\ntype Foo = \"A\" | \"B\";\n\ntype Bar = \"A\" | \"B\"; function foo(bar: Bar) {}\n\ntype Foo = { disjoint: \"A\", n: number } | { disjoint: \"B\", s: string };\n\ntype Foo = { n: number } \u0026 { s: string };\n\ntype Bar = { n: number } \u0026 { s: string }; function foo(bar: Bar) {}\n\n// Options: [\"never\"]\nfunction foo(bar: \"A\" | \"B\") {}\n\n// Options: [\"never\"]\nfunction foo(bar: { n: number } \u0026 { s: string }) {}\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-exact-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003erequire-exact-type\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nThis rule enforces [exact object types](https://flow.org/en/docs/types/objects/#toc-exact-object-types).\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-exact-type-options-7\"\u003e\u003c/a\u003e\n#### Options\n\nThe rule has one string option:\n\n* `\"always\"` (default): Report all object type definitions that aren't exact.\n* `\"never\"`: Report all object type definitions that are exact.\n\n```js\n{\n  \"rules\": {\n    \"flowtype/require-exact-type\": [\n      2,\n      \"always\"\n    ]\n  }\n}\n\n{\n  \"rules\": {\n    \"flowtype/require-exact-type\": [\n      2,\n      \"never\"\n    ]\n  }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\ntype foo = {};\n// Message: Object type must be exact.\n\ntype foo = { bar: string };\n// Message: Object type must be exact.\n\n// Options: [\"always\"]\ntype foo = Array\u003c{bar: string}\u003e;\n// Message: Object type must be exact.\n\n// Options: [\"always\"]\n(foo: Array\u003c{bar: string}\u003e) =\u003e {};\n// Message: Object type must be exact.\n\n// Options: [\"always\"]\ninterface StackFrame {\n          colno?: number;\n          lineno?: number;\n          filename?: string;\n          function?: { name: string };\n      }\n// Message: Object type must be exact.\n\n// Options: [\"never\"]\ntype foo = {| |};\n// Message: Object type must not be exact.\n\n// Options: [\"never\"]\ntype foo = {| bar: string |};\n// Message: Object type must not be exact.\n\n// Options: [\"never\"]\ntype foo = { bar: {| baz: string |} };\n// Message: Object type must not be exact.\n\n// Options: [\"never\"]\ntype foo = Array\u003c{| bar: string |}\u003e;\n// Message: Object type must not be exact.\n\n// Options: [\"never\"]\n(foo: Array\u003c{| bar: string |}\u003e) =\u003e {};\n// Message: Object type must not be exact.\n\n// Options: [\"never\"]\ninterface StackFrame {\n          colno?: number;\n          lineno?: number;\n          filename?: string;\n          function?: {| name: string |};\n      }\n// Message: Object type must not be exact.\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype foo = {| |};\n\ntype foo = {| bar: string |};\n\ntype foo = { [key: string]: string };\n\ntype foo = number;\n\n// Options: [\"always\"]\ntype foo = {| |};\n\n// Options: [\"always\"]\ntype foo = {| bar: string |};\n\n// Options: [\"always\"]\ntype foo = {| bar: {| baz: string |} |};\n\n// Options: [\"always\"]\ntype foo = Array\u003c{| bar: string |}\u003e;\n\n// Options: [\"always\"]\ntype foo = number;\n\n// Options: [\"always\"]\ninterface StackFrame {\n          colno?: number;\n          lineno?: number;\n          filename?: string;\n          function?: {| name: string |};\n      }\n\n// Options: [\"always\"]\ndeclare class MyEvent extends Event {\n        key: string\n      }\n\n// Options: [\"never\"]\ntype foo = { };\n\n// Options: [\"never\"]\ntype foo = { bar: string };\n\n// Options: [\"never\"]\ntype foo = { bar: { baz: string } };\n\n// Options: [\"never\"]\ntype foo = Array\u003c{bar: string}\u003e;\n\n// Options: [\"never\"]\ntype foo = number;\n\n// Options: [\"always\"]\ninterface StackFrame {\n          colno?: number;\n          lineno?: number;\n          filename?: string;\n          function?: {| name: string |};\n      }\n\ntype A = { a: string, ... }\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-indexer-name\"\u003e\u003c/a\u003e\n### \u003ccode\u003erequire-indexer-name\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nThis rule validates Flow object indexer name.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-indexer-name-options-8\"\u003e\u003c/a\u003e\n#### Options\n\nThe rule has a string option:\n\n* `\"never\"` (default): Never report files that are missing an indexer key name.\n* `\"always\"`: Always report files that are missing an indexer key name.\n\n```js\n{\n  \"rules\": {\n    \"flowtype/require-indexer-name\": [\n      2,\n      \"always\"\n    ]\n  }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\ntype foo = { [string]: number };\n// Message: All indexers must be declared with key name.\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype foo = { [key: string]: number };\n\n// Options: [\"never\"]\ntype foo = { [key: string]: number };\n\n// Options: [\"never\"]\ntype foo = { [string]: number };\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-inexact-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003erequire-inexact-type\u003c/code\u003e\n\nThis rule enforces explicit inexact object types.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-inexact-type-options-9\"\u003e\u003c/a\u003e\n#### Options\n\nThe rule has one string option:\n\n- `\"always\"` (default): Report all object type definitions that aren't explicit inexact, but ignore exact objects.\n- `\"never\"`: Report all object type definitions that are explicit inexact.\n\n```js\n{\n  \"rules\": {\n    \"flowtype/require-inexact-type\": [\n      2,\n      \"always\"\n    ]\n  }\n}\n\n{\n  \"rules\": {\n    \"flowtype/require-inexact-type\": [\n      2,\n      \"never\"\n    ]\n  }\n}\n```\n\nThe following patterns are considered problems:\n\n```js\ntype foo = {};\n// Message: Type must be explicit inexact.\n\ntype foo = { bar: string };\n// Message: Type must be explicit inexact.\n\n// Options: [\"always\"]\ntype foo = {};\n// Message: Type must be explicit inexact.\n\n// Options: [\"always\"]\ntype foo = { bar: string };\n// Message: Type must be explicit inexact.\n\n// Options: [\"never\"]\ntype foo = {...};\n// Message: Type must not be explicit inexact.\n\n// Options: [\"never\"]\ntype foo = { bar: string, ... };\n// Message: Type must not be explicit inexact.\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype foo = { foo: string, ... };\n\ninterface Foo { foo: string }\n\ndeclare class Foo { foo: string }\n\ntype foo = {| |};\n\ntype foo = {| bar: string |};\n\ntype foo = { [key: string]: string, ... };\n\ntype foo = number;\n\n// Options: [\"always\"]\ntype foo = {| |};\n\n// Options: [\"always\"]\ntype foo = {...};\n\n// Options: [\"always\"]\ntype foo = { bar: string, ... };\n\n// Options: [\"always\"]\ntype foo = {| bar: string |};\n\n// Options: [\"always\"]\ntype foo = number;\n\n// Options: [\"never\"]\ntype foo = { };\n\n// Options: [\"never\"]\ntype foo = {| |};\n\n// Options: [\"never\"]\ntype foo = { bar: string };\n\n// Options: [\"never\"]\ntype foo = {| bar: string |};\n\n// Options: [\"never\"]\ntype foo = number;\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-parameter-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003erequire-parameter-type\u003c/code\u003e\n\nRequires that all function parameters have type annotations.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-parameter-type-options-10\"\u003e\u003c/a\u003e\n#### Options\n\nYou can skip all arrow functions by providing the `excludeArrowFunctions` option with `true`.\n\nAlternatively, you can want to exclude only concise arrow functions (e.g. `x =\u003e x * 2`). Provide `excludeArrowFunctions` with `expressionsOnly` for this.\n\n```js\n{\n    \"rules\": {\n        \"flowtype/require-parameter-type\": [\n            2,\n            {\n              \"excludeArrowFunctions\": true\n            }\n        ]\n    }\n}\n\n{\n    \"rules\": {\n        \"flowtype/require-parameter-type\": [\n            2,\n            {\n              \"excludeArrowFunctions\": \"expressionsOnly\"\n            }\n        ]\n    }\n}\n```\n\nYou can exclude parameters that match a certain regex by using `excludeParameterMatch`.\n\n```js\n{\n    \"rules\": {\n        \"flowtype/require-parameter-type\": [\n            2,\n            {\n              \"excludeParameterMatch\": \"^_\"\n            }\n        ]\n    }\n}\n```\n\nThis excludes all parameters that start with an underscore (`_`).\nThe default pattern is `a^`, which doesn't match anything, i.e., all parameters are checked.\n\nThe following patterns are considered problems:\n\n```js\n(foo) =\u003e {}\n// Message: Missing \"foo\" parameter type annotation.\n\nfunction x(foo) {}\n// Message: Missing \"foo\" parameter type annotation.\n\n// Options: [{\"excludeArrowFunctions\":true}]\nfunction x(foo) {}\n// Message: Missing \"foo\" parameter type annotation.\n\n(foo = 'FOO') =\u003e {}\n// Message: Missing \"foo\" parameter type annotation.\n\n(...foo) =\u003e {}\n// Message: Missing \"foo\" parameter type annotation.\n\n({foo}) =\u003e {}\n// Message: Missing \"{foo}\" parameter type annotation.\n\n([foo]) =\u003e {}\n// Message: Missing \"[foo]\" parameter type annotation.\n\n({foo = 1} = {}) =\u003e {}\n// Message: Missing \"{foo = 1}\" parameter type annotation.\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\n// @flow\n(foo) =\u003e {}\n// Message: Missing \"foo\" parameter type annotation.\n\n// Options: [{\"excludeArrowFunctions\":\"expressionsOnly\"}]\n(foo) =\u003e {}\n// Message: Missing \"foo\" parameter type annotation.\n\n// Options: [{\"excludeArrowFunctions\":\"expressionsOnly\"}]\nfunction x(foo) {}\n// Message: Missing \"foo\" parameter type annotation.\n\n// Options: [{\"excludeParameterMatch\":\"^_\"}]\n(_foo: number, bar) =\u003e {}\n// Message: Missing \"bar\" parameter type annotation.\n\n// Options: [{\"excludeParameterMatch\":\"^_\"}]\n(_foo, bar) =\u003e {}\n// Message: Missing \"bar\" parameter type annotation.\n```\n\nThe following patterns are not considered problems:\n\n```js\n(foo: string) =\u003e {}\n\n(foo: string = 'FOO') =\u003e {}\n\n(...foo: string) =\u003e {}\n\nconst f: Foo = (a, b) =\u003e 42;\n\n({foo}: {foo: string}) =\u003e {}\n\n([foo]: Array) =\u003e {}\n\ntype fn = (a: string, b: number) =\u003e number;\nconst f: fn = (a, b) =\u003e {}\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\n(foo) =\u003e {}\n\n// Options: [{\"excludeArrowFunctions\":true}]\n(foo) =\u003e {}\n\n// Options: [{\"excludeArrowFunctions\":\"expressionsOnly\"}]\n(foo) =\u003e 3\n\n// Options: [{\"excludeParameterMatch\":\"^_\"}]\n(_foo, bar: string) =\u003e {}\n\n// Options: [{\"excludeParameterMatch\":\"^_\"}]\n(_foo: number, bar: string) =\u003e {}\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\n(foo) =\u003e {}\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-readonly-react-props\"\u003e\u003c/a\u003e\n### \u003ccode\u003erequire-readonly-react-props\u003c/code\u003e\n\nThis rule validates that React props are marked as `$ReadOnly`. React props are immutable and modifying them could lead to unexpected results. Marking prop shapes as `$ReadOnly` avoids these issues.\n\nThe rule tries its best to work with both class and functional components. For class components, it does a fuzzy check for one of \"Component\", \"PureComponent\", \"React.Component\" and \"React.PureComponent\". It doesn't actually infer that those identifiers resolve to a proper `React.Component` object.\n\nFor example, this will NOT be checked:\n\n```js\nimport MyReact from 'react';\nclass Foo extends MyReact.Component { }\n```\n\nAs a result, you can safely use other classes without getting warnings from this rule:\n\n```js\nclass MyClass extends MySuperClass { }\n```\n\nReact's functional components are hard to detect statically. The way it's done here is by searching for JSX within a function. When present, a function is considered a React component:\n\n```js\n// this gets checked\ntype Props = { };\nfunction MyComponent(props: Props) {\n    return \u003cp /\u003e;\n}\n\n// this doesn't get checked since no JSX is present in a function\ntype Options = { };\nfunction SomeHelper(options: Options) {\n    // ...\n}\n\n// this doesn't get checked since no JSX is present directly in a function\nfunction helper() { return \u003cp /\u003e }\nfunction MyComponent(props: Props) {\n    return helper();\n}\n```\n\nThe rule only works for locally defined props that are marked with a `$ReadOnly` or using covariant notation. It doesn't work with imported props:\n\n```js\n// the rule has no way of knowing whether ImportedProps are read-only\nimport { type ImportedProps } from './somewhere';\nclass Foo extends React.Component\u003cImportedProps\u003e { }\n\n\n// the rule also checks for covariant properties\ntype Props = {|\n    +foo: string\n|};\nclass Bar extends React.Component\u003cProps\u003e { }\n\n// this fails because the object is not fully read-only\ntype Props = {|\n    +foo: string,\n    bar: number,\n|};\nclass Bar extends React.Component\u003cProps\u003e { }\n\n// this fails because spreading makes object mutable (as of Flow 0.98)\n// https://github.com/gajus/eslint-plugin-flowtype/pull/400#issuecomment-489813899\ntype Props = {|\n    +foo: string,\n    ...bar,\n|};\nclass Bar extends React.Component\u003cProps\u003e { }\n```\n\n\n```js\n{\n    \"rules\": {\n        \"flowtype/require-readonly-react-props\": 2\n    }\n}\n```\n\n\nOptionally, you can enable support for [implicit exact Flow types](https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf) (useful when using `exact_by_default=true` Flow option):\n\n\n```js\n{\n    \"rules\": {\n        \"flowtype/require-readonly-react-props\": [\n            2,\n            {\n                \"useImplicitExactTypes\": true\n            }\n        ]\n    }\n}\n```\n\n\nThe following patterns are considered problems:\n\n```js\ntype Props = { }; class Foo extends React.Component\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\ntype OtherProps = { foo: string }; class Foo extends React.Component\u003cOtherProps\u003e { }\n// Message: OtherProps must be $ReadOnly\n\nclass Foo extends React.Component\u003c{}\u003e { }\n// Message: Foo class props must be $ReadOnly\n\ntype Props = { bar: {} }; class Foo extends React.Component\u003cProps, State\u003e { }\n// Message: Props must be $ReadOnly\n\ntype Props = { }; class Foo extends Component\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\ntype Props = { }; class Foo extends PureComponent\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\nexport type Props = {}; class Foo extends Component\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\ntype Props = {| foo: string |}; class Foo extends Component\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\ntype Props = {| foo: string |} | {| bar: number |}; class Foo extends Component\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\n// Options: [{\"useImplicitExactTypes\":true}]\ntype Props = { foo: string } | { bar: number }; class Foo extends Component\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\ntype Props = {| +foo: string, ...bar |}; class Foo extends Component\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\ntype Props = {| +foo: string, -bar: number |}; class Foo extends Component\u003cProps\u003e { }\n// Message: Props must be $ReadOnly\n\ntype Props = { }; function Foo(props: Props) { return \u003cp /\u003e }\n// Message: Props must be $ReadOnly\n\ntype Props = { }; function Foo(props: Props) { return foo ? \u003cp /\u003e : \u003cspan /\u003e }\n// Message: Props must be $ReadOnly\n\nfunction Foo(props: {}) { return \u003cp /\u003e }\n// Message: Foo component props must be $ReadOnly\n\nexport type Props = {}; function Foo(props: Props) { return \u003cp /\u003e }\n// Message: Props must be $ReadOnly\n```\n\nThe following patterns are not considered problems:\n\n```js\nclass Foo extends React.Component\u003c$ReadOnly\u003c{}\u003e\u003e { }\n\ntype Props = $ReadOnly\u003c{}\u003e; class Foo extends React.Component\u003cProps\u003e { }\n\ntype Props = $ReadOnly\u003c{}\u003e; class Foo extends React.PureComponent\u003cProps\u003e { }\n\nclass Foo extends React.Component\u003c$ReadOnly\u003c{}, State\u003e\u003e { }\n\ntype Props = $ReadOnly\u003c{}\u003e; class Foo extends React.Component\u003cProps, State\u003e { }\n\ntype Props = $ReadOnly\u003c{}\u003e; class Foo extends Component\u003cProps\u003e { }\n\ntype Props = $ReadOnly\u003c{}\u003e; class Foo extends PureComponent\u003cProps\u003e { }\n\ntype FooType = {}; class Foo extends Bar\u003cFooType\u003e { }\n\nclass Foo { }\n\nexport type Props = $ReadOnly\u003c{}\u003e; class Foo extends Component\u003cProps, State\u003e { }\n\nexport type Props = $ReadOnly\u003c{}\u003e; export class Foo extends Component\u003cProps\u003e { }\n\ntype Props = {| +foo: string |}; class Foo extends Component\u003cProps\u003e { }\n\ntype Props = {| +foo: string, +bar: number |}; class Foo extends Component\u003cProps\u003e { }\n\ntype Props = {| +foo: string |} | {| +bar: number |}; class Foo extends Component\u003cProps\u003e { }\n\n// Options: [{\"useImplicitExactTypes\":true}]\ntype Props = { +foo: string } | { +bar: number }; class Foo extends Component\u003cProps\u003e { }\n\ntype Props = $FlowFixMe; class Foo extends Component\u003cProps\u003e { }\n\ntype Props = {||}; class Foo extends Component\u003cProps\u003e { }\n\n// Options: [{\"useImplicitExactTypes\":true}]\ntype Props = {||}; class Foo extends Component\u003cProps\u003e { }\n\n// Options: [{\"useImplicitExactTypes\":true}]\ntype Props = {}; class Foo extends Component\u003cProps\u003e { }\n\nclass Foo extends Component\u003c{||}\u003e { }\n\n// Options: [{\"useImplicitExactTypes\":true}]\nclass Foo extends Component\u003c{||}\u003e { }\n\n// Options: [{\"useImplicitExactTypes\":true}]\nclass Foo extends Component\u003c{}\u003e { }\n\nclass Foo extends React.Component\u003cUnknownProps\u003e { }\n\nimport { type Props } from \"file\"; class Foo extends React.Component\u003cProps\u003e { }\n\ntype Props = {}; function Foo() { }\n\ntype Props = $ReadOnly\u003c{}\u003e; function Foo(props: Props) { }\n\ntype Props = {}; function Foo(props: OtherProps) { }\n\nfunction Foo() { return \u003cp /\u003e }\n\nfunction Foo(props: $FlowFixMe) { return \u003cp /\u003e }\n\nfunction Foo(props: {||}) { return \u003cp /\u003e }\n\n// Options: [{\"useImplicitExactTypes\":true}]\nfunction Foo(props: {||}) { return \u003cp /\u003e }\n\n// Options: [{\"useImplicitExactTypes\":true}]\nfunction Foo(props: {}) { return \u003cp /\u003e }\n```\n\n\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-return-type\"\u003e\u003c/a\u003e\n### \u003ccode\u003erequire-return-type\u003c/code\u003e\n\nRequires that functions have return type annotation.\n\n\u003ca name=\"eslint-plugin-flowtype-rules-require-return-type-options-11\"\u003e\u003c/a\u003e\n#### Options\n\nYou can skip all arrow functions by providing the `excludeArrowFunctions` option with `true`.\n\nAlternatively, you can exclude a concise arrow function (e.g. `() =\u003e 2`). Provide `excludeArrowFunctions` with `expressionsOnly` for this.\n\n```js\n{\n    \"rules\": {\n        \"flowtype/require-return-type\": [\n            2,\n            \"always\",\n            {\n              \"excludeArrowFunctions\": true\n            }\n        ]\n    }\n}\n\n{\n    \"rules\": {\n        \"flowtype/require-return-type\": [\n            2,\n            \"always\",\n            {\n              \"excludeArrowFunctions\": \"expressionsOnly\"\n            }\n        ]\n    }\n}\n```\n\nYou can exclude or include specific tests with the `includeOnlyMatching` and `excludeMatching` rules.\n\n```js\n{\n    \"rules\": {\n        \"flowtype/require-return-type\": [\n            2,\n            \"always\",\n            {\n              \"includeOnlyMatching\": [\n                  \"^F.*\",\n                  \"Ba(r|z)\"\n              ]\n            }\n        ]\n    }\n}\n\n{\n    \"rules\": {\n        \"flowtype/require-return-type\": [\n            2,\n            \"always\",\n            {\n              \"excludeMatching\": [\n                  \"^F.*\",\n                  \"Ba(r|z)\"\n              ]\n            }\n        ]\n    }\n}\n\n```\n\nBoth rules take an array that can contain either strings or valid RegExp statements.\n\nThe following patterns are considered problems:\n\n```js\n(foo) =\u003e { return \"foo\"; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\"]\n(foo) =\u003e { return \"foo\"; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\"]\n(foo) =\u003e \"foo\"\n// Message: Missing return type annotation.\n\n(foo) =\u003e ({})\n// Message: Missing return type annotation.\n\n/* @flow */\n(foo) =\u003e { return 1; }\n// Message: Missing return type annotation.\n\n(foo): undefined =\u003e { return; }\n// Message: Must not annotate undefined return type.\n\n(foo): void =\u003e { return; }\n// Message: Must not annotate undefined return type.\n\n(foo): undefined =\u003e { return undefined; }\n// Message: Must not annotate undefined return type.\n\n(foo): void =\u003e { return void 0; }\n// Message: Must not annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"never\"}]\n(foo): undefined =\u003e { return; }\n// Message: Must not annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"never\"}]\n(foo): void =\u003e { return; }\n// Message: Must not annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"always\"}]\n(foo) =\u003e { return; }\n// Message: Must annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"never\"}]\n(foo): undefined =\u003e { return undefined; }\n// Message: Must not annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"always\"}]\n(foo) =\u003e { return undefined; }\n// Message: Must annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"always\"}]\n(foo) =\u003e { return void 0; }\n// Message: Must annotate undefined return type.\n\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\n// @flow\n(foo) =\u003e { return 1; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"annotateUndefined\":\"always\"}]\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\n// @flow\n (foo) =\u003e { return undefined; }\n// Message: Must annotate undefined return type.\n\n// Options: [\"always\"]\nasync () =\u003e { return 2; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"annotateUndefined\":\"always\"}]\nasync () =\u003e {}\n// Message: Must annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"always\"}]\nasync function x() {}\n// Message: Must annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"never\"}]\nasync (): Promise\u003cvoid\u003e =\u003e { return; }\n// Message: Must not annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"never\"}]\nasync (): Promise\u003cundefined\u003e =\u003e { return; }\n// Message: Must not annotate undefined return type.\n\n// Options: [\"always\",{\"annotateUndefined\":\"always\"}]\nclass Test { constructor() { } }\n// Message: Must annotate undefined return type.\n\nclass Test { foo() { return 42; } }\n// Message: Missing return type annotation.\n\nclass Test { foo = () =\u003e { return 42; } }\n// Message: Missing return type annotation.\n\nclass Test { foo = () =\u003e 42; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\"]\nfunction* x() {}\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"excludeArrowFunctions\":\"expressionsOnly\"}]\n() =\u003e { return 3; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"excludeArrowFunctions\":\"expressionsOnly\"}]\nasync () =\u003e { return 4; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"includeOnlyMatching\":[\"bar\"]}]\nfunction foo() { return 42; }\nfunction bar() { return 42; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"includeOnlyMatching\":[\"bar\"]}]\nconst foo = () =\u003e { return 42; };\nconst bar = () =\u003e { return 42; }\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"includeOnlyMatching\":[\"bar\"]}]\nconst foo = { bar() { return 42; }, foobar: function() { return 42; } }\n// Message: Missing return type annotation.\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"excludeMatching\":[\"bar\"]}]\nconst foo = { bar() { return 42; }, baz() { return 42; } }\n// Message: Missing return type annotation.\n\n// Options: [\"always\",{\"anno","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Feslint-plugin-flowtype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgajus%2Feslint-plugin-flowtype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Feslint-plugin-flowtype/lists"}