Skip to content

Commit f7fe688

Browse files
panagosg7facebook-github-bot
authored andcommitted
set one_sided_type_guards=true in fbsource (facebook#45107)
Summary: This diff enables: 1. [one-sided type guards](https://flow.org/en/docs/types/type-guards/#one-sided-type-guards) (`implies x is T`), and 2. stricter checking of type guard consistency (see [relevant docs page](https://flow.org/en/docs/types/type-guards/#toc-consistency-checks-of-type-guard-functions)). To prevent many new errors from being introduced this diff also converts some two-sided type guards to [one-sided](https://flow.org/en/docs/types/type-guards/#one-sided-type-guards) ones. Pull Request resolved: facebook#45107 Updated the flowconfigs and synced flow_runner/codemods since the change has already been applied there: ``` js1 upgrade www-shared -p flow_runner/codemods ``` Changelog: [Internal] Reviewed By: gkz Differential Revision: D58874409 fbshipit-source-id: 959a6773701518a1d6aa35e2ec28fd4ce12d2e75
1 parent 8a6508c commit f7fe688

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.flowconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/packages/react-nat
6464
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/packages/dev-middleware'
6565
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
6666

67+
one_sided_type_guards=true
68+
6769
suppress_type=$FlowIssue
6870
suppress_type=$FlowFixMe
6971
suppress_type=$FlowFixMeProps

0 commit comments

Comments
 (0)