{"author":{"name":"Gajus Kuizinas","email":"gajus@gajus.com","url":"http://gajus.com"},"dependencies":{"lodash":"^4.17.21","string-natural-compare":"^3.0.1"},"description":"Flowtype linting rules for ESLint.","devDependencies":{"@babel/cli":"^7.15.7","@babel/core":"^7.15.8","@babel/eslint-parser":"^7.15.8","@babel/node":"^7.15.8","@babel/plugin-proposal-object-rest-spread":"^7.15.6","@babel/plugin-syntax-flow":"^7.14.5","@babel/plugin-transform-react-jsx":"^7.14.9","@babel/preset-env":"^7.15.8","@babel/register":"^7.15.3","ajv":"^8.6.3","babel-plugin-add-module-exports":"^1.0.4","eslint":"^8.1.0","eslint-config-canonical":"^32.15.0","eslint-plugin-eslint-plugin":"^4.0.2","gitdown":"^3.1.4","glob":"^7.2.0","husky":"^7.0.4","jsonlint":"^1.6.3","mocha":"^9.1.3","rimraf":"^3.0.2","semantic-release":"^18.0.0"},"engines":{"node":">=12.0.0"},"husky":{"hooks":{"pre-commit":"npm run check-docs && npm run check-tests && npm run lint && npm run test && npm run build && npm run format-json"}},"keywords":["eslint","plugin","flowtype"],"license":"BSD-3-Clause","main":"./dist/index.js","name":"eslint-plugin-flowtype","peerDependencies":{"@babel/plugin-syntax-flow":"^7.14.5","@babel/plugin-transform-react-jsx":"^7.14.9","eslint":"^8.1.0"},"repository":{"type":"git","url":"git+https://github.com/gajus/eslint-plugin-flowtype.git"},"scripts":{"build":"rimraf ./dist && babel ./src --out-dir ./dist --copy-files","check-docs":"babel-node ./src/bin/checkDocs","check-tests":"babel-node ./src/bin/checkTests","create-readme":"gitdown ./.README/README.md --output-file ./README.md && npm run documentation-add-assertions","documentation-add-assertions":"babel-node ./src/bin/addAssertions","format-json":"jsonlint --sort-keys --in-place --indent \" \" ./src/configs/recommended.json","lint":"eslint ./src ./tests","test":"mocha --require @babel/register ./tests/rules/index.js"},"version":"8.0.3","gitHead":"7989036225ebe23b19d6b92b16d33ef1c60a59bf","bugs":{"url":"https://github.com/gajus/eslint-plugin-flowtype/issues"},"homepage":"https://github.com/gajus/eslint-plugin-flowtype#readme","_id":"eslint-plugin-flowtype@8.0.3","_nodeVersion":"16.13.0","_npmVersion":"7.24.2","dist":{"shasum":"e1557e37118f24734aa3122e7536a038d34a4912","size":55020,"noattachment":false,"tarball":"https://registry.npmmirror.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz","integrity":"sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ=="},"_npmUser":{"name":"gajus","email":"gajus@gajus.com"},"directories":{},"maintainers":[{"name":"gajus","email":"gajus@gajus.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-flowtype_8.0.3_1635465712066_0.5040966637207893"},"_hasShrinkwrap":false,"publish_time":1635465712254,"_cnpm_publish_time":1635465712254,"_cnpmcore_publish_time":"2021-12-15T17:11:11.649Z","readme":"\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\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\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\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\n### Shareable configurations\n\n\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\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\n## Settings\n\n\n### onlyFilesWithFlowAnnotation\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\n## Rules\n\n\n\n\n### array-style-complex-type\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`.\n\nIf it is `'shorthand'` then a problem is raised when using `Array` 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\", not \"(?string)[]\"\n\n// Options: [\"verbose\"]\ntype X = (?string)[]\n// Message: Use \"Array\", not \"(?string)[]\"\n\n// Options: [\"shorthand\"]\ntype X = Array\n// Message: Use \"(?string)[]\", not \"Array\"\n\n// Options: [\"shorthand\"]\ntype X = Array<{foo: string}>\n// Message: Use \"{foo: string}[]\", not \"Array<{foo: string}>\"\n\ntype X = (string | number)[]\n// Message: Use \"Array\", not \"(string | number)[]\"\n\ntype X = (string & number)[]\n// Message: Use \"Array\", not \"(string & number)[]\"\n\ntype X = [string, number][]\n// Message: Use \"Array<[string, number]>\", not \"[string, number][]\"\n\ntype X = {foo: string}[]\n// Message: Use \"Array<{foo: string}>\", not \"{foo: string}[]\"\n\ntype X = (string => number)[]\n// Message: Use \"Array number>\", not \"(string => number)[]\"\n\ntype X = {\n foo: string,\n bar: number\n}[]\n// Message: Use \"Array<{ foo: string, bar: number }>\", 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\", not \"Type[]\"\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = Array\n\n// Options: [\"verbose\"]\ntype X = Array\n\n// Options: [\"shorthand\"]\ntype X = (?string)[]\n\n// Options: [\"shorthand\"]\ntype X = Array\n\n// Options: [\"shorthand\"]\n// Settings: {\"flowtype\":{\"onlyFilesWithFlowAnnotation\":true}}\ntype X = Array\n```\n\n\n\n\n### array-style-simple-type\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`.\n\nIf it is `'shorthand'` then a problem is raised when using `Array` 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\", not \"string[]\"\n\n// Options: [\"verbose\"]\ntype X = string[]\n// Message: Use \"Array\", not \"string[]\"\n\n// Options: [\"shorthand\"]\ntype X = Array\n// Message: Use \"string[]\", not \"Array\"\n\ntype X = Date[]\n// Message: Use \"Array\", not \"Date[]\"\n\ntype X = Promise[]\n// Message: Use \"Array>\", not \"Promise[]\"\n\ntype X = $Keys<{foo: string}>[]\n// Message: Use \"Array<$Keys<{foo: string}>>\", not \"$Keys<{foo: string}>[]\"\n\ntype X = any[]\n// Message: Use \"Array\", not \"any[]\"\n\ntype X = mixed[]\n// Message: Use \"Array\", not \"mixed[]\"\n\ntype X = void[]\n// Message: Use \"Array\", not \"void[]\"\n\ntype X = null[]\n// Message: Use \"Array\", not \"null[]\"\n\ntype X = Promise<{\n foo: string,\n bar: number\n}>[]\n// Message: Use \"Array>\", not \"Promise<{ foo: string, bar: number }>[]\"\n\ntype X = Promise<{\n foo: string,\n bar: number,\n quo: boolean\n}>[]\n// Message: Use \"Array\", not \"Type[]\"\n```\n\nThe following patterns are not considered problems:\n\n```js\ntype X = Array\n\n// Options: [\"verbose\"]\ntype X = Array\n\n// Options: [\"shorthand\"]\ntype X = string[]\n\ntype X = Array>\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\n### arrow-parens\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 => {}\n// Message: undefined\n\na => a\n// Message: undefined\n\na => {\n}\n// Message: undefined\n\na.then(foo => {});\n// Message: undefined\n\na.then(foo => a);\n// Message: undefined\n\na(foo => { if (true) {}; });\n// Message: undefined\n\na(async foo => { if (true) {}; });\n// Message: undefined\n\n// Options: [\"as-needed\"]\n(a) => a\n// Message: undefined\n\n// Options: [\"as-needed\"]\n(a,) => a\n// Message: undefined\n\n// Options: [\"as-needed\"]\nasync (a) => a\n// Message: undefined\n\n// Options: [\"as-needed\"]\nasync(a) => a\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\na => {}\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a) => a\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync a => {}\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync (a) => a\n// Message: undefined\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync(a) => a\n// Message: undefined\n```\n\nThe following patterns are not considered problems:\n\n```js\n() => {}\n\n(a) => {}\n\n(a) => a\n\n(a) => {\n}\n\na.then((foo) => {});\n\na.then((foo) => { if (true) {}; });\n\na.then(async (foo) => { if (true) {}; });\n\n// Options: [\"always\"]\n() => {}\n\n// Options: [\"always\"]\n(a) => {}\n\n// Options: [\"always\"]\n(a) => a\n\n// Options: [\"always\"]\n(a) => {\n}\n\n// Options: [\"always\"]\na.then((foo) => {});\n\n// Options: [\"always\"]\na.then((foo) => { if (true) {}; });\n\n// Options: [\"always\"]\na.then(async (foo) => { if (true) {}; });\n\n// Options: [\"as-needed\"]\n() => {}\n\n// Options: [\"as-needed\"]\na => {}\n\n// Options: [\"as-needed\"]\na => a\n\n// Options: [\"as-needed\"]\n([a, b]) => {}\n\n// Options: [\"as-needed\"]\n({ a, b }) => {}\n\n// Options: [\"as-needed\"]\n(a = 10) => {}\n\n// Options: [\"as-needed\"]\n(...a) => a[0]\n\n// Options: [\"as-needed\"]\n(a, b) => {}\n\n// Options: [\"as-needed\"]\nasync ([a, b]) => {}\n\n// Options: [\"as-needed\"]\nasync (a, b) => {}\n\n// Options: [\"as-needed\"]\n(a: T) => a\n\n// Options: [\"as-needed\"]\n(a): T => a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n() => {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\na => a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n([a, b]) => {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n([a, b]) => a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n({ a, b }) => {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n({ a, b }) => a + b\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a = 10) => {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(...a) => a[0]\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a, b) => {}\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\na => ({})\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync a => ({})\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\nasync a => a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a: T) => a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a): T => a\n\n// Options: [\"always\",{\"requireForBlockBody\":true}]\n(a: T) => a\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":false}]\n(a: T) => { return a; }\n\n// Options: [\"always\",{\"requireForBlockBody\":true}]\n(a: T) => { return a; }\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a: T) => { return a; }\n\n// Options: [\"as-needed\",{\"requireForBlockBody\":true}]\n(a): %checks => typeof a === \"number\"\n```\n\n\n\n\n### boolean-style\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\n### define-flow-type\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\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(): 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<{}>\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\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(): 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<{}>\n// Additional rules: {\"no-undef\":2,\"no-use-before-define\":[2,\"nofunc\"]}\n```\n\n\n\n\n### delimiter-dangle\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\n### enforce-line-break\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\n### generic-spacing\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< string>\n// Message: There must be no space at start of \"Promise\" generic type annotation\n\n// Options: [\"never\"]\ntype X = Promise< string>\n// Message: There must be no space at start of \"Promise\" generic type annotation\n\ntype X = FooBar\n// Message: There must be no space at end of \"FooBar\" generic type annotation\n\ntype X = Promise< string >\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< (foo), bar, (((baz))) >\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\n// Message: There must be a space at start of \"Promise\" generic type annotation\n\n// Options: [\"always\"]\ntype X = FooBar< string>\n// Message: There must be a space at end of \"FooBar\" generic type annotation\n\n// Options: [\"always\"]\ntype X = Promise\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<(foo), bar, (((baz)))>\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< string >\n// Message: There must be one space at start of \"FooBar\" generic type annotation\n\n// Options: [\"always\"]\ntype X = FooBar< string >\n// Message: There must be one space at end of \"FooBar\" generic type annotation\n\n// Options: [\"always\"]\ntype X = Promise< (foo), bar, (((baz))) >\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\n\ntype X = Promise<(string)>\n\ntype X = Promise<(foo), bar, (((baz)))>\n\ntype X = Promise<\n (foo),\n bar,\n (((baz)))\n>\n\ntype X = Promise<\r\n (foo),\r\n bar,\r\n (((baz)))\r\n>\n\n// Options: [\"always\"]\ntype X = Promise< string >\n\n// Options: [\"always\"]\ntype X = Promise< (string) >\n\n// Options: [\"always\"]\ntype X = Promise< (foo), bar, (((baz))) >\n```\n\n\n\n\n### interface-id-match\n\nEnforces a consistent naming pattern for interfaces.\n\n\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\n### newline-after-flow-annotation\n\nThis rule requires an empty line after the Flow annotation.\n\n\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\n### no-dupe-keys\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: (config: { ...C, key: string}) => C }\n\nexport interface Foo { get foo(): boolean; get bar(): string; }\n```\n\n\n\n\n### no-duplicate-type-union-intersection-members\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\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 & B & A & 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 & B;\n```\n\n\n\n\n### no-existential-type\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<*, *>;\n// Message: Unexpected use of existential type (*).\n// Message: Unexpected use of existential type (*).\n\nconst f: (*) => null = () => 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\n### no-flow-fix-me-comments\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\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\n### no-internal-flow-type\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\n// Message: Type identifier 'React$AbstractComponent' is not allowed. Use 'React.AbstractComponent' instead.\n\ntype X = React$ChildrenArray\n// Message: Type identifier 'React$ChildrenArray' is not allowed. Use 'React.ChildrenArray' instead.\n\ntype X = React$ComponentType\n// Message: Type identifier 'React$ComponentType' is not allowed. Use 'React.ComponentType' instead.\n\ntype X = React$Config\n// Message: Type identifier 'React$Config' is not allowed. Use 'React.Config' instead.\n\ntype X = React$Element\n// Message: Type identifier 'React$Element' is not allowed. Use 'React.Element' instead.\n\ntype X = React$ElementConfig\n// Message: Type identifier 'React$ElementConfig' is not allowed. Use 'React.ElementConfig' instead.\n\ntype X = React$ElementProps\n// Message: Type identifier 'React$ElementProps' is not allowed. Use 'React.ElementProps' instead.\n\ntype X = React$ElementRef\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\n// Message: Type identifier 'React$Ref' is not allowed. Use 'React.Ref' instead.\n\ntype X = React$StatelessFunctionalComponent\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\n\ntype X = React.ChildrenArray\n\ntype X = React.ComponentType\n\ntype X = React.Config\n\ntype X = React.Element\n\ntype X = React.ElementConfig\n\ntype X = React.ElementProps\n\ntype X = React.ElementRef\n\ntype X = React.ElementType\n\ntype X = React.Key\n\ntype X = React.Node\n\ntype X = React.Ref\n\ntype X = React.StatelessFunctionalComponent\n\ntype X = React$Rocks\n```\n\n\n\n\n### no-mixed\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 {}\n// Message: Unexpected use of mixed type\n\nfunction foo(thing): Promise> {}\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 {}\n\nfunction foo(thing): Promise> {}\n\n(foo?: string) => {}\n\n(foo: ?string) => {}\n\n(foo: { a: string }) => {}\n\n(foo: { a: ?string }) => {}\n\n(foo: string[]) => {}\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\n### no-mutable-array\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 = [];`). 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\n// Message: Use \"$ReadOnlyArray\" instead of \"Array\"\n\ntype X = string[]\n// Message: Use \"$ReadOnlyArray\" instead of array shorthand notation\n\nconst values: Array> = [];\n// Message: Use \"$ReadOnlyArray\" instead of \"Array\"\n\nlet values: Array>;\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\n\nconst values: Array<$ReadOnlyArray> = [];\n\nconst values: $ReadOnlyArray[] = [];\n\nconst values: Array<$ReadOnlyArray> = new Array();\n\nconst values: Array<$ReadOnlyArray> = Array();\n```\n\n\n\n\n### no-primitive-constructor-types\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) => {}\n// Message: Unexpected use of Number constructor type.\n\n(x: String) => {}\n// Message: Unexpected use of String constructor type.\n\n(x: Boolean) => {}\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) => {}\n\n(x: string) => {}\n\n(x: boolean) => {}\n\ntype x = MyNumber\n\ntype x = MyString\n\ntype x = MyBoolean\n```\n\n\n\n\n### no-types-missing-file-annotation\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(): 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\n### no-unused-expressions\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) => void }\n | { type: 'BAR', doBar: (_: string) => 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\n### no-weak-types\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 {}\n// Message: Unexpected use of weak type \"any\"\n\nfunction foo(thing): Promise> {}\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