Support flow experimental.const_params=true
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: macOS High Sierra 10.13 Node: 6.11.2 Yarn: 1.1.0 npm: 3.10.10 Watchman: 4.7.0 Xcode: Xcode 9.0 Build version 9A235 Android Studio: Not Found
Packages: (wanted => installed) react: 16.0.0-alpha.12 => 16.0.0-alpha.12 react-native: ^0.48.4 => 0.48.4
Steps to Reproduce
(Write your steps here:)
- Create a new react-native app with create-react-native-app
yarn add --dev flow-bin@^0.49.1
(same version specified in.flowconfig
)- Add
experimental.const_params=true
under[options]
in.flowconfig
./node_modules/.bin/flow
Expected Behavior
No errors.
(Write what you thought would happen.)
Actual Behavior
$ flow
node_modules/fbjs/lib/UnicodeBidi.js.flow:90
90: fallback = fallback || UnicodeBidiDirection.NEUTRAL;
^^^^^^^^ fallback. const param cannot be reassigned (see experimental.const_params=true in .flowconfig)
89: function resolveBlockDir(str: string, fallback: ?BidiDirection): BidiDirection {
^^^^^^^^^^^^^^^^^^^^^^^^ const param fallback
node_modules/fbjs/lib/UnicodeBidi.js.flow:92
92: return fallback;
^^^^^^^^ null. This type is incompatible with the expected return type of
89: function resolveBlockDir(str: string, fallback: ?BidiDirection): BidiDirection {
^^^^^^^^^^^^^ string enum
…[removed for brevity]…
... 88 more errors (only 50 out of 138 errors displayed)
To see all errors, re-run Flow with --show-all-errors
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Support - FLOW-3D
Our support staff is comprised of experienced engineers who understand the needs and problems facing users in competitive professional environments.
Read more >Experiment #6: Orifice and Free Jet Flow - Mavs Open Press
Flow measurement by an orifice is based on the application of Bernoulli's equation, which states that a relationship exists between the pressure of...
Read more >Flow Experiment Site Database — NCEAS Working Group
Use this form to enter information about a site where streamflow and/or stage have been manipulated at a dam, diversion structure, or other...
Read more >Experimental Aerodynamics & Flow Visualization - Sites@Duke
The goal of this project is to serve as an assistance tool while learning these concepts, by visualizing those aerodynamic phenomenons, such as:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This also affects react-native@0.49.0
👋 there - this issue is still technically “not fixed”, for the reason Eli explained above.
Basically every instance similar to this in the main codebase
would need to be changed to
There is a codemod Eli worked on -> https://github.com/cpojer/js-codemod/pull/85 which would help a lot in automating this process, but there is a 1% cases in which it would conflict.
So, all in all, there is a lot of work related to “code hygiene” - we’d love to see some PRs to help with this effort but it’s really low prior right now. So I’m going to close it as there are more important tasks to focus on.