-
-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Like with the other Flow upgrades in this series, we're departing from our usual practice of only upgrading Flow along with React Native. But we seem to get away with this one -- it doesn't flag any new errors in node_modules/react-native! One highlight of this version in the changelog is "Standardized error suppression syntax, added ability to suppress errors based on error codes" [1]. We couldn't have taken this upgrade without first removing our use of the `suppress_comment` option in our .flowconfig [2]. One slightly annoying feature of the standardized syntax (still present in v0.146, the latest) is that, when you put more than one error-code-specific suppression in a multi-line comment, Flow will ignore some of them. Neither the doc [3] nor the suppression-syntax tests [4] suggest that multiple suppressions in one multi-line comment is supported. We'd been using multi-line comments to keep a suppression's explanatory text (when it's too long for one line) between the suppression and the code that it's about [5]. So, to keep doing that: work around by using single-line suppression comments for all but the last error-code-specific suppression (chosen arbitrarily), and use a multi-line comment for that last one, squeezing the explanatory text in there. Apparently this Flow version finds more to complain about at some of our existing suppressions, so this workaround gets a good bit of exercise, especially in src/boot/store.js. [1] https://github.com/facebook/flow/blob/master/Changelog.md#01270 [2] https://flow.org/en/docs/config/options/#toc-suppress-comment-regex [3] https://flow.org/en/docs/errors/ [4] https://github.com/facebook/flow/blob/v0.146.0/tests/error_codes/test.js [5] #4433 (comment)
- Loading branch information
1 parent
669899c
commit 03e6bdf
Showing
9 changed files
with
36 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,4 +123,4 @@ module.file_ext=.json | |
module.file_ext=.ios.js | ||
|
||
[version] | ||
^0.126.0 | ||
^0.127.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters