From edb6ca72fdc04576a503aa8e5f34c32d2f727750 Mon Sep 17 00:00:00 2001 From: Mats Byrkeland Date: Thu, 22 Feb 2018 07:04:35 -0800 Subject: [PATCH] Fix ESLint warnings using 'yarn lint --fix' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Hi! I would like to contribute to React Native, and I am just starting out. I forked the repo and found that it has quite a lot of ESLint warnings – many of which were automatically fixable. This PR is simply the result of running `yarn lint --fix` from the root folder. Most changes are removing trailing spaces from comments. Haven't really done any manual testing, since I haven't done any code changes manually. `yarn test` runs fine, `yarn flow` runs fine, `yarn prettier` is satisfied. N/A [INTERNAL][MINOR][] - Fix ESLint warnings Closes https://github.com/facebook/react-native/pull/18047 Differential Revision: D7054948 Pulled By: hramos fbshipit-source-id: d53e692698d1687de5821c3fb5cdb76a5e03b71e --- Libraries/Alert/Alert.js | 4 +- Libraries/Alert/AlertIOS.js | 2 +- Libraries/AppState/AppState.js | 12 +-- .../AccessibilityInfo.android.js | 4 +- .../AccessibilityInfo.ios.js | 22 ++-- .../ActivityIndicator/ActivityIndicator.js | 8 +- Libraries/Components/View/ViewPropTypes.js | 100 +++++++++--------- Libraries/Geolocation/Geolocation.js | 8 +- Libraries/Linking/Linking.js | 6 +- Libraries/Modal/Modal.js | 22 ++-- Libraries/Network/NetInfo.js | 16 +-- .../PermissionsAndroid/PermissionsAndroid.js | 6 +- .../PushNotificationIOS.js | 36 +++---- Libraries/Storage/AsyncStorage.js | 24 ++--- Libraries/Vibration/Vibration.js | 6 +- RNTester/js/ListExampleShared.js | 2 +- RNTester/js/RNTesterApp.ios.js | 6 +- bots/dangerfile.js | 4 +- flow-github/metro.js | 2 +- local-cli/link/ios/getTargets.js | 2 +- local-cli/link/ios/registerNativeModule.js | 8 +- local-cli/link/unlink.js | 2 +- 22 files changed, 151 insertions(+), 151 deletions(-) diff --git a/Libraries/Alert/Alert.js b/Libraries/Alert/Alert.js index 7c775fddf..bcb517144 100644 --- a/Libraries/Alert/Alert.js +++ b/Libraries/Alert/Alert.js @@ -28,14 +28,14 @@ type Options = { /** * Launches an alert dialog with the specified title and message. - * + * * See http://facebook.github.io/react-native/docs/alert.html */ class Alert { /** * Launches an alert dialog with the specified title and message. - * + * * See http://facebook.github.io/react-native/docs/alert.html#alert */ static alert( diff --git a/Libraries/Alert/AlertIOS.js b/Libraries/Alert/AlertIOS.js index 25dff6f34..b25440646 100644 --- a/Libraries/Alert/AlertIOS.js +++ b/Libraries/Alert/AlertIOS.js @@ -101,7 +101,7 @@ class AlertIOS { /** * Create and display a prompt to enter some text. - * + * * See http://facebook.github.io/react-native/docs/alertios.html#prompt */ static prompt( diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index 3fc13c588..f2faa9480 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -45,8 +45,8 @@ class AppState extends NativeEventEmitter { let eventUpdated = false; // TODO: this is a terrible solution - in order to ensure `currentState` - // prop is up to date, we have to register an observer that updates it - // whenever the state changes, even if nobody cares. We should just + // prop is up to date, we have to register an observer that updates it + // whenever the state changes, even if nobody cares. We should just // deprecate the `currentState` property and get rid of this. this.addListener( 'appStateDidChange', @@ -70,14 +70,14 @@ class AppState extends NativeEventEmitter { } // TODO: now that AppState is a subclass of NativeEventEmitter, we could - // deprecate `addEventListener` and `removeEventListener` and just use - // addListener` and `listener.remove()` directly. That will be a breaking + // deprecate `addEventListener` and `removeEventListener` and just use + // addListener` and `listener.remove()` directly. That will be a breaking // change though, as both the method and event names are different // (addListener events are currently required to be globally unique). /** * Add a handler to AppState changes by listening to the `change` event type * and providing the handler. - * + * * See http://facebook.github.io/react-native/docs/appstate.html#addeventlistener */ addEventListener( @@ -105,7 +105,7 @@ class AppState extends NativeEventEmitter { /** * Remove a handler by passing the `change` event type and the handler. - * + * * See http://facebook.github.io/react-native/docs/appstate.html#removeeventlistener */ removeEventListener( diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js index f7d326f01..b08593a06 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js @@ -25,8 +25,8 @@ var _subscriptions = new Map(); /** * Sometimes it's useful to know whether or not the device has a screen reader * that is currently active. The `AccessibilityInfo` API is designed for this - * purpose. You can use it to query the current state of the screen reader as - * well as to register to be notified when the state of the screen reader + * purpose. You can use it to query the current state of the screen reader as + * well as to register to be notified when the state of the screen reader * changes. * * See http://facebook.github.io/react-native/docs/accessibilityinfo.html diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js index 6472c359c..822f0dcba 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js @@ -28,8 +28,8 @@ var _subscriptions = new Map(); /** * Sometimes it's useful to know whether or not the device has a screen reader * that is currently active. The `AccessibilityInfo` API is designed for this - * purpose. You can use it to query the current state of the screen reader as - * well as to register to be notified when the state of the screen reader + * purpose. You can use it to query the current state of the screen reader as + * well as to register to be notified when the state of the screen reader * changes. * * See http://facebook.github.io/react-native/docs/accessibilityinfo.html @@ -37,11 +37,11 @@ var _subscriptions = new Map(); var AccessibilityInfo = { /** - * Query whether a screen reader is currently enabled. - * - * Returns a promise which resolves to a boolean. + * Query whether a screen reader is currently enabled. + * + * Returns a promise which resolves to a boolean. * The result is `true` when a screen reader is enabledand `false` otherwise. - * + * * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#fetch */ fetch: function(): Promise { @@ -65,7 +65,7 @@ var AccessibilityInfo = { * - `announcement`: The string announced by the screen reader. * - `success`: A boolean indicating whether the announcement was * successfully made. - * + * * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#addeventlistener */ addEventListener: function ( @@ -94,9 +94,9 @@ var AccessibilityInfo = { /** * Set accessibility focus to a react component. - * + * * @platform ios - * + * * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#setaccessibilityfocus */ setAccessibilityFocus: function( @@ -109,7 +109,7 @@ var AccessibilityInfo = { * Post a string to be announced by the screen reader. * * @platform ios - * + * * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#announceforaccessibility */ announceForAccessibility: function( @@ -120,7 +120,7 @@ var AccessibilityInfo = { /** * Remove an event handler. - * + * * See http://facebook.github.io/react-native/docs/accessibilityinfo.html#removeeventlistener */ removeEventListener: function( diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index df941368d..6f9d34966 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -46,20 +46,20 @@ const ActivityIndicator = createReactClass({ ...ViewPropTypes, /** * Whether to show the indicator (true, the default) or hide it (false). - * + * * See http://facebook.github.io/react-native/docs/activityindicator.html#animating */ animating: PropTypes.bool, /** * The foreground color of the spinner (default is gray). - * + * * See http://facebook.github.io/react-native/docs/activityindicator.html#color */ color: ColorPropType, /** * Size of the indicator (default is 'small'). * Passing a number to the size prop is only supported on Android. - * + * * See http://facebook.github.io/react-native/docs/activityindicator.html#size */ size: PropTypes.oneOfType([ @@ -70,7 +70,7 @@ const ActivityIndicator = createReactClass({ * Whether the indicator should hide when not animating (true by default). * * @platform ios - * + * * See http://facebook.github.io/react-native/docs/activityindicator.html#hideswhenstopped */ hidesWhenStopped: PropTypes.bool, diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index 7731c7e4a..7ced5e35f 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -84,9 +84,9 @@ module.exports = { ...PlatformViewPropTypes, /** - * When `true`, indicates that the view is an accessibility element. + * When `true`, indicates that the view is an accessibility element. * By default, all the touchable elements are accessible. - * + * * See http://facebook.github.io/react-native/docs/view.html#accessible */ accessible: PropTypes.bool, @@ -95,7 +95,7 @@ module.exports = { * Overrides the text that's read by the screen reader when the user interacts * with the element. By default, the label is constructed by traversing all * the children and accumulating all the `Text` nodes separated by space. - * + * * See http://facebook.github.io/react-native/docs/view.html#accessibilitylabel */ accessibilityLabel: PropTypes.node, @@ -112,7 +112,7 @@ module.exports = { * native one. Works for Android only. * * @platform android - * + * * See http://facebook.github.io/react-native/docs/view.html#accessibilitycomponenttype */ accessibilityComponentType: PropTypes.oneOf(AccessibilityComponentTypes), @@ -122,7 +122,7 @@ module.exports = { * when this view changes. Works for Android API >= 19 only. * * @platform android - * + * * See http://facebook.github.io/react-native/docs/view.html#accessibilityliveregion */ accessibilityLiveRegion: PropTypes.oneOf([ @@ -137,7 +137,7 @@ module.exports = { * that query the screen. Works for Android only. * * @platform android - * + * * See http://facebook.github.io/react-native/docs/view.html#importantforaccessibility */ importantForAccessibility: PropTypes.oneOf([ @@ -154,7 +154,7 @@ module.exports = { * You can provide one trait or an array of many traits. * * @platform ios - * + * * See http://facebook.github.io/react-native/docs/view.html#accessibilitytraits */ accessibilityTraits: PropTypes.oneOfType([ @@ -168,17 +168,17 @@ module.exports = { * Default is `false`. * * @platform ios - * + * * See http://facebook.github.io/react-native/docs/view.html#accessibilityviewismodal */ accessibilityViewIsModal: PropTypes.bool, - + /** * A value indicating whether the accessibility elements contained within * this accessibility element are hidden. * * @platform ios - * + * * See http://facebook.github.io/react-native/docs/view.html#accessibilityElementsHidden */ accessibilityElementsHidden: PropTypes.bool, @@ -194,7 +194,7 @@ module.exports = { /** * When `accessible` is true, the system will try to invoke this function * when the user performs accessibility tap gesture. - * + * * See http://facebook.github.io/react-native/docs/view.html#onaccessibilitytap */ onAccessibilityTap: PropTypes.func, @@ -202,7 +202,7 @@ module.exports = { /** * When `accessible` is `true`, the system will invoke this function when the * user performs the magic tap gesture. - * + * * See http://facebook.github.io/react-native/docs/view.html#onmagictap */ onMagicTap: PropTypes.func, @@ -211,7 +211,7 @@ module.exports = { * Used to locate this view in end-to-end tests. * * > This disables the 'layout-only view removal' optimization for this view! - * + * * See http://facebook.github.io/react-native/docs/view.html#testid */ testID: PropTypes.string, @@ -220,7 +220,7 @@ module.exports = { * Used to locate this view from native classes. * * > This disables the 'layout-only view removal' optimization for this view! - * + * * See http://facebook.github.io/react-native/docs/view.html#nativeid */ nativeID: PropTypes.string, @@ -232,12 +232,12 @@ module.exports = { */ /** - * The View is now responding for touch events. This is the time to highlight + * The View is now responding for touch events. This is the time to highlight * and show the user what is happening. * * `View.props.onResponderGrant: (event) => {}`, where `event` is a synthetic * touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onrespondergrant */ onResponderGrant: PropTypes.func, @@ -245,20 +245,20 @@ module.exports = { /** * The user is moving their finger. * - * `View.props.onResponderMove: (event) => {}`, where `event` is a synthetic + * `View.props.onResponderMove: (event) => {}`, where `event` is a synthetic * touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onrespondermove */ onResponderMove: PropTypes.func, /** - * Another responder is already active and will not release it to that `View` + * Another responder is already active and will not release it to that `View` * asking to be the responder. * - * `View.props.onResponderReject: (event) => {}`, where `event` is a + * `View.props.onResponderReject: (event) => {}`, where `event` is a * synthetic touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onresponderreject */ onResponderReject: PropTypes.func, @@ -266,33 +266,33 @@ module.exports = { /** * Fired at the end of the touch. * - * `View.props.onResponderRelease: (event) => {}`, where `event` is a + * `View.props.onResponderRelease: (event) => {}`, where `event` is a * synthetic touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onresponderrelease */ onResponderRelease: PropTypes.func, /** * The responder has been taken from the `View`. Might be taken by other - * views after a call to `onResponderTerminationRequest`, or might be taken - * by the OS without asking (e.g., happens with control center/ notification + * views after a call to `onResponderTerminationRequest`, or might be taken + * by the OS without asking (e.g., happens with control center/ notification * center on iOS) * - * `View.props.onResponderTerminate: (event) => {}`, where `event` is a + * `View.props.onResponderTerminate: (event) => {}`, where `event` is a * synthetic touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onresponderterminate */ onResponderTerminate: PropTypes.func, /** - * Some other `View` wants to become responder and is asking this `View` to + * Some other `View` wants to become responder and is asking this `View` to * release its responder. Returning `true` allows its release. * - * `View.props.onResponderTerminationRequest: (event) => {}`, where `event` + * `View.props.onResponderTerminationRequest: (event) => {}`, where `event` * is a synthetic touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onresponderterminationrequest */ onResponderTerminationRequest: PropTypes.func, @@ -300,31 +300,31 @@ module.exports = { /** * Does this view want to become responder on the start of a touch? * - * `View.props.onStartShouldSetResponder: (event) => [true | false]`, where + * `View.props.onStartShouldSetResponder: (event) => [true | false]`, where * `event` is a synthetic touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onstartshouldsetresponder */ onStartShouldSetResponder: PropTypes.func, /** - * If a parent `View` wants to prevent a child `View` from becoming responder + * If a parent `View` wants to prevent a child `View` from becoming responder * on a touch start, it should have this handler which returns `true`. * - * `View.props.onStartShouldSetResponderCapture: (event) => [true | false]`, + * `View.props.onStartShouldSetResponderCapture: (event) => [true | false]`, * where `event` is a synthetic touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onstartshouldsetrespondercapture */ onStartShouldSetResponderCapture: PropTypes.func, /** - * Does this view want to "claim" touch responsiveness? This is called for + * Does this view want to "claim" touch responsiveness? This is called for * every touch move on the `View` when it is not the responder. * - * `View.props.onMoveShouldSetResponder: (event) => [true | false]`, where + * `View.props.onMoveShouldSetResponder: (event) => [true | false]`, where * `event` is a synthetic touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onmoveshouldsetresponder */ onMoveShouldSetResponder: PropTypes.func, @@ -332,10 +332,10 @@ module.exports = { /** * If a parent `View` wants to prevent a child `View` from becoming responder * on a move, it should have this handler which returns `true`. - * + * * `View.props.onMoveShouldSetResponderCapture: (event) => [true | false]`, * where `event` is a synthetic touch event as described above. - * + * * See http://facebook.github.io/react-native/docs/view.html#onMoveShouldsetrespondercapture */ onMoveShouldSetResponderCapture: PropTypes.func, @@ -348,7 +348,7 @@ module.exports = { * > The touch area never extends past the parent view bounds and the Z-index * > of sibling views always takes precedence if a touch hits two overlapping * > views. - * + * * See http://facebook.github.io/react-native/docs/view.html#hitslop */ hitSlop: EdgeInsetsPropType, @@ -361,14 +361,14 @@ module.exports = { * This event is fired immediately once the layout has been calculated, but * the new layout may not yet be reflected on the screen at the time the * event is received, especially if a layout animation is in progress. - * + * * See http://facebook.github.io/react-native/docs/view.html#onlayout */ onLayout: PropTypes.func, /** * Controls whether the `View` can be the target of touch events. - * + * * See http://facebook.github.io/react-native/docs/view.html#pointerevents */ pointerEvents: PropTypes.oneOf([ @@ -390,7 +390,7 @@ module.exports = { * view that contains many subviews that extend outside its bound. The * subviews must also have `overflow: hidden`, as should the containing view * (or one of its superviews). - * + * * See http://facebook.github.io/react-native/docs/view.html#removeclippedsubviews */ removeClippedSubviews: PropTypes.bool, @@ -400,7 +400,7 @@ module.exports = { * single hardware texture on the GPU. * * @platform android - * + * * See http://facebook.github.io/react-native/docs/view.html#rendertohardwaretextureandroid */ renderToHardwareTextureAndroid: PropTypes.bool, @@ -409,7 +409,7 @@ module.exports = { * Whether this `View` should be rendered as a bitmap before compositing. * * @platform ios - * + * * See http://facebook.github.io/react-native/docs/view.html#shouldrasterizeios */ shouldRasterizeIOS: PropTypes.bool, @@ -421,17 +421,17 @@ module.exports = { * ensure that this `View` exists in the native view hierarchy. * * @platform android - * + * * See http://facebook.github.io/react-native/docs/view.html#collapsable */ collapsable: PropTypes.bool, /** - * Whether this `View` needs to rendered offscreen and composited with an - * alpha in order to preserve 100% correct colors and blending behavior. + * Whether this `View` needs to rendered offscreen and composited with an + * alpha in order to preserve 100% correct colors and blending behavior. * * @platform android - * + * * See http://facebook.github.io/react-native/docs/view.html#needsoffscreenalphacompositing */ needsOffscreenAlphaCompositing: PropTypes.bool, diff --git a/Libraries/Geolocation/Geolocation.js b/Libraries/Geolocation/Geolocation.js index d5d8fcd30..a4efe4c02 100644 --- a/Libraries/Geolocation/Geolocation.js +++ b/Libraries/Geolocation/Geolocation.js @@ -63,7 +63,7 @@ var Geolocation = { /* * Request suitable Location permission based on the key configured on pList. - * + * * See https://facebook.github.io/react-native/docs/geolocation.html#requestauthorization */ requestAuthorization: function() { @@ -71,8 +71,8 @@ var Geolocation = { }, /* - * Invokes the success callback once with the latest location info. - * + * Invokes the success callback once with the latest location info. + * * See https://facebook.github.io/react-native/docs/geolocation.html#getcurrentposition */ getCurrentPosition: async function( @@ -109,7 +109,7 @@ var Geolocation = { /* * Invokes the success callback whenever the location changes. - * + * * See https://facebook.github.io/react-native/docs/geolocation.html#watchposition */ watchPosition: function(success: Function, error?: Function, options?: GeoOptions): number { diff --git a/Libraries/Linking/Linking.js b/Libraries/Linking/Linking.js index 799ad055c..a621e647a 100644 --- a/Libraries/Linking/Linking.js +++ b/Libraries/Linking/Linking.js @@ -21,7 +21,7 @@ const LinkingManager = Platform.OS === 'android' ? /** * `Linking` gives you a general interface to interact with both incoming * and outgoing app links. - * + * * See https://facebook.github.io/react-native/docs/linking.html */ class Linking extends NativeEventEmitter { @@ -33,7 +33,7 @@ class Linking extends NativeEventEmitter { /** * Add a handler to Linking changes by listening to the `url` event type * and providing the handler - * + * * See https://facebook.github.io/react-native/docs/linking.html#addeventlistener */ addEventListener(type: string, handler: Function) { @@ -42,7 +42,7 @@ class Linking extends NativeEventEmitter { /** * Remove a handler by passing the `url` event type and the handler. - * + * * See https://facebook.github.io/react-native/docs/linking.html#removeeventlistener */ removeEventListener(type: string, handler: Function ) { diff --git a/Libraries/Modal/Modal.js b/Libraries/Modal/Modal.js index 50a73dd19..dabdbc5d9 100644 --- a/Libraries/Modal/Modal.js +++ b/Libraries/Modal/Modal.js @@ -29,7 +29,7 @@ import type EmitterSubscription from 'EmitterSubscription'; /** * The Modal component is a simple way to present content above an enclosing view. - * + * * See https://facebook.github.io/react-native/docs/modal.html */ @@ -49,48 +49,48 @@ class Modal extends React.Component { animationType: PropTypes.oneOf(['none', 'slide', 'fade']), /** * The `presentationStyle` prop controls how the modal appears. - * + * * See https://facebook.github.io/react-native/docs/modal.html#presentationstyle */ presentationStyle: PropTypes.oneOf(['fullScreen', 'pageSheet', 'formSheet', 'overFullScreen']), /** * The `transparent` prop determines whether your modal will fill the - * entire view. - * + * entire view. + * * See https://facebook.github.io/react-native/docs/modal.html#transparent */ transparent: PropTypes.bool, /** * The `hardwareAccelerated` prop controls whether to force hardware * acceleration for the underlying window. - * + * * See https://facebook.github.io/react-native/docs/modal.html#hardwareaccelerated */ hardwareAccelerated: PropTypes.bool, /** * The `visible` prop determines whether your modal is visible. - * + * * See https://facebook.github.io/react-native/docs/modal.html#visible */ visible: PropTypes.bool, /** * The `onRequestClose` callback is called when the user taps the hardware * back button on Android or the menu button on Apple TV. - * + * * See https://facebook.github.io/react-native/docs/modal.html#onrequestclose */ onRequestClose: (Platform.isTVOS || Platform.OS === 'android') ? PropTypes.func.isRequired : PropTypes.func, /** * The `onShow` prop allows passing a function that will be called once the * modal has been shown. - * + * * See https://facebook.github.io/react-native/docs/modal.html#onshow */ onShow: PropTypes.func, /** * The `onDismiss` prop allows passing a function that will be called once * the modal has been dismissed. - * + * * See https://facebook.github.io/react-native/docs/modal.html#ondismiss */ onDismiss: PropTypes.func, @@ -100,13 +100,13 @@ class Modal extends React.Component { ), /** * The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations. - * + * * See https://facebook.github.io/react-native/docs/modal.html#supportedorientations */ supportedOrientations: PropTypes.arrayOf(PropTypes.oneOf(['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right'])), /** * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed. - * + * * See https://facebook.github.io/react-native/docs/modal.html#onorientationchange */ onOrientationChange: PropTypes.func, diff --git a/Libraries/Network/NetInfo.js b/Libraries/Network/NetInfo.js index 64a8386d0..0db9d4eab 100644 --- a/Libraries/Network/NetInfo.js +++ b/Libraries/Network/NetInfo.js @@ -80,13 +80,13 @@ const _isConnectedSubscriptions = new Map(); /** * NetInfo exposes info about online/offline status. - * + * * See https://facebook.github.io/react-native/docs/netinfo.html */ const NetInfo = { /** * Adds an event handler. - * + * * See https://facebook.github.io/react-native/docs/netinfo.html#addeventlistener */ addEventListener( @@ -128,7 +128,7 @@ const NetInfo = { /** * Removes the listener for network status changes. - * + * * See https://facebook.github.io/react-native/docs/netinfo.html#removeeventlistener */ removeEventListener( @@ -144,10 +144,10 @@ const NetInfo = { }, /** - * This function is deprecated. Use `getConnectionInfo` instead. + * This function is deprecated. Use `getConnectionInfo` instead. * Returns a promise that resolves with one of the deprecated connectivity * types: - * + * * The following connectivity types are deprecated. They're used by the * deprecated APIs `fetch` and the `change` event. * @@ -167,13 +167,13 @@ const NetInfo = { * - `MOBILE_HIPRI` - A High Priority Mobile data connection. * - `MOBILE_MMS` - An MMS-specific Mobile data connection. * - `MOBILE_SUPL` - A SUPL-specific Mobile data connection. - * - `VPN` - A virtual network using one or more native bearers. Requires + * - `VPN` - A virtual network using one or more native bearers. Requires * API Level 21 * - `WIFI` - The WIFI data connection. * - `WIMAX` - The WiMAX data connection. * - `UNKNOWN` - Unknown data connection. * - * The rest of the connectivity types are hidden by the Android API, but can + * The rest of the connectivity types are hidden by the Android API, but can * be used if necessary. */ fetch(): Promise { @@ -196,7 +196,7 @@ const NetInfo = { /** * An object with the same methods as above but the listener receives a * boolean which represents the internet connectivity. - * + * * See https://facebook.github.io/react-native/docs/netinfo.html#isconnected */ isConnected: { diff --git a/Libraries/PermissionsAndroid/PermissionsAndroid.js b/Libraries/PermissionsAndroid/PermissionsAndroid.js index 7cb8a8411..18858e166 100644 --- a/Libraries/PermissionsAndroid/PermissionsAndroid.js +++ b/Libraries/PermissionsAndroid/PermissionsAndroid.js @@ -19,7 +19,7 @@ type Rationale = { type PermissionStatus = 'granted' | 'denied' | 'never_ask_again'; /** * `PermissionsAndroid` provides access to Android M's new permissions model. - * + * * See https://facebook.github.io/react-native/docs/permissionsandroid.html */ @@ -81,7 +81,7 @@ class PermissionsAndroid { /** * Returns a promise resolving to a boolean value as to whether the specified * permissions has been granted - * + * * See https://facebook.github.io/react-native/docs/permissionsandroid.html#check */ check(permission: string) : Promise { @@ -135,7 +135,7 @@ class PermissionsAndroid { * Prompts the user to enable multiple permissions in the same dialog and * returns an object with the permissions as keys and strings as values * indicating whether the user allowed or denied the request - * + * * See https://facebook.github.io/react-native/docs/permissionsandroid.html#requestmultiple */ requestMultiple(permissions: Array) : Promise<{[permission: string]: PermissionStatus}> { diff --git a/Libraries/PushNotificationIOS/PushNotificationIOS.js b/Libraries/PushNotificationIOS/PushNotificationIOS.js index 1a131a574..955bdf8c1 100644 --- a/Libraries/PushNotificationIOS/PushNotificationIOS.js +++ b/Libraries/PushNotificationIOS/PushNotificationIOS.js @@ -102,7 +102,7 @@ class PushNotificationIOS { /** * Cancels all scheduled localNotifications. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#cancelalllocalnotifications */ static cancelAllLocalNotifications() { @@ -111,7 +111,7 @@ class PushNotificationIOS { /** * Remove all delivered notifications from Notification Center. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#removealldeliverednotifications */ static removeAllDeliveredNotifications(): void { @@ -138,7 +138,7 @@ class PushNotificationIOS { /** * Sets the badge number for the app icon on the home screen. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#setapplicationiconbadgenumber */ static setApplicationIconBadgeNumber(number: number) { @@ -147,7 +147,7 @@ class PushNotificationIOS { /** * Gets the current badge number for the app icon on the home screen. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getapplicationiconbadgenumber */ static getApplicationIconBadgeNumber(callback: Function) { @@ -165,7 +165,7 @@ class PushNotificationIOS { /** * Gets the local notifications that are currently scheduled. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getscheduledlocalnotifications */ static getScheduledLocalNotifications(callback: Function) { @@ -219,7 +219,7 @@ class PushNotificationIOS { /** * Removes the event listener. Do this in `componentWillUnmount` to prevent * memory leaks. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#removeeventlistener */ static removeEventListener(type: PushNotificationEventName, handler: Function) { @@ -240,7 +240,7 @@ class PushNotificationIOS { * dialog box. By default, it will request all notification permissions, but * a subset of these can be requested by passing a map of requested * permissions. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#requestpermissions */ static requestPermissions(permissions?: { @@ -281,7 +281,7 @@ class PushNotificationIOS { /** * See what push permissions are currently enabled. `callback` will be * invoked with a `permissions` object. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#checkpermissions */ static checkPermissions(callback: Function) { @@ -295,7 +295,7 @@ class PushNotificationIOS { /** * This method returns a promise that resolves to either the notification * object if the app was launched by a push notification, or `null` otherwise. - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getinitialnotification */ static getInitialNotification(): Promise { @@ -308,7 +308,7 @@ class PushNotificationIOS { * You will never need to instantiate `PushNotificationIOS` yourself. * Listening to the `notification` event and invoking * `getInitialNotification` is sufficient - * + * */ constructor(nativeNotif: Object) { this._data = {}; @@ -347,7 +347,7 @@ class PushNotificationIOS { /** * This method is available for remote notifications that have been received via: * `application:didReceiveRemoteNotification:fetchCompletionHandler:` - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#finish */ finish(fetchResult: string) { @@ -369,7 +369,7 @@ class PushNotificationIOS { /** * Gets the sound string from the `aps` object - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getsound */ getSound(): ?string { @@ -378,7 +378,7 @@ class PushNotificationIOS { /** * Gets the category string from the `aps` object - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getcategory */ getCategory(): ?string { @@ -387,7 +387,7 @@ class PushNotificationIOS { /** * Gets the notification's main message from the `aps` object - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getalert */ getAlert(): ?string | ?Object { @@ -396,7 +396,7 @@ class PushNotificationIOS { /** * Gets the content-available number from the `aps` object - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getcontentavailable */ getContentAvailable(): ContentAvailable { @@ -405,7 +405,7 @@ class PushNotificationIOS { /** * Gets the badge count number from the `aps` object - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getbadgecount */ getBadgeCount(): ?number { @@ -414,7 +414,7 @@ class PushNotificationIOS { /** * Gets the data object on the notif - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getdata */ getData(): ?Object { @@ -423,7 +423,7 @@ class PushNotificationIOS { /** * Gets the thread ID on the notif - * + * * See https://facebook.github.io/react-native/docs/pushnotificationios.html#getthreadid */ getThreadID(): ?string { diff --git a/Libraries/Storage/AsyncStorage.js b/Libraries/Storage/AsyncStorage.js index 62228f783..4e262e615 100644 --- a/Libraries/Storage/AsyncStorage.js +++ b/Libraries/Storage/AsyncStorage.js @@ -20,9 +20,9 @@ const RCTAsyncStorage = NativeModules.AsyncRocksDBStorage || /** * `AsyncStorage` is a simple, unencrypted, asynchronous, persistent, key-value - * storage system that is global to the app. It should be used instead of + * storage system that is global to the app. It should be used instead of * LocalStorage. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html */ var AsyncStorage = { @@ -32,7 +32,7 @@ var AsyncStorage = { /** * Fetches an item for a `key` and invokes a callback upon completion. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html#getitem */ getItem: function( @@ -56,7 +56,7 @@ var AsyncStorage = { /** * Sets the value for a `key` and invokes a callback upon completion. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html#setitem */ setItem: function( @@ -79,7 +79,7 @@ var AsyncStorage = { /** * Removes an item for a `key` and invokes a callback upon completion. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html#removeitem */ removeItem: function( @@ -129,7 +129,7 @@ var AsyncStorage = { * Erases *all* `AsyncStorage` for all clients, libraries, etc. You probably * don't want to call this; use `removeItem` or `multiRemove` to clear only * your app's keys. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html#clear */ clear: function(callback?: ?(error: ?Error) => void): Promise { @@ -173,9 +173,9 @@ var AsyncStorage = { * indicate which key caused the error. */ - /** + /** * Flushes any pending requests using a single batch call to get the data. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html#flushgetrequests * */ flushGetRequests: function(): void { @@ -209,7 +209,7 @@ var AsyncStorage = { * This allows you to batch the fetching of items given an array of `key` * inputs. Your callback will be invoked with an array of corresponding * key-value pairs found. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html#multiget */ multiGet: function( @@ -273,7 +273,7 @@ var AsyncStorage = { /** * Call this to batch the deletion of all keys in the `keys` array. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html#multiremove */ multiRemove: function( @@ -296,9 +296,9 @@ var AsyncStorage = { /** * Batch operation to merge in existing and new values for a given set of * keys. This assumes that the values are stringified JSON. - * + * * **NOTE**: This is not supported by all native implementations. - * + * * See http://facebook.github.io/react-native/docs/asyncstorage.html#multimerge */ multiMerge: function( diff --git a/Libraries/Vibration/Vibration.js b/Libraries/Vibration/Vibration.js index e01da3d40..7f10cda29 100644 --- a/Libraries/Vibration/Vibration.js +++ b/Libraries/Vibration/Vibration.js @@ -15,7 +15,7 @@ var Platform = require('Platform'); /** * Vibration API - * + * * See https://facebook.github.io/react-native/docs/vibration.html */ @@ -57,7 +57,7 @@ function vibrateScheduler(id, pattern: Array, repeat: boolean, nextIndex var Vibration = { /** * Trigger a vibration with specified `pattern`. - * + * * See https://facebook.github.io/react-native/docs/vibration.html#vibrate */ vibrate: function(pattern: number | Array = 400, repeat: boolean = false) { @@ -84,7 +84,7 @@ var Vibration = { }, /** * Stop vibration - * + * * See https://facebook.github.io/react-native/docs/vibration.html#cancel */ cancel: function() { diff --git a/RNTester/js/ListExampleShared.js b/RNTester/js/ListExampleShared.js index 84d2fb37c..96ace6156 100644 --- a/RNTester/js/ListExampleShared.js +++ b/RNTester/js/ListExampleShared.js @@ -199,7 +199,7 @@ function pressItem(context: Object, key: string) { } function renderSmallSwitchOption(context: Object, key: string) { - if(Platform.isTVOS) { + if (Platform.isTVOS) { return null; } return ( diff --git a/RNTester/js/RNTesterApp.ios.js b/RNTester/js/RNTesterApp.ios.js index 249b2754f..26ee1ebbd 100644 --- a/RNTester/js/RNTesterApp.ios.js +++ b/RNTester/js/RNTesterApp.ios.js @@ -144,9 +144,9 @@ const styles = StyleSheet.create({ borderBottomColor: '#96969A', backgroundColor: '#F5F5F6', }, - header: { - height: 40, - flexDirection: 'row' + header: { + height: 40, + flexDirection: 'row' }, headerLeft: { }, diff --git a/bots/dangerfile.js b/bots/dangerfile.js index 52079c27d..fc727e2f0 100644 --- a/bots/dangerfile.js +++ b/bots/dangerfile.js @@ -99,7 +99,7 @@ if (danger.git.modified_files + danger.git.added_files + danger.git.deleted_file const issueCommandsFileModified = includes(danger.git.modified_files, 'bots/IssueCommands.txt'); if (issueCommandsFileModified) { const title = ':exclamation: Bots'; - const idea = 'This PR appears to modify the list of people that may issue ' + + const idea = 'This PR appears to modify the list of people that may issue ' + 'commands to the GitHub bot.'; warn(`${title} - ${idea}`); } @@ -107,7 +107,7 @@ if (issueCommandsFileModified) { // Warns if the PR is opened against stable, as commits need to be cherry picked and tagged by a release maintainer. // Fails if the PR is opened against anything other than `master` or `-stable`. const isMergeRefMaster = danger.github.pr.base.ref === 'master'; -const isMergeRefStable = danger.github.pr.base.ref.indexOf(`-stable`) !== -1; +const isMergeRefStable = danger.github.pr.base.ref.indexOf('-stable') !== -1; if (!isMergeRefMaster && isMergeRefStable) { const title = ':grey_question: Base Branch'; const idea = 'The base branch for this PR is something other than `master`. Are you sure you want to merge these changes into a stable release? If you are interested in backporting updates to an older release, the suggested approach is to land those changes on `master` first and then cherry-pick the commits into the branch for that release. The [Releases Guide](https://github.com/facebook/react-native/blob/master/Releases.md) has more information.'; diff --git a/flow-github/metro.js b/flow-github/metro.js index ec84de96d..ff06b4277 100644 --- a/flow-github/metro.js +++ b/flow-github/metro.js @@ -21,4 +21,4 @@ declare module 'metro/src/HmrServer' { declare module 'metro/src/lib/bundle-modules/HMRClient' { declare module.exports: any; -} \ No newline at end of file +} diff --git a/local-cli/link/ios/getTargets.js b/local-cli/link/ios/getTargets.js index c85bcd16a..784eed217 100644 --- a/local-cli/link/ios/getTargets.js +++ b/local-cli/link/ios/getTargets.js @@ -22,6 +22,6 @@ module.exports = function getTargets(project) { target: nativeTargetSection[key], name: nativeTargetSection[key].productReference_comment, isTVOS: (buildConfiguration.buildSettings.SDKROOT && (buildConfiguration.buildSettings.SDKROOT.indexOf('appletv') !== -1)) || false - } + }; }); }; diff --git a/local-cli/link/ios/registerNativeModule.js b/local-cli/link/ios/registerNativeModule.js index 470776898..fed2b0bb2 100644 --- a/local-cli/link/ios/registerNativeModule.js +++ b/local-cli/link/ios/registerNativeModule.js @@ -46,8 +46,8 @@ module.exports = function registerNativeModuleIOS(dependencyConfig, projectConfi getTargets(dependencyProject).forEach(product => { var i; if (!product.isTVOS) { - for (i=0; i