From 6bfb378b128484a793888c7ed5c40f49f5b550e5 Mon Sep 17 00:00:00 2001 From: Gajus Kuizinas Date: Mon, 22 Apr 2019 20:15:52 +0300 Subject: [PATCH] docs: add missing spread-exact-type docs --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 90accc7b..1e6df6e3 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ * [`space-after-type-colon`](#eslint-plugin-flowtype-rules-space-after-type-colon) * [`space-before-generic-bracket`](#eslint-plugin-flowtype-rules-space-before-generic-bracket) * [`space-before-type-colon`](#eslint-plugin-flowtype-rules-space-before-type-colon) + * [`spread-exact-type`](#eslint-plugin-flowtype-rules-spread-exact-type) * [`type-id-match`](#eslint-plugin-flowtype-rules-type-id-match) * [`type-import-style`](#eslint-plugin-flowtype-rules-type-import-style) * [`union-intersection-spacing`](#eslint-plugin-flowtype-rules-union-intersection-spacing) @@ -4544,6 +4545,31 @@ var x :number = 42; + +### spread-exact-type + +Enforce object types, that are spread to be exact type explicitly. + +The following patterns are considered problems: + +```js +type bar = {...{test: string}} +// Message: Use $Exact to make type spreading safe. + +type foo = {test: number}; type bar = {...foo} +// Message: Use $Exact to make type spreading safe. +``` + +The following patterns are not considered problems: + +```js +type bar = {...$Exact<{test: string}>} + +type foo = {test: number}; type bar = {...$Exact} +``` + + + ### type-id-match