Add global flow types to eslint globals

Summary:
Added a subset of the global flow types from the fbjs eslint config to remove the no-undef errors for flow types as well as a few missing browser globals that were used in the codebase.

I also added a .eslintrc file to Examples to allow using alert there without warnings.
Closes https://github.com/facebook/react-native/pull/5585

Reviewed By: svcscm

Differential Revision: D2872016

Pulled By: vjeux

fb-gh-sync-id: f9b1b511289425393074b7237049dec38ea407b6
This commit is contained in:
Janic Duplessis 2016-01-27 15:54:47 -08:00 committed by facebook-github-bot-0
parent c56f280af2
commit af2f40754a
2 changed files with 32 additions and 1 deletions

View File

@ -19,6 +19,7 @@
"__DEV__": true,
"__dirname": false,
"__fbBatchedBridgeConfig": false,
"alert": false,
"cancelAnimationFrame": false,
"clearImmediate": true,
"clearInterval": false,
@ -26,8 +27,11 @@
"console": false,
"document": false,
"escape": false,
"Event": false,
"EventTarget": false,
"exports": false,
"fetch": false,
"FormData": false,
"global": false,
"jest": false,
"Map": true,
@ -43,7 +47,29 @@
"setTimeout": false,
"window": false,
"XMLHttpRequest": false,
"pit": false
"pit": false,
// Flow global types.
"ReactComponent": false,
"ReactClass": false,
"ReactElement": false,
"ReactPropsCheckType": false,
"ReactPropsChainableTypeChecker": false,
"ReactPropTypes": false,
"SyntheticEvent": false,
"$Either": false,
"$All": false,
"$Tuple": false,
"$Supertype": false,
"$Subtype": false,
"$Shape": false,
"$Diff": false,
"$Keys": false,
"$Enum": false,
"$Exports": false,
"$FlowIssue": false,
"$FlowFixMe": false,
"$FixMe": false
},
"rules": {

5
Examples/.eslintrc Normal file
View File

@ -0,0 +1,5 @@
{
"rules": {
"no-alert": 0
}
}