2017-01-26 11:49:39 -08:00
|
|
|
{
|
2017-04-24 14:01:22 +02:00
|
|
|
"extends": [
|
2017-05-14 12:14:12 -07:00
|
|
|
"plugin:flowtype/recommended",
|
|
|
|
"plugin:react/recommended",
|
|
|
|
"plugin:import/errors",
|
|
|
|
"plugin:import/warnings",
|
2017-04-24 14:01:22 +02:00
|
|
|
"prettier",
|
|
|
|
"prettier/flowtype",
|
|
|
|
"prettier/react"
|
|
|
|
],
|
2017-01-26 11:49:39 -08:00
|
|
|
"parser": "babel-eslint",
|
|
|
|
"plugins": [
|
2017-05-14 12:14:12 -07:00
|
|
|
"react",
|
2017-04-24 14:01:22 +02:00
|
|
|
"flowtype",
|
|
|
|
"prettier"
|
2017-01-26 11:49:39 -08:00
|
|
|
],
|
|
|
|
"env": {
|
|
|
|
"jasmine": true
|
|
|
|
},
|
|
|
|
"rules": {
|
2017-04-24 14:01:22 +02:00
|
|
|
"prettier/prettier": ["error", {
|
2017-05-14 12:14:12 -07:00
|
|
|
"trailingComma": "es5",
|
2017-04-24 14:01:22 +02:00
|
|
|
"singleQuote": true
|
|
|
|
}],
|
|
|
|
|
2017-09-16 07:21:08 +09:00
|
|
|
"no-underscore-dangle": "off",
|
|
|
|
"no-use-before-define": "off",
|
|
|
|
"no-unused-expressions": "off",
|
|
|
|
"new-cap": "off",
|
|
|
|
"no-plusplus": "off",
|
|
|
|
"no-class-assign": "off",
|
|
|
|
"no-duplicate-imports": "off",
|
2017-01-26 11:49:39 -08:00
|
|
|
|
2017-09-16 07:21:08 +09:00
|
|
|
"import/extensions": "off",
|
|
|
|
"import/no-extraneous-dependencies": "off",
|
|
|
|
"import/no-unresolved": "off",
|
2017-01-26 11:49:39 -08:00
|
|
|
|
|
|
|
"react/jsx-filename-extension": [
|
2017-09-16 07:21:08 +09:00
|
|
|
"off", { "extensions": [".js", ".jsx"] }
|
2017-01-26 11:49:39 -08:00
|
|
|
],
|
2017-09-06 16:08:08 -05:00
|
|
|
|
2017-09-16 07:21:08 +09:00
|
|
|
"react/sort-comp": "off",
|
|
|
|
"react/prefer-stateless-function": "off",
|
2017-01-26 11:49:39 -08:00
|
|
|
|
2017-09-16 07:21:08 +09:00
|
|
|
"react/forbid-prop-types": "warn",
|
|
|
|
"react/prop-types": "off",
|
|
|
|
"react/require-default-props": "off",
|
|
|
|
"react/no-unused-prop-types": "off",
|
2017-04-14 00:19:30 +02:00
|
|
|
|
2017-01-26 11:49:39 -08:00
|
|
|
"flowtype/boolean-style": [
|
2017-09-16 07:21:08 +09:00
|
|
|
"error",
|
2017-01-26 11:49:39 -08:00
|
|
|
"boolean"
|
|
|
|
],
|
2017-09-16 07:21:08 +09:00
|
|
|
"flowtype/no-weak-types": "off",
|
Update to react-native@0.50 and flow-bin@0.56 (#2998)
* Update to React Native 0.50
* Type Promise used in PlatformHelpers.web.js
* Move $FlowFixMe in CardStack.js
The line number Flow is using for this error changed. The underlying problem has not, but I don't have time to fix it now unfortunately.
* Type TouchableItem's children prop as React.Node
This was my bad. `React.ChildrenArray` should only really be used in the case of having multiple of the same type of child.
* Type HeaderTitle's children prop as React.Node
Same as last commit.
* Add assertion in StackRouter that StateUtils.indexOf returns valid index
Flow doesn't realize that `StateUtils.indexOf` is guaranteed to return a valid index, so we use `invariant` to assert it.
* Remove unused type DrawerNavigationState from TypeDefinition
* Remove unused type parameter T in DrawerView
* Type NavigationStateRoute as NavigationLeafRoute & NavigationState
* Don't constrain generic action types to NavigationAction
By constraining to subtypes of `NavigationAction`, we actually are requiring that any router satisfying our type constraints has to take all of the `NavigationAction` types. Instead, we want to say that it will only take some of them. Changing the types here to be inferred.
* Fix types of NavigationScreenProp and withCachedChildNavigation
1. `NavigationScreenProp` needs to have its type parameter annotated with a `+` to actually indicate covariance on that type parameter, apparently
2. `withCachedChildNavigation` needs to thread through more-specific `NavigationState`s, and right now it just discards that specificity, which breaks `DrawerSidebar` because it needs a `NavigationStateRoute`
* Ignore website/build from Flow
* Fix type of DrawerItems activeItemKey prop
- Even when specified, it can be `null`
- Use a ternary expression instead of `x && x.param` approach
* Get rid of NavigationRouter & NavigationNavigator parameterization on NavigationAction
Since `NavigationRouter`'s `getStateForAction` functionality is a standard Redux reducer, it knows to forward on any actions it doesn't know how to deal with. We can widen the types of these functions to be `NavigationAction` without any negative consequence.
* Explicitly specify null navigationOptions in createNavigator
Not sure why, but Flow doesn't like us leaving it unspecified
* Fix createNavigationContainer/createNavigator/StackNavigator types
* Fix up flow types for TabNavigator and DrawerNavigator
* Properly type defaultContentComponent
* Fix more flow errors in createNavigationContainer
* Replace NavigatorProps with NavigationNavigatorProps
* Type SceneView's navigation prop as NavigationScreenProp<any>
There is an unavoidable* type problem here. A `NavigationComponent` is either a navigator with a `NavigationStateRoute` or a scene with a `NavigationRoute`. The navigation prop it gets passed must match the component's `NavigationState`. However, there's no way for us to say that "`this.props.router.getComponentForRouteName` will have a `NavigationNavigator` iff the corresponding `childNavigationProps` is a `NavigationStateRoute`".
The cleanest way to make this work is to throw an "any" specifically for the navigation prop's state type param.
* We could probably avoid it with sufficient refactoring. If the routers were charged with keeping track of `childNavigationProps` instead of leaving it to the views, they could return the child navigation prop and child `NavigationComponent` in pairs whose types were coupled.
* Pass in screenProps to NavigationComponent in NavigationPlayground's CustomTabs
Flow wants `screenProps` to be passed in here for some reason...
It cites `SceneView`, but that doesn't really make much sense to me. But this is some custom logic that most people aren't likely to run into, so I'm not gonna worry too much about it.
* Patch mismatch with react-native-tab-view type for now
* Use generic NavigationState in createNavigationContainer's _nav var
We made the NavigationState generic while #1313 added a new instance variable. This updates the new instance variable to be generic.
* Fix failing tests
2017-11-20 11:53:48 -08:00
|
|
|
"flowtype/require-parameter-type": "off",
|
2017-01-26 11:49:39 -08:00
|
|
|
"flowtype/require-return-type": [
|
2017-09-16 07:21:08 +09:00
|
|
|
"off",
|
2017-01-26 11:49:39 -08:00
|
|
|
"always",
|
|
|
|
{
|
|
|
|
"annotateUndefined": "never"
|
|
|
|
}
|
|
|
|
],
|
2017-09-16 07:21:08 +09:00
|
|
|
"flowtype/require-valid-file-annotation": "error",
|
|
|
|
"flowtype/use-flow-type": "warn",
|
|
|
|
"flowtype/valid-syntax": "warn"
|
2017-01-26 11:49:39 -08:00
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"flowtype": {
|
2017-05-14 12:14:12 -07:00
|
|
|
"onlyFilesWithFlowAnnotation": true
|
2017-01-26 11:49:39 -08:00
|
|
|
}
|
2017-09-06 16:08:08 -05:00
|
|
|
},
|
|
|
|
"parserOptions": {
|
|
|
|
"ecmaVersion": 6,
|
|
|
|
"sourceType": "module",
|
|
|
|
"ecmaFeatures": {
|
|
|
|
"modules": true
|
|
|
|
}
|
2017-01-26 11:49:39 -08:00
|
|
|
}
|
|
|
|
}
|