From 94666f16c7da37e649316d40ea23d7a8054a04f9 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Tue, 9 Aug 2016 06:32:41 -0700 Subject: [PATCH] Auto-fix lint errors Reviewed By: bestander Differential Revision: D3683952 fbshipit-source-id: 9484d0b0e86859e8edaca0da1aa13a667f200905 --- Libraries/ActionSheetIOS/ActionSheetIOS.js | 2 +- .../Animated/src/AnimatedImplementation.js | 8 +-- Libraries/Animated/src/Interpolation.js | 12 ++-- Libraries/AppRegistry/AppRegistry.js | 6 +- Libraries/AppState/AppState.js | 2 +- .../ActivityIndicator/ActivityIndicator.js | 8 +-- .../DatePicker/DatePickerIOS.ios.js | 2 +- .../DatePickerAndroid.android.js | 2 +- .../Keyboard/KeyboardAvoidingView.js | 30 ++++---- Libraries/Components/MapView/MapView.js | 16 ++--- .../Picker/PickerAndroid.android.js | 4 +- Libraries/Components/ScrollResponder.js | 14 ++-- .../SegmentedControlIOS.ios.js | 4 +- Libraries/Components/Slider/Slider.js | 2 +- .../Components/SliderIOS/SliderIOS.ios.js | 2 +- Libraries/Components/StatusBar/StatusBar.js | 4 +- Libraries/Components/Switch/Switch.js | 4 +- .../Components/SwitchIOS/SwitchIOS.ios.js | 4 +- .../Components/Touchable/TouchableBounce.js | 4 +- .../ViewPager/ViewPagerAndroid.android.js | 6 +- Libraries/Components/WebView/WebView.ios.js | 6 +- .../ListView/ListViewDataSource.js | 8 +-- .../NavigationHeaderTitle.js | 8 +-- .../CustomComponents/Navigator/Navigator.js | 2 +- .../EventEmitter/RCTDeviceEventEmitter.js | 2 +- Libraries/Experimental/Incremental.js | 14 ++-- .../Experimental/IncrementalPresenter.js | 12 ++-- Libraries/Experimental/WindowedListView.js | 58 +++++++-------- Libraries/Geolocation/Geolocation.js | 8 +-- Libraries/Image/ImageEditor.js | 26 +++---- Libraries/Image/ImageSource.js | 2 +- Libraries/Inspector/InspectorOverlay.js | 2 +- Libraries/Interaction/JSEventLoopWatchdog.js | 4 +- .../Initialization/getDevServer.js | 4 +- .../Initialization/parseErrorStack.js | 6 +- Libraries/LayoutAnimation/LayoutAnimation.js | 20 +++--- Libraries/Linking/Linking.js | 10 +-- .../__mocks__/NavigationRootContainer.js | 2 +- Libraries/Network/FormData.js | 12 ++-- Libraries/Network/NetInfo.js | 50 ++++++------- Libraries/ReactIOS/verifyPropTypes.js | 6 +- Libraries/Settings/Settings.ios.js | 2 +- Libraries/Storage/AsyncStorage.js | 4 +- Libraries/Text/Text.js | 8 +-- Libraries/Utilities/Alert.js | 12 ++-- Libraries/Utilities/AlertIOS.js | 20 +++--- Libraries/Utilities/BackAndroid.android.js | 4 +- Libraries/Utilities/HMRClient.js | 6 +- Libraries/Utilities/MessageQueue.js | 4 +- Libraries/Utilities/RCTRenderingPerf.js | 4 +- .../__mocks__/MessageQueueTestConfig.js | 72 +++++++++---------- .../Utilities/__tests__/MessageQueue-test.js | 12 ++-- .../Utilities/__tests__/groupByEveryN-test.js | 4 +- .../Utilities/__tests__/truncate-test.js | 16 ++--- Libraries/Utilities/deprecatedCallback.js | 2 +- Libraries/Utilities/differ/insetsDiffer.js | 8 +-- Libraries/Utilities/differ/pointsDiffer.js | 4 +- Libraries/Utilities/truncate.js | 6 +- 58 files changed, 293 insertions(+), 293 deletions(-) diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index 1e3ab80e1..e581e5266 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -44,7 +44,7 @@ var ActionSheetIOS = { /** * Display the iOS share sheet. The `options` object should contain - * one or both of `message` and `url` and can additionally have + * one or both of `message` and `url` and can additionally have * a `subject` or `excludedActivityTypes`: * * - `url` (string) - a URL to share diff --git a/Libraries/Animated/src/AnimatedImplementation.js b/Libraries/Animated/src/AnimatedImplementation.js index 9daf3bb39..ee57cfd58 100644 --- a/Libraries/Animated/src/AnimatedImplementation.js +++ b/Libraries/Animated/src/AnimatedImplementation.js @@ -1036,8 +1036,8 @@ class AnimatedInterpolation extends AnimatedWithChildren { return value; } if (/deg$/.test(value)) { - let degrees = parseFloat(value, 10) || 0; - let radians = degrees * Math.PI / 180.0; + const degrees = parseFloat(value, 10) || 0; + const radians = degrees * Math.PI / 180.0; return radians; } else { // Assume radians @@ -1346,7 +1346,7 @@ class AnimatedStyle extends AnimatedWithChildren { __getNativeConfig(): Object { var styleConfig = {}; - for (let styleKey in this._style) { + for (const styleKey in this._style) { if (this._style[styleKey] instanceof Animated) { styleConfig[styleKey] = this._style[styleKey].__getNativeTag(); } @@ -1475,7 +1475,7 @@ class AnimatedProps extends Animated { __getNativeConfig(): Object { var propsConfig = {}; - for (let propKey in this._props) { + for (const propKey in this._props) { var value = this._props[propKey]; if (value instanceof Animated) { propsConfig[propKey] = value.__getNativeTag(); diff --git a/Libraries/Animated/src/Interpolation.js b/Libraries/Animated/src/Interpolation.js index 32d363ccb..b8b18c80b 100644 --- a/Libraries/Animated/src/Interpolation.js +++ b/Libraries/Animated/src/Interpolation.js @@ -18,12 +18,12 @@ var normalizeColor = require('normalizeColor'); type ExtrapolateType = 'extend' | 'identity' | 'clamp'; export type InterpolationConfigType = { - inputRange: Array; - outputRange: (Array | Array); - easing?: ((input: number) => number); - extrapolate?: ExtrapolateType; - extrapolateLeft?: ExtrapolateType; - extrapolateRight?: ExtrapolateType; + inputRange: Array, + outputRange: (Array | Array), + easing?: ((input: number) => number), + extrapolate?: ExtrapolateType, + extrapolateLeft?: ExtrapolateType, + extrapolateRight?: ExtrapolateType, }; var linear = (t) => t; diff --git a/Libraries/AppRegistry/AppRegistry.js b/Libraries/AppRegistry/AppRegistry.js index 996c693b0..122a2248e 100644 --- a/Libraries/AppRegistry/AppRegistry.js +++ b/Libraries/AppRegistry/AppRegistry.js @@ -31,9 +31,9 @@ var runCount = 1; type ComponentProvider = () => ReactClass; type AppConfig = { - appKey: string; - component?: ComponentProvider; - run?: Function; + appKey: string, + component?: ComponentProvider, + run?: Function, }; /** diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index e8babe4dd..c3f5df27f 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -159,7 +159,7 @@ class AppState extends NativeEventEmitter { this._eventHandlers[type].get(handler).remove(); this._eventHandlers[type].delete(handler); } -}; +} AppState = new AppState(); diff --git a/Libraries/Components/ActivityIndicator/ActivityIndicator.js b/Libraries/Components/ActivityIndicator/ActivityIndicator.js index 94e41c306..7c9e7567a 100644 --- a/Libraries/Components/ActivityIndicator/ActivityIndicator.js +++ b/Libraries/Components/ActivityIndicator/ActivityIndicator.js @@ -26,10 +26,10 @@ const GRAY = '#999999'; type IndicatorSize = number | 'small' | 'large'; type DefaultProps = { - animating: boolean; - color: any; - hidesWhenStopped: boolean; - size: IndicatorSize; + animating: boolean, + color: any, + hidesWhenStopped: boolean, + size: IndicatorSize, } /** diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index 86b08e9aa..c1feda578 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -22,7 +22,7 @@ const View = require('View'); const requireNativeComponent = require('requireNativeComponent'); type DefaultProps = { - mode: 'date' | 'time' | 'datetime'; + mode: 'date' | 'time' | 'datetime', }; type Event = Object; diff --git a/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js b/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js index 64ae4a506..6c2760890 100644 --- a/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +++ b/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js @@ -62,7 +62,7 @@ class DatePickerAndroid { * when using the `minDate` and `maxDate` options. */ static async open(options: Object): Promise { - let optionsMs = options; + const optionsMs = options; if (optionsMs) { _toMillis(options, 'date'); _toMillis(options, 'minDate'); diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index afc13c6a5..3e56ec002 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -22,26 +22,26 @@ const View = require('View'); import type EmitterSubscription from 'EmitterSubscription'; type Rect = { - x: number; - y: number; - width: number; - height: number; + x: number, + y: number, + width: number, + height: number, }; type ScreenRect = { - screenX: number; - screenY: number; - width: number; - height: number; + screenX: number, + screenY: number, + width: number, + height: number, }; type KeyboardChangeEvent = { - startCoordinates?: ScreenRect; - endCoordinates: ScreenRect; - duration?: number; - easing?: string; + startCoordinates?: ScreenRect, + endCoordinates: ScreenRect, + duration?: number, + easing?: string, }; type LayoutEvent = { nativeEvent: { - layout: Rect; + layout: Rect, } }; @@ -53,12 +53,12 @@ const KeyboardAvoidingView = React.createClass({ propTypes: { ...View.propTypes, behavior: PropTypes.oneOf(['height', 'position', 'padding']), - + /** * The style of the content container(View) when behavior is 'position'. */ contentContainerStyle: View.propTypes.style, - + /** * This is the distance between the top of the user screen and the react native view, * may be non-zero in some use cases. diff --git a/Libraries/Components/MapView/MapView.js b/Libraries/Components/MapView/MapView.js index b7699ce39..ed9d3f989 100644 --- a/Libraries/Components/MapView/MapView.js +++ b/Libraries/Components/MapView/MapView.js @@ -34,23 +34,23 @@ export type AnnotationDragState = $Enum<{ /** * Annotation is not being touched. */ - idle: string; + idle: string, /** * Annotation dragging has began. */ - starting: string; + starting: string, /** * Annotation is being dragged. */ - dragging: string; + dragging: string, /** * Annotation dragging is being canceled. */ - canceling: string; + canceling: string, /** * Annotation dragging has ended. */ - ending: string; + ending: string, }>; /** @@ -412,7 +412,7 @@ const MapView = React.createClass({ })); } - let result = { + const result = { ...annotation, tintColor: tintColor && processColor(tintColor), image, @@ -430,8 +430,8 @@ const MapView = React.createClass({ return result; }); overlays = overlays && overlays.map((overlay: Object) => { - let {id, fillColor, strokeColor} = overlay; - let result = { + const {id, fillColor, strokeColor} = overlay; + const result = { ...overlay, strokeColor: strokeColor && processColor(strokeColor), fillColor: fillColor && processColor(fillColor), diff --git a/Libraries/Components/Picker/PickerAndroid.android.js b/Libraries/Components/Picker/PickerAndroid.android.js index 2021434c8..2cc1b4e9a 100644 --- a/Libraries/Components/Picker/PickerAndroid.android.js +++ b/Libraries/Components/Picker/PickerAndroid.android.js @@ -79,11 +79,11 @@ class PickerAndroid extends React.Component { // Translate prop and children into stuff that the native picker understands. _stateFromProps = (props) => { var selectedIndex = 0; - let items = ReactChildren.map(props.children, (child, index) => { + const items = ReactChildren.map(props.children, (child, index) => { if (child.props.value === props.selectedValue) { selectedIndex = index; } - let childProps = { + const childProps = { value: child.props.value, label: child.props.label, }; diff --git a/Libraries/Components/ScrollResponder.js b/Libraries/Components/ScrollResponder.js index f95b2b579..8b3a84ce8 100644 --- a/Libraries/Components/ScrollResponder.js +++ b/Libraries/Components/ScrollResponder.js @@ -104,11 +104,11 @@ var invariant = require('fbjs/lib/invariant'); var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16; type State = { - isTouching: boolean; - lastMomentumScrollBeginTime: number; - lastMomentumScrollEndTime: number; - observedScrollSinceBecomingResponder: boolean; - becameResponderWhileAnimating: boolean; + isTouching: boolean, + lastMomentumScrollBeginTime: number, + lastMomentumScrollEndTime: number, + observedScrollSinceBecomingResponder: boolean, + becameResponderWhileAnimating: boolean, }; type Event = Object; @@ -366,7 +366,7 @@ var ScrollResponderMixin = { * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. */ scrollResponderScrollTo: function( - x?: number | { x?: number; y?: number; animated?: boolean }, + x?: number | { x?: number, y?: number, animated?: boolean }, y?: number, animated?: boolean ) { @@ -397,7 +397,7 @@ var ScrollResponderMixin = { * @platform ios */ scrollResponderZoomTo: function( - rect: { x: number; y: number; width: number; height: number; animated?: boolean }, + rect: { x: number, y: number, width: number, height: number, animated?: boolean }, animated?: boolean // deprecated, put this inside the rect argument instead ) { if (Platform.OS === 'android') { diff --git a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js index 2a4302815..df269b926 100644 --- a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +++ b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js @@ -20,8 +20,8 @@ var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); type DefaultProps = { - values: Array; - enabled: boolean; + values: Array, + enabled: boolean, }; var SEGMENTED_CONTROL_REFERENCE = 'segmentedcontrol'; diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index d4de6ab51..032d374ba 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -140,7 +140,7 @@ var Slider = React.createClass({ }, render: function() { - let {style, onValueChange, onSlidingComplete, ...props} = this.props; + const {style, onValueChange, onSlidingComplete, ...props} = this.props; props.style = [styles.slider, style]; props.onValueChange = onValueChange && ((event: Event) => { diff --git a/Libraries/Components/SliderIOS/SliderIOS.ios.js b/Libraries/Components/SliderIOS/SliderIOS.ios.js index 3515c5d23..8ef48c641 100644 --- a/Libraries/Components/SliderIOS/SliderIOS.ios.js +++ b/Libraries/Components/SliderIOS/SliderIOS.ios.js @@ -131,7 +131,7 @@ var SliderIOS = React.createClass({ 'future versions of React Native. Use the cross-platform Slider ' + 'as a drop-in replacement.'); - let {style, onValueChange, onSlidingComplete, ...props} = this.props; + const {style, onValueChange, onSlidingComplete, ...props} = this.props; props.style = [styles.slider, style]; props.onValueChange = onValueChange && ((event: Event) => { diff --git a/Libraries/Components/StatusBar/StatusBar.js b/Libraries/Components/StatusBar/StatusBar.js index 323018aab..6df5d4ca2 100644 --- a/Libraries/Components/StatusBar/StatusBar.js +++ b/Libraries/Components/StatusBar/StatusBar.js @@ -52,7 +52,7 @@ export type StatusBarAnimation = $Enum<{ }>; type DefaultProps = { - animated: boolean; + animated: boolean, }; /** @@ -60,7 +60,7 @@ type DefaultProps = { */ function mergePropsStack(propsStack: Array, defaultValues: Object): Object { return propsStack.reduce((prev, cur) => { - for (let prop in cur) { + for (const prop in cur) { if (cur[prop] != null) { prev[prop] = cur[prop]; } diff --git a/Libraries/Components/Switch/Switch.js b/Libraries/Components/Switch/Switch.js index c8a24b008..83d0b1312 100644 --- a/Libraries/Components/Switch/Switch.js +++ b/Libraries/Components/Switch/Switch.js @@ -21,8 +21,8 @@ var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); type DefaultProps = { - value: boolean; - disabled: boolean; + value: boolean, + disabled: boolean, }; /** diff --git a/Libraries/Components/SwitchIOS/SwitchIOS.ios.js b/Libraries/Components/SwitchIOS/SwitchIOS.ios.js index 0e45c22a3..761a91961 100644 --- a/Libraries/Components/SwitchIOS/SwitchIOS.ios.js +++ b/Libraries/Components/SwitchIOS/SwitchIOS.ios.js @@ -25,8 +25,8 @@ var requireNativeComponent = require('requireNativeComponent'); var SWITCH = 'switch'; type DefaultProps = { - value: boolean; - disabled: boolean; + value: boolean, + disabled: boolean, }; type Event = Object; diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index 8d82fd5b9..b7ab733e7 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -20,8 +20,8 @@ var Touchable = require('Touchable'); type Event = Object; type State = { - animationID: ?number; - scale: Animated.Value; + animationID: ?number, + scale: Animated.Value, }; var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; diff --git a/Libraries/Components/ViewPager/ViewPagerAndroid.android.js b/Libraries/Components/ViewPager/ViewPagerAndroid.android.js index d23e9d569..2a430d463 100644 --- a/Libraries/Components/ViewPager/ViewPagerAndroid.android.js +++ b/Libraries/Components/ViewPager/ViewPagerAndroid.android.js @@ -26,9 +26,9 @@ var VIEWPAGER_REF = 'viewPager'; type Event = Object; export type ViewPagerScrollState = $Enum<{ - idle: string; - dragging: string; - settling: string; + idle: string, + dragging: string, + settling: string, }>; /** diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index 52e7557fd..8c3920771 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -52,9 +52,9 @@ const NavigationType = keyMirror({ const JSNavigationScheme = 'react-js-navigation'; type ErrorEvent = { - domain: any; - code: any; - description: any; + domain: any, + code: any, + description: any, } type Event = Object; diff --git a/Libraries/CustomComponents/ListView/ListViewDataSource.js b/Libraries/CustomComponents/ListView/ListViewDataSource.js index fdc135b87..007735ff1 100644 --- a/Libraries/CustomComponents/ListView/ListViewDataSource.js +++ b/Libraries/CustomComponents/ListView/ListViewDataSource.js @@ -50,10 +50,10 @@ function defaultGetSectionHeaderData( type differType = (data1: any, data2: any) => bool; type ParamType = { - rowHasChanged: differType; - getRowData?: ?typeof defaultGetRowData; - sectionHeaderHasChanged?: ?differType; - getSectionHeaderData?: ?typeof defaultGetSectionHeaderData; + rowHasChanged: differType, + getRowData?: ?typeof defaultGetRowData, + sectionHeaderHasChanged?: ?differType, + getSectionHeaderData?: ?typeof defaultGetSectionHeaderData, } /** diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js b/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js index fd79a450c..388ddc3ea 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderTitle.js @@ -43,10 +43,10 @@ const { } = ReactNative; type Props = { - children?: ReactElement; - style?: any; - textStyle?: any; - viewProps?: any; + children?: ReactElement, + style?: any, + textStyle?: any, + viewProps?: any, } const NavigationHeaderTitle = ({ children, style, textStyle, viewProps }: Props) => ( diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index 3c4f9db34..d2a6eb080 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -1258,7 +1258,7 @@ var Navigator = React.createClass({ }, _renderNavigationBar: function() { - let { navigationBar } = this.props; + const { navigationBar } = this.props; if (!navigationBar) { return null; } diff --git a/Libraries/EventEmitter/RCTDeviceEventEmitter.js b/Libraries/EventEmitter/RCTDeviceEventEmitter.js index ba5b5f16a..05507bd8b 100644 --- a/Libraries/EventEmitter/RCTDeviceEventEmitter.js +++ b/Libraries/EventEmitter/RCTDeviceEventEmitter.js @@ -30,7 +30,7 @@ class RCTDeviceEventEmitter extends EventEmitter { super(sharedSubscriber); this.sharedSubscriber = sharedSubscriber; } - + _nativeEventModule(eventType: ?string) { if (eventType) { if (eventType.lastIndexOf('statusBar', 0) === 0) { diff --git a/Libraries/Experimental/Incremental.js b/Libraries/Experimental/Incremental.js index db7a2899f..5cee3993c 100644 --- a/Libraries/Experimental/Incremental.js +++ b/Libraries/Experimental/Incremental.js @@ -84,12 +84,12 @@ export type Props = { * Called when all the decendents have finished rendering and mounting * recursively. */ - onDone?: () => void; + onDone?: () => void, /** * Tags instances and associated tasks for easier debugging. */ - name: string; - children?: any; + name: string, + children?: any, }; type DefaultProps = { name: string, @@ -176,11 +176,11 @@ class Incremental extends React.Component { } export type Context = { - incrementalGroupEnabled: boolean; + incrementalGroupEnabled: boolean, incrementalGroup: ?{ - groupId: string; - incrementalCount: number; - }; + groupId: string, + incrementalCount: number, + }, }; module.exports = Incremental; diff --git a/Libraries/Experimental/IncrementalPresenter.js b/Libraries/Experimental/IncrementalPresenter.js index d9ff0ef52..50d4d56b0 100644 --- a/Libraries/Experimental/IncrementalPresenter.js +++ b/Libraries/Experimental/IncrementalPresenter.js @@ -30,12 +30,12 @@ import type {Context} from 'Incremental'; * See Incremental.js for more info. */ type Props = { - name: string; - disabled?: boolean; - onDone?: () => void; - onLayout?: (event: Object) => void; - style?: mixed; - children?: any; + name: string, + disabled?: boolean, + onDone?: () => void, + onLayout?: (event: Object) => void, + style?: mixed, + children?: any, } class IncrementalPresenter extends React.Component { props: Props; diff --git a/Libraries/Experimental/WindowedListView.js b/Libraries/Experimental/WindowedListView.js index 2cef3471c..f685b177e 100644 --- a/Libraries/Experimental/WindowedListView.js +++ b/Libraries/Experimental/WindowedListView.js @@ -84,86 +84,86 @@ type Props = { * A simple array of data blobs that are passed to the renderRow function in * order. Note there is no dataSource like in the standard `ListView`. */ - data: Array<{rowKey: string, rowData: any}>; + data: Array<{rowKey: string, rowData: any}>, /** * Takes a data blob from the `data` array prop plus some meta info and should * return a row. */ renderRow: ( rowData: any, sectionIdx: number, rowIdx: number, rowKey: string - ) => ?ReactElement; + ) => ?ReactElement, /** * Rendered when the list is scrolled faster than rows can be rendered. */ - renderWindowBoundaryIndicator?: () => ?ReactElement; + renderWindowBoundaryIndicator?: () => ?ReactElement, /** * Always rendered at the bottom of all the rows. */ - renderFooter?: () => ?ReactElement; + renderFooter?: () => ?ReactElement, /** * Pipes through normal onScroll events from the underlying `ScrollView`. */ - onScroll?: (event: Object) => void; + onScroll?: (event: Object) => void, /** * Called when the rows that are visible in the viewport change. */ - onVisibleRowsChanged?: (firstIdx: number, count: number) => void; + onVisibleRowsChanged?: (firstIdx: number, count: number) => void, /** * Called when the viewability of rows changes, as defined by the * `viewablePercentThreshold` prop. */ - onViewableRowsChanged?: (viewableRows: Array) => void; + onViewableRowsChanged?: (viewableRows: Array) => void, /** * The percent of a row that must be visible to consider it "viewable". */ - viewablePercentThreshold: number; + viewablePercentThreshold: number, /** * Number of rows to render on first mount. */ - initialNumToRender: number; + initialNumToRender: number, /** * Maximum number of rows to render while scrolling, i.e. the window size. */ - maxNumToRender: number; + maxNumToRender: number, /** * Number of rows to render beyond the viewport. Note that this combined with * `maxNumToRender` and the number of rows that can fit in one screen will * determine how many rows to render above the viewport. */ - numToRenderAhead: number; + numToRenderAhead: number, /** * Used to log perf events for async row rendering. */ - asyncRowPerfEventName?: string; + asyncRowPerfEventName?: string, /** * A function that returns the scrollable component in which the list rows * are rendered. Defaults to returning a ScrollView with the given props. */ - renderScrollComponent: (props: ?Object) => ReactElement; + renderScrollComponent: (props: ?Object) => ReactElement, /** * Use to disable incremental rendering when not wanted, e.g. to speed up initial render. */ - disableIncrementalRendering: boolean; + disableIncrementalRendering: boolean, /** * This determines how frequently events such as scroll and layout can trigger a re-render. */ - recomputeRowsBatchingPeriod: number; + recomputeRowsBatchingPeriod: number, /** * Called when rows will be mounted/unmounted. Mounted rows always form a contiguous block so it is expressed as a * range of start plus count. */ - onMountedRowsWillChange?: (firstIdx: number, count: number) => void; + onMountedRowsWillChange?: (firstIdx: number, count: number) => void, /** * Change this when you want to make sure the WindowedListView will re-render, for example when the result of * `renderScrollComponent` might change. It will be compared in `shouldComponentUpdate`. */ - shouldUpdateToken?: string; + shouldUpdateToken?: string, }; type State = { - boundaryIndicatorHeight?: number; - firstRow: number; - lastRow: number; + boundaryIndicatorHeight?: number, + firstRow: number, + lastRow: number, }; class WindowedListView extends React.Component { props: Props; @@ -573,22 +573,22 @@ type CellProps = { /** * Row-specific data passed to renderRow and used in shouldComponentUpdate with === */ - rowData: mixed; - rowKey: string; + rowData: mixed, + rowKey: string, /** * Renders the actual row contents. */ renderRow: ( rowData: mixed, sectionIdx: number, rowIdx: number, rowKey: string - ) => ?ReactElement; + ) => ?ReactElement, /** * Index of the row, passed through to other callbacks. */ - rowIndex: number; + rowIndex: number, /** * Used for marking async begin/end events for row rendering. */ - asyncRowPerfEventName: ?string; + asyncRowPerfEventName: ?string, /** * Initially false to indicate the cell should be rendered "offscreen" with position: absolute so that incremental * rendering doesn't cause things to jump around. Once onNewLayout is called after offscreen rendering has completed, @@ -597,21 +597,21 @@ type CellProps = { * This is coordinated outside this component so the parent can syncronize this re-render with managing the * placeholder sizing. */ - includeInLayout: boolean; + includeInLayout: boolean, /** * Updates the parent with the latest layout. Only called when incremental rendering is done and triggers the parent * to re-render this row with includeInLayout true. */ - onNewLayout: (params: {rowKey: string, layout: Object}) => void; + onNewLayout: (params: {rowKey: string, layout: Object}) => void, /** * Used to track when rendering is in progress so the parent can avoid wastedful re-renders that are just going to be * invalidated once the cell finishes. */ - onProgressChange: (progress: {rowKey: string; inProgress: boolean}) => void; + onProgressChange: (progress: {rowKey: string, inProgress: boolean}) => void, /** * Used to invalidate the layout so the parent knows it needs to compensate for the height in the placeholder size. */ - onWillUnmount: (rowKey: string) => void; + onWillUnmount: (rowKey: string) => void, }; class CellRenderer extends React.Component { props: CellProps; diff --git a/Libraries/Geolocation/Geolocation.js b/Libraries/Geolocation/Geolocation.js index f2eed384b..d946a9bcd 100644 --- a/Libraries/Geolocation/Geolocation.js +++ b/Libraries/Geolocation/Geolocation.js @@ -24,10 +24,10 @@ var subscriptions = []; var updatesEnabled = false; type GeoOptions = { - timeout: number; - maximumAge: number; - enableHighAccuracy: bool; - distanceFilter: number; + timeout: number, + maximumAge: number, + enableHighAccuracy: bool, + distanceFilter: number, } /** diff --git a/Libraries/Image/ImageEditor.js b/Libraries/Image/ImageEditor.js index 55746e415..3e0a4d3d2 100644 --- a/Libraries/Image/ImageEditor.js +++ b/Libraries/Image/ImageEditor.js @@ -19,33 +19,33 @@ type ImageCropData = { * image's coordinate space. */ offset: { - x: number; - y: number; - }; + x: number, + y: number, + }, /** * The size (dimensions) of the cropped image, specified in the original * image's coordinate space. */ size: { - width: number; - height: number; - }; + width: number, + height: number, + }, /** * (Optional) size to scale the cropped image to. */ displaySize?: ?{ - width: number; - height: number; - }; + width: number, + height: number, + }, /** * (Optional) the resizing mode to use when scaling the image. If the * `displaySize` param is not specified, this has no effect. */ resizeMode?: ?$Enum<{ - contain: string; - cover: string; - stretch: string; - }>; + contain: string, + cover: string, + stretch: string, + }>, }; class ImageEditor { diff --git a/Libraries/Image/ImageSource.js b/Libraries/Image/ImageSource.js index 963192ea2..07e044554 100644 --- a/Libraries/Image/ImageSource.js +++ b/Libraries/Image/ImageSource.js @@ -12,5 +12,5 @@ 'use strict'; export type ImageSource = { - uri: string; + uri: string, }; diff --git a/Libraries/Inspector/InspectorOverlay.js b/Libraries/Inspector/InspectorOverlay.js index ec39ee2df..27589eb91 100644 --- a/Libraries/Inspector/InspectorOverlay.js +++ b/Libraries/Inspector/InspectorOverlay.js @@ -22,7 +22,7 @@ var ElementBox = require('ElementBox'); var PropTypes = React.PropTypes; type EventLike = { - nativeEvent: Object; + nativeEvent: Object, }; class InspectorOverlay extends React.Component { diff --git a/Libraries/Interaction/JSEventLoopWatchdog.js b/Libraries/Interaction/JSEventLoopWatchdog.js index 88c48353c..16848be5a 100644 --- a/Libraries/Interaction/JSEventLoopWatchdog.js +++ b/Libraries/Interaction/JSEventLoopWatchdog.js @@ -14,8 +14,8 @@ const performanceNow = require('performanceNow'); type Handler = { - onIterate?: () => void; - onStall: (params: {lastInterval: number}) => string; + onIterate?: () => void, + onStall: (params: {lastInterval: number}) => string, }; /** diff --git a/Libraries/JavaScriptAppEngine/Initialization/getDevServer.js b/Libraries/JavaScriptAppEngine/Initialization/getDevServer.js index b733c2f5c..ff34314ca 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/getDevServer.js +++ b/Libraries/JavaScriptAppEngine/Initialization/getDevServer.js @@ -17,8 +17,8 @@ let _cachedDevServerURL: ?string; const FALLBACK = 'http://localhost:8081/'; type DevServerInfo = { - url: string; - bundleLoadedFromServer: boolean; + url: string, + bundleLoadedFromServer: boolean, }; /** diff --git a/Libraries/JavaScriptAppEngine/Initialization/parseErrorStack.js b/Libraries/JavaScriptAppEngine/Initialization/parseErrorStack.js index 1b0d66331..8e4f47e80 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/parseErrorStack.js +++ b/Libraries/JavaScriptAppEngine/Initialization/parseErrorStack.js @@ -12,9 +12,9 @@ 'use strict'; export type StackFrame = { - file: string; - lineNumber: number; - column: number; + file: string, + lineNumber: number, + column: number, }; var stacktraceParser = require('stacktrace-parser'); diff --git a/Libraries/LayoutAnimation/LayoutAnimation.js b/Libraries/LayoutAnimation/LayoutAnimation.js index 365c4ea78..cec1ba8fe 100644 --- a/Libraries/LayoutAnimation/LayoutAnimation.js +++ b/Libraries/LayoutAnimation/LayoutAnimation.js @@ -47,12 +47,12 @@ var animChecker = createStrictShapeTypeChecker({ }); type Anim = { - duration?: number; - delay?: number; - springDamping?: number; - initialVelocity?: number; - type?: $Enum; - property?: $Enum; + duration?: number, + delay?: number, + springDamping?: number, + initialVelocity?: number, + type?: $Enum, + property?: $Enum, } var configChecker = createStrictShapeTypeChecker({ @@ -63,10 +63,10 @@ var configChecker = createStrictShapeTypeChecker({ }); type Config = { - duration: number; - create?: Anim; - update?: Anim; - delete?: Anim; + duration: number, + create?: Anim, + update?: Anim, + delete?: Anim, } function configureNext(config: Config, onAnimationDidEnd?: Function) { diff --git a/Libraries/Linking/Linking.js b/Libraries/Linking/Linking.js index 0060e3ce2..8fe85bfd0 100644 --- a/Libraries/Linking/Linking.js +++ b/Libraries/Linking/Linking.js @@ -48,13 +48,13 @@ const LinkingManager = Platform.OS === 'android' ? * you may set the `launchMode` of MainActivity to `singleTask` in * `AndroidManifest.xml`. See [``](http://developer.android.com/guide/topics/manifest/activity-element.html) * documentation for more information. - * + * * ``` * * ``` - * + * * NOTE: On iOS you'll need to link `RCTLinking` to your project by following * the steps described [here](docs/linking-libraries-ios.html#manual-linking). * In case you also want to listen to incoming app links during your app's @@ -115,11 +115,11 @@ const LinkingManager = Platform.OS === 'android' ? * ``` */ class Linking extends NativeEventEmitter { - + constructor() { - super(LinkingManager); + super(LinkingManager); } - + /** * Add a handler to Linking changes by listening to the `url` event type * and providing the handler diff --git a/Libraries/NavigationExperimental/__mocks__/NavigationRootContainer.js b/Libraries/NavigationExperimental/__mocks__/NavigationRootContainer.js index 87b23c71b..6fbc8806f 100644 --- a/Libraries/NavigationExperimental/__mocks__/NavigationRootContainer.js +++ b/Libraries/NavigationExperimental/__mocks__/NavigationRootContainer.js @@ -13,4 +13,4 @@ const NavigationRootContainer = { } }; -module.exports = NavigationRootContainer; \ No newline at end of file +module.exports = NavigationRootContainer; diff --git a/Libraries/Network/FormData.js b/Libraries/Network/FormData.js index 1ca164271..8a00c96fa 100644 --- a/Libraries/Network/FormData.js +++ b/Libraries/Network/FormData.js @@ -16,13 +16,13 @@ type FormDataNameValuePair = [string, FormDataValue]; type Headers = {[name: string]: string}; type FormDataPart = { - string: string; - headers: Headers; + string: string, + headers: Headers, } | { - uri: string; - headers: Headers; - name?: string; - type?: string; + uri: string, + headers: Headers, + name?: string, + type?: string, }; /** diff --git a/Libraries/Network/NetInfo.js b/Libraries/Network/NetInfo.js index 0cbb88f48..02b500414 100644 --- a/Libraries/Network/NetInfo.js +++ b/Libraries/Network/NetInfo.js @@ -23,37 +23,37 @@ const NetInfoEventEmitter = new NativeEventEmitter(RCTNetInfo); const DEVICE_CONNECTIVITY_EVENT = 'networkStatusDidChange'; type ChangeEventName = $Enum<{ - change: string; + change: string, }>; type ReachabilityStateIOS = $Enum<{ - cell: string; - none: string; - unknown: string; - wifi: string; + cell: string, + none: string, + unknown: string, + wifi: string, }>; type ConnectivityStateAndroid = $Enum<{ - NONE: string; - MOBILE: string; - WIFI: string; - MOBILE_MMS: string; - MOBILE_SUPL: string; - MOBILE_DUN: string; - MOBILE_HIPRI: string; - WIMAX: string; - BLUETOOTH: string; - DUMMY: string; - ETHERNET: string; - MOBILE_FOTA: string; - MOBILE_IMS: string; - MOBILE_CBS: string; - WIFI_P2P: string; - MOBILE_IA: string; - MOBILE_EMERGENCY: string; - PROXY: string; - VPN: string; - UNKNOWN: string; + NONE: string, + MOBILE: string, + WIFI: string, + MOBILE_MMS: string, + MOBILE_SUPL: string, + MOBILE_DUN: string, + MOBILE_HIPRI: string, + WIMAX: string, + BLUETOOTH: string, + DUMMY: string, + ETHERNET: string, + MOBILE_FOTA: string, + MOBILE_IMS: string, + MOBILE_CBS: string, + WIFI_P2P: string, + MOBILE_IA: string, + MOBILE_EMERGENCY: string, + PROXY: string, + VPN: string, + UNKNOWN: string, }>; diff --git a/Libraries/ReactIOS/verifyPropTypes.js b/Libraries/ReactIOS/verifyPropTypes.js index 4e3d30db6..03ec3792a 100644 --- a/Libraries/ReactIOS/verifyPropTypes.js +++ b/Libraries/ReactIOS/verifyPropTypes.js @@ -14,9 +14,9 @@ var ReactNativeStyleAttributes = require('ReactNativeStyleAttributes'); export type ComponentInterface = ReactClass | { - name?: string; - displayName?: string; - propTypes: Object; + name?: string, + displayName?: string, + propTypes: Object, }; function verifyPropTypes( diff --git a/Libraries/Settings/Settings.ios.js b/Libraries/Settings/Settings.ios.js index 3d1036fed..beda544b4 100644 --- a/Libraries/Settings/Settings.ios.js +++ b/Libraries/Settings/Settings.ios.js @@ -16,7 +16,7 @@ var RCTSettingsManager = require('NativeModules').SettingsManager; var invariant = require('fbjs/lib/invariant'); -var subscriptions: Array<{keys: Array; callback: ?Function}> = []; +var subscriptions: Array<{keys: Array, callback: ?Function}> = []; var Settings = { _settings: RCTSettingsManager && RCTSettingsManager.settings, diff --git a/Libraries/Storage/AsyncStorage.js b/Libraries/Storage/AsyncStorage.js index 9006476d8..a0666c06c 100644 --- a/Libraries/Storage/AsyncStorage.js +++ b/Libraries/Storage/AsyncStorage.js @@ -263,13 +263,13 @@ var AsyncStorage = { // // Is there a way to avoid using the map but fix the bug in this breaking test? // https://github.com/facebook/react-native/commit/8dd8ad76579d7feef34c014d387bf02065692264 - let map = {}; + const map = {}; result.forEach(([key, value]) => map[key] = value); const reqLength = getRequests.length; for (let i = 0; i < reqLength; i++) { const request = getRequests[i]; const requestKeys = request.keys; - let requestResult = requestKeys.map(key => [key, map[key]]); + const requestResult = requestKeys.map(key => [key, map[key]]); request.callback && request.callback(null, requestResult); request.resolve && request.resolve(requestResult); } diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 762132984..d90d75301 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -308,10 +308,10 @@ const Text = React.createClass({ }); type RectOffset = { - top: number; - left: number; - right: number; - bottom: number; + top: number, + left: number, + right: number, + bottom: number, } var PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; diff --git a/Libraries/Utilities/Alert.js b/Libraries/Utilities/Alert.js index 9a38096ad..070c91b0d 100644 --- a/Libraries/Utilities/Alert.js +++ b/Libraries/Utilities/Alert.js @@ -18,9 +18,9 @@ var DialogModuleAndroid = require('NativeModules').DialogManagerAndroid; import type { AlertType, AlertButtonStyle } from 'AlertIOS'; type Buttons = Array<{ - text?: string; - onPress?: ?Function; - style?: AlertButtonStyle; + text?: string, + onPress?: ?Function, + style?: AlertButtonStyle, }>; type Options = { @@ -113,13 +113,13 @@ class AlertAndroid { var buttonNegative = validButtons.pop(); var buttonNeutral = validButtons.pop(); if (buttonNeutral) { - config = {...config, buttonNeutral: buttonNeutral.text || '' } + config = {...config, buttonNeutral: buttonNeutral.text || '' }; } if (buttonNegative) { - config = {...config, buttonNegative: buttonNegative.text || '' } + config = {...config, buttonNegative: buttonNegative.text || '' }; } if (buttonPositive) { - config = {...config, buttonPositive: buttonPositive.text || '' } + config = {...config, buttonPositive: buttonPositive.text || '' }; } DialogModuleAndroid.showAlert( config, diff --git a/Libraries/Utilities/AlertIOS.js b/Libraries/Utilities/AlertIOS.js index 19df75f3c..c889c15d3 100644 --- a/Libraries/Utilities/AlertIOS.js +++ b/Libraries/Utilities/AlertIOS.js @@ -21,19 +21,19 @@ export type AlertType = $Enum<{ /** * Default alert with no inputs */ - 'default': string; + 'default': string, /** * Plain text input alert */ - 'plain-text': string; + 'plain-text': string, /** * Secure text input alert */ - 'secure-text': string; + 'secure-text': string, /** * Login and password alert */ - 'login-password': string; + 'login-password': string, }>; /** @@ -43,15 +43,15 @@ export type AlertButtonStyle = $Enum<{ /** * Default button style */ - 'default': string; + 'default': string, /** * Cancel button style */ - 'cancel': string; + 'cancel': string, /** * Destructive button style */ - 'destructive': string; + 'destructive': string, }>; /** @@ -65,15 +65,15 @@ type ButtonsArray = Array<{ /** * Button label */ - text?: string; + text?: string, /** * Callback function when button pressed */ - onPress?: ?Function; + onPress?: ?Function, /** * Button style */ - style?: AlertButtonStyle; + style?: AlertButtonStyle, }>; /** diff --git a/Libraries/Utilities/BackAndroid.android.js b/Libraries/Utilities/BackAndroid.android.js index 04adcde25..e39358452 100644 --- a/Libraries/Utilities/BackAndroid.android.js +++ b/Libraries/Utilities/BackAndroid.android.js @@ -17,7 +17,7 @@ var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var DEVICE_BACK_EVENT = 'hardwareBackPress'; type BackPressEventName = $Enum<{ - backPress: string; + backPress: string, }>; var _backPressSubscriptions = new Set(); @@ -30,7 +30,7 @@ RCTDeviceEventEmitter.addListener(DEVICE_BACK_EVENT, function() { if (subscriptions[i]()) { invokeDefault = false; break; - }; + } } if (invokeDefault) { diff --git a/Libraries/Utilities/HMRClient.js b/Libraries/Utilities/HMRClient.js index a7987f22e..c0443b069 100644 --- a/Libraries/Utilities/HMRClient.js +++ b/Libraries/Utilities/HMRClient.js @@ -109,13 +109,13 @@ Error: ${e.message}` : eval; code = [ - `__accept(`, + '__accept(', `${id},`, - `function(global,require,module,exports){`, + 'function(global,require,module,exports){', `${code}`, '\n},', `${JSON.stringify(inverseDependencies)}`, - `);`, + ');', ].join(''); injectFunction(code, sourceURLs[i]); diff --git a/Libraries/Utilities/MessageQueue.js b/Libraries/Utilities/MessageQueue.js index 58ac174b9..4f00753aa 100644 --- a/Libraries/Utilities/MessageQueue.js +++ b/Libraries/Utilities/MessageQueue.js @@ -96,9 +96,9 @@ class MessageQueue { if (spyOrToggle === true){ MessageQueue.prototype.__spy = (info)=>{ console.log(`${info.type == TO_JS ? 'N->JS' : 'JS->N'} : ` + - `${info.module ? (info.module+'.') : ''}${info.method}` + + `${info.module ? (info.module + '.') : ''}${info.method}` + `(${JSON.stringify(info.args)})`); - } + }; } else if (spyOrToggle === false) { MessageQueue.prototype.__spy = null; } else { diff --git a/Libraries/Utilities/RCTRenderingPerf.js b/Libraries/Utilities/RCTRenderingPerf.js index f9016624f..bd2154458 100644 --- a/Libraries/Utilities/RCTRenderingPerf.js +++ b/Libraries/Utilities/RCTRenderingPerf.js @@ -18,8 +18,8 @@ var invariant = require('fbjs/lib/invariant'); var performanceNow = require('fbjs/lib/performanceNow'); type perfModule = { - start: () => void; - stop: () => void; + start: () => void, + stop: () => void, } var perfModules = []; diff --git a/Libraries/Utilities/__mocks__/MessageQueueTestConfig.js b/Libraries/Utilities/__mocks__/MessageQueueTestConfig.js index 262f9565d..9f549f27a 100644 --- a/Libraries/Utilities/__mocks__/MessageQueueTestConfig.js +++ b/Libraries/Utilities/__mocks__/MessageQueueTestConfig.js @@ -10,29 +10,29 @@ */ 'use strict'; var remoteModulesConfig = { - "RemoteModule1": { - "moduleID":0, - "methods":{ - "remoteMethod1":{ - "type":"remote", - "methodID":0 + 'RemoteModule1': { + 'moduleID':0, + 'methods':{ + 'remoteMethod1':{ + 'type':'remote', + 'methodID':0 }, - "remoteMethod2":{ - "type":"remote", - "methodID":1 + 'remoteMethod2':{ + 'type':'remote', + 'methodID':1 } } }, - "RemoteModule2":{ - "moduleID":1, - "methods":{ - "remoteMethod1":{ - "type":"remote", - "methodID":0 + 'RemoteModule2':{ + 'moduleID':1, + 'methods':{ + 'remoteMethod1':{ + 'type':'remote', + 'methodID':0 }, - "remoteMethod2":{ - "type":"remote", - "methodID":1 + 'remoteMethod2':{ + 'type':'remote', + 'methodID':1 } } } @@ -42,29 +42,29 @@ var remoteModulesConfig = { * These actually exist in the __tests__ folder. */ var localModulesConfig = { - "MessageQueueTestModule1": { - "moduleID":"MessageQueueTestModule1", - "methods":{ - "testHook1":{ - "type":"local", - "methodID":"testHook1" + 'MessageQueueTestModule1': { + 'moduleID':'MessageQueueTestModule1', + 'methods':{ + 'testHook1':{ + 'type':'local', + 'methodID':'testHook1' }, - "testHook2":{ - "type":"local", - "methodID":"testHook2" + 'testHook2':{ + 'type':'local', + 'methodID':'testHook2' } } }, - "MessageQueueTestModule2": { - "moduleID":"MessageQueueTestModule2", - "methods": { - "runLocalCode":{ - "type":"local", - "methodID":"runLocalCode" + 'MessageQueueTestModule2': { + 'moduleID':'MessageQueueTestModule2', + 'methods': { + 'runLocalCode':{ + 'type':'local', + 'methodID':'runLocalCode' }, - "runLocalCode2":{ - "type":"local", - "methodID":"runLocalCode2" + 'runLocalCode2':{ + 'type':'local', + 'methodID':'runLocalCode2' } } } diff --git a/Libraries/Utilities/__tests__/MessageQueue-test.js b/Libraries/Utilities/__tests__/MessageQueue-test.js index 7a69e8d7e..a8b309a52 100644 --- a/Libraries/Utilities/__tests__/MessageQueue-test.js +++ b/Libraries/Utilities/__tests__/MessageQueue-test.js @@ -64,7 +64,7 @@ describe('MessageQueue', function() { it('should enqueue native calls', () => { queue.__nativeCall(0, 1, [2]); - let flushedQueue = queue.flushedQueue(); + const flushedQueue = queue.flushedQueue(); assertQueue(flushedQueue, 0, 0, 1, [2]); }); @@ -77,13 +77,13 @@ describe('MessageQueue', function() { it('should generate native modules', () => { queue.RemoteModules.RemoteModule1.remoteMethod1('foo'); - let flushedQueue = queue.flushedQueue(); + const flushedQueue = queue.flushedQueue(); assertQueue(flushedQueue, 0, 0, 0, ['foo']); }); it('should store callbacks', () => { queue.RemoteModules.RemoteModule1.remoteMethod2('foo', () => {}, () => {}); - let flushedQueue = queue.flushedQueue(); + const flushedQueue = queue.flushedQueue(); assertQueue(flushedQueue, 0, 0, 1, ['foo', 0, 1]); }); @@ -111,8 +111,8 @@ describe('MessageQueue', function() { // First we're going to call into this (overriden) test hook pretending to // be a remote module making a "local" invocation into JS. - let onFail = jasmine.createSpy(); - let onSucc = jasmine.createSpy(); + const onFail = jasmine.createSpy(); + const onSucc = jasmine.createSpy(); MessageQueueTestModule1.testHook1 = function() { // Then inside of this local module, we're going to fire off a remote // request. @@ -173,7 +173,7 @@ describe('MessageQueue', function() { var secondSuccCBID = resultingRemoteInvocations[2][1][3]; // Trigger init - queue.RemoteModules + queue.RemoteModules; // Handle the first remote invocation by signaling failure. // ------------------------------------------------------- queue.__invokeCallback(firstFailCBID, ['firstFailure']); diff --git a/Libraries/Utilities/__tests__/groupByEveryN-test.js b/Libraries/Utilities/__tests__/groupByEveryN-test.js index 09fb5a11f..0777716c4 100644 --- a/Libraries/Utilities/__tests__/groupByEveryN-test.js +++ b/Libraries/Utilities/__tests__/groupByEveryN-test.js @@ -14,7 +14,7 @@ jest.unmock('groupByEveryN'); describe('groupByEveryN', () => { var groupByEveryN = require('groupByEveryN'); - it ('should group by with different n', () => { + it('should group by with different n', () => { expect(groupByEveryN([1, 2, 3, 4, 5, 6, 7, 8, 9], 1)) .toEqual([[1], [2], [3], [4], [5], [6], [7], [8], [9]]); expect(groupByEveryN([1, 2, 3, 4, 5, 6, 7, 8, 9], 2)) @@ -25,7 +25,7 @@ describe('groupByEveryN', () => { .toEqual([[1, 2, 3, 4], [5, 6, 7, 8], [9, null, null, null]]); }); - it ('should fill with null', () => { + it('should fill with null', () => { expect(groupByEveryN([], 4)) .toEqual([]); expect(groupByEveryN([1], 4)) diff --git a/Libraries/Utilities/__tests__/truncate-test.js b/Libraries/Utilities/__tests__/truncate-test.js index 109cb6ba0..3404688c8 100644 --- a/Libraries/Utilities/__tests__/truncate-test.js +++ b/Libraries/Utilities/__tests__/truncate-test.js @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. * */ -"use strict"; +'use strict'; jest.unmock('truncate'); @@ -15,37 +15,37 @@ describe('truncate', () => { var truncate = require('truncate'); - it ('should truncate', () => { + it('should truncate', () => { expect(truncate('Hello, world.', 5)) .toBe('He...'); }); - it ('should not truncate', () => { + it('should not truncate', () => { expect(truncate('Hello, world.', 50)) .toBe('Hello, world.'); }); - it ('should not truncate more than minDelta chars.', () => { + it('should not truncate more than minDelta chars.', () => { expect(truncate('Hello, world.', 7, {minDelta: 10})) .toBe('Hello, world.'); expect(truncate('Hello, world.', 7, {minDelta: 9})) .toBe('Hell...'); }); - it ('should break in the middle of words', () => { + it('should break in the middle of words', () => { expect(truncate('Hello, world. How are you?', 18, {breakOnWords: false})) .toBe('Hello, world. H...'); expect(truncate('Hello, world.\nHow are you?', 18, {breakOnWords: false})) .toBe('Hello, world.\nHo...'); }); - it ('should break at word boundaries', () => { + it('should break at word boundaries', () => { expect(truncate('Hello, world. How are you?', 18, {breakOnWords: true})) .toBe('Hello, world....'); expect(truncate('Hello, world.\nHow are you?', 18, {breakOnWords: true})) .toBe('Hello, world....'); }); - it ('should uses custom elipses', () => { + it('should uses custom elipses', () => { expect(truncate('Hello, world.', 9, {elipsis: '·'})) .toBe('He·'); }); - it ('shouldn\'t barf with weird input', () => { + it('shouldn\'t barf with weird input', () => { expect(truncate('Hello, world.', 0)) .toBe('Hello,...'); expect(truncate('Hello, world.', -132)) diff --git a/Libraries/Utilities/deprecatedCallback.js b/Libraries/Utilities/deprecatedCallback.js index c1373da2a..ab180f66b 100644 --- a/Libraries/Utilities/deprecatedCallback.js +++ b/Libraries/Utilities/deprecatedCallback.js @@ -49,6 +49,6 @@ module.exports = function(promise: Promise, callbacks: Array, typ err => callback(err) ); default: - throw new Error(`Type of callbacks not specified. Must be one of 'success-first', 'error-first', 'single-callback-value-first', or 'node'`); + throw new Error('Type of callbacks not specified. Must be one of \'success-first\', \'error-first\', \'single-callback-value-first\', or \'node\''); } }; diff --git a/Libraries/Utilities/differ/insetsDiffer.js b/Libraries/Utilities/differ/insetsDiffer.js index b0a409470..df81eff93 100644 --- a/Libraries/Utilities/differ/insetsDiffer.js +++ b/Libraries/Utilities/differ/insetsDiffer.js @@ -12,10 +12,10 @@ 'use strict'; type Inset = { - top: ?number; - left: ?number; - right: ?number; - bottom: ?number; + top: ?number, + left: ?number, + right: ?number, + bottom: ?number, } var dummyInsets = { diff --git a/Libraries/Utilities/differ/pointsDiffer.js b/Libraries/Utilities/differ/pointsDiffer.js index c4939199f..7c22bf197 100644 --- a/Libraries/Utilities/differ/pointsDiffer.js +++ b/Libraries/Utilities/differ/pointsDiffer.js @@ -12,8 +12,8 @@ 'use strict'; type Point = { - x: ?number; - y: ?number; + x: ?number, + y: ?number, } var dummyPoint = {x: undefined, y: undefined}; diff --git a/Libraries/Utilities/truncate.js b/Libraries/Utilities/truncate.js index e375f0f37..96c423225 100644 --- a/Libraries/Utilities/truncate.js +++ b/Libraries/Utilities/truncate.js @@ -12,9 +12,9 @@ 'use strict'; type truncateOptions = { - breakOnWords: boolean; - minDelta: number; - elipsis: string; + breakOnWords: boolean, + minDelta: number, + elipsis: string, } const defaultOptions = {