Remove unused suppressions in xplat/js

Summary:
There were approximately 350 unused suppressions in xplat/js when checking with .flowconfig.android

The flow team is partially responsible for this, since our release process hasn't changed since we added the flowconfig. In the diff beneath this one, I added the functionality necessary for us to not add any more unused suppressions. To test it, I made this diff. The steps were:

1. Start iOS server
2. Start android server
3. remove unused ios suppressions
4. remove unused android suppressions
5. add ios suppressions with site=react_native_ios_fb
6. add android suppressions with site=react_native_android_fb
7. remove unused ios suppressions. The ones that are unused are ones where an android comment was inserted as well, since the ios comment no longer is next to the error
8. add suppressions using ios flowconfig with site=react_native_fb
9. remove unused android suppressions. The unused ones are ones that were moved up when the cross-platform suppressions were inserted.

I'm going to make this into a script to make sure we don't contribute anymore unused suppressions from our side.

The controller you requested could not be found. nolint

Reviewed By: TheSavior

Differential Revision: D10053893

fbshipit-source-id: 7bee212062f8b2153c6ba906a30cf40df2224019
This commit is contained in:
Jordan Brown
2018-09-27 11:39:47 -07:00
committed by Facebook Github Bot
parent 236bb018ab
commit 0ee23d0beb
5 changed files with 4 additions and 36 deletions

View File

@@ -136,11 +136,13 @@ class Picker extends React.Component<PickerProps> {
render() {
if (Platform.OS === 'ios') {
// $FlowFixMe found when converting React.createClass to ES6
/* $FlowFixMe(>=0.81.0 site=react_native_ios_fb) This suppression was
* added when renaming suppression sites. */
return <PickerIOS {...this.props}>{this.props.children}</PickerIOS>;
} else if (Platform.OS === 'android') {
return (
// $FlowFixMe found when converting React.createClass to ES6
/* $FlowFixMe(>=0.81.0 site=react_native_android_fb) This suppression
* was added when renaming suppression sites. */
<PickerAndroid {...this.props}>{this.props.children}</PickerAndroid>
);
} else {

View File

@@ -110,8 +110,6 @@ class PickerAndroid extends React.Component<PickerAndroidProps, *> {
if (this.props.onValueChange) {
const position = event.nativeEvent.position;
if (position >= 0) {
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was
* found when making Flow check .android.js files. */
const children = React.Children.toArray(this.props.children);
const value = children[position].props.value;
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was

View File

@@ -360,9 +360,6 @@ const JSTimers = {
return id;
},
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
cancelIdleCallback: function(timerID: number) {
_freeCallback(timerID);
const index = requestIdleCallbacks.indexOf(timerID);
@@ -381,23 +378,14 @@ const JSTimers = {
}
},
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
clearTimeout: function(timerID: number) {
_freeCallback(timerID);
},
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
clearInterval: function(timerID: number) {
_freeCallback(timerID);
},
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
clearImmediate: function(timerID: number) {
_freeCallback(timerID);
const index = immediates.indexOf(timerID);
@@ -406,9 +394,6 @@ const JSTimers = {
}
},
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
cancelAnimationFrame: function(timerID: number) {
_freeCallback(timerID);
},
@@ -417,9 +402,6 @@ const JSTimers = {
* This is called from the native side. We are passed an array of timerIDs,
* and
*/
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
callTimers: function(timersToCall: Array<number>) {
invariant(
timersToCall.length !== 0,
@@ -450,9 +432,6 @@ const JSTimers = {
}
},
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
callIdleCallbacks: function(frameTime: number) {
if (
FRAME_DURATION - (performanceNow() - frameTime) <
@@ -489,9 +468,6 @@ const JSTimers = {
* This is called after we execute any command we receive from native but
* before we hand control back to native.
*/
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
callImmediates() {
errors = null;
while (_callImmediatesPass()) {}
@@ -507,9 +483,6 @@ const JSTimers = {
/**
* Called from native (in development) when environment times are out-of-sync.
*/
/* $FlowFixMe(>=0.79.1 site=react_native_fb) This comment suppresses an
* error found when Flow v0.79 was deployed. To see the error delete this
* comment and run Flow. */
emitTimeDriftWarning(warningMessage: string) {
if (hasEmittedTimeDriftWarning) {
return;

View File

@@ -40,7 +40,6 @@ type Props = $ReadOnly<{|
class ElementProperties extends React.Component<Props> {
render() {
const style = flattenStyle(this.props.style);
// $FlowFixMe found when converting React.createClass to ES6
const selection = this.props.selection;
let openFileButton;
const source = this.props.source;
@@ -88,7 +87,6 @@ class ElementProperties extends React.Component<Props> {
{openFileButton}
</View>
{
// $FlowFixMe found when converting React.createClass to ES6
<BoxInspector style={style} frame={this.props.frame} />
}
</View>

View File

@@ -133,14 +133,11 @@ async function getCliConfig(): Promise<RNConfig> {
// $FlowFixMe Metro configuration is immutable.
config.transformer.assetRegistryPath = ASSET_REGISTRY_PATH;
// $FlowFixMe Metro configuration is immutable.
config.resolver.hasteImplModulePath =
config.resolver.hasteImplModulePath || defaultConfig.hasteImplModulePath;
// $FlowFixMe Metro configuration is immutable.
config.resolver.platforms = config.resolver.platforms
? config.resolver.platforms.concat(defaultConfig.getPlatforms())
: defaultConfig.getPlatforms();
// $FlowFixMe Metro configuration is immutable.
config.resolver.providesModuleNodeModules = config.resolver
.providesModuleNodeModules
? config.resolver.providesModuleNodeModules.concat(