From 8fb9cc8fc1f38dbaeede3a3474461c9690319c7a Mon Sep 17 00:00:00 2001 From: Bill Glover Date: Fri, 16 Oct 2015 04:02:18 -0700 Subject: [PATCH] Fix 16 linter warnings in Examples/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Partially fixes #3316 by addressing 16 linter warnings: - Strings should be singlequote - Missing semicolon Travis build jobs 1.1 through 1.4 complete successfully. 1.5 fails through what appears to be an unrelated issue on master. Closes https://github.com/facebook/react-native/pull/3332 Reviewed By: @​svcscm Differential Revision: D2531718 Pulled By: @javache fb-gh-sync-id: ca22fbeac5fe3b4f725775a72f21b6dd7a75d94b --- Examples/Movies/SearchScreen.js | 3 +-- Examples/UIExplorer/AccessibilityIOSExample.js | 2 +- Examples/UIExplorer/ActionSheetIOSExample.js | 2 +- Examples/UIExplorer/AppStateIOSExample.js | 4 ++-- Examples/UIExplorer/Navigator/BreadcrumbNavSample.js | 11 +++++------ Examples/UIExplorer/Navigator/NavigationBarSample.js | 1 - Examples/UIExplorer/Navigator/NavigatorExample.js | 2 +- Examples/UIExplorer/SwitchAndroidExample.android.js | 2 +- Examples/UIExplorer/SwitchIOSExample.js | 4 ++-- Examples/UIExplorer/TimerExample.js | 2 -- .../Initialization/ExceptionsManager.js | 2 +- .../Initialization/loadSourceMap.js | 2 +- Libraries/ReactIOS/WarningBox.js | 4 ++-- Libraries/Text/Text.js | 1 - 14 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Examples/Movies/SearchScreen.js b/Examples/Movies/SearchScreen.js index 4fd36790b..1bc6bb906 100644 --- a/Examples/Movies/SearchScreen.js +++ b/Examples/Movies/SearchScreen.js @@ -23,7 +23,6 @@ var { ProgressBarAndroid, StyleSheet, Text, - TextInput, View, } = React; var TimerMixin = require('react-timer-mixin'); @@ -271,7 +270,7 @@ var SearchScreen = React.createClass({ style = [style, styles.rowSeparatorHide]; } return ( - + ); }, diff --git a/Examples/UIExplorer/AccessibilityIOSExample.js b/Examples/UIExplorer/AccessibilityIOSExample.js index 1a86e5459..d543d7253 100644 --- a/Examples/UIExplorer/AccessibilityIOSExample.js +++ b/Examples/UIExplorer/AccessibilityIOSExample.js @@ -44,7 +44,7 @@ var AccessibilityIOSExample = React.createClass({ Accessibility label example - Accessibility traits example diff --git a/Examples/UIExplorer/ActionSheetIOSExample.js b/Examples/UIExplorer/ActionSheetIOSExample.js index 5c6ba8f96..c8527657f 100644 --- a/Examples/UIExplorer/ActionSheetIOSExample.js +++ b/Examples/UIExplorer/ActionSheetIOSExample.js @@ -99,7 +99,7 @@ var ShareActionSheetExample = React.createClass({ } else { text = 'You didn\'t share'; } - this.setState({text}) + this.setState({text}); }); } }); diff --git a/Examples/UIExplorer/AppStateIOSExample.js b/Examples/UIExplorer/AppStateIOSExample.js index c2a011ceb..9cf15fad1 100644 --- a/Examples/UIExplorer/AppStateIOSExample.js +++ b/Examples/UIExplorer/AppStateIOSExample.js @@ -40,7 +40,7 @@ var AppStateSubscription = React.createClass({ AppStateIOS.removeEventListener('memoryWarning', this._handleMemoryWarning); }, _handleMemoryWarning: function() { - this.setState({memoryWarnings: this.state.memoryWarnings + 1}) + this.setState({memoryWarnings: this.state.memoryWarnings + 1}); }, _handleAppStateChange: function(appState) { var previousAppStates = this.state.previousAppStates.slice(); @@ -92,7 +92,7 @@ exports.examples = [ }, { title: 'Memory Warnings', - description: "In the simulator, hit Shift+Command+M to simulate a memory warning.", + description: 'In the simulator, hit Shift+Command+M to simulate a memory warning.', render(): ReactElement { return ; } }, ]; diff --git a/Examples/UIExplorer/Navigator/BreadcrumbNavSample.js b/Examples/UIExplorer/Navigator/BreadcrumbNavSample.js index 08b8571ae..62196e5f2 100644 --- a/Examples/UIExplorer/Navigator/BreadcrumbNavSample.js +++ b/Examples/UIExplorer/Navigator/BreadcrumbNavSample.js @@ -21,8 +21,7 @@ var { ScrollView, Text, TouchableHighlight, - TouchableOpacity, - View, + TouchableOpacity } = React; var _getRandomRoute = function() { @@ -82,19 +81,19 @@ var BreadcrumbNavSample = React.createClass({ return ( { navigator.push(_getRandomRoute()) }} + onPress={() => { navigator.push(_getRandomRoute()); }} text="Push" /> { navigator.immediatelyResetRouteStack([_getRandomRoute(), _getRandomRoute()]) }} + onPress={() => { navigator.immediatelyResetRouteStack([_getRandomRoute(), _getRandomRoute()]); }} text="Reset w/ 2 scenes" /> { navigator.popToTop() }} + onPress={() => { navigator.popToTop(); }} text="Pop to top" /> { navigator.replace(_getRandomRoute()) }} + onPress={() => { navigator.replace(_getRandomRoute()); }} text="Replace" /> { if (route.sceneConfig) { diff --git a/Examples/UIExplorer/SwitchAndroidExample.android.js b/Examples/UIExplorer/SwitchAndroidExample.android.js index 6b703bc2f..7b6f38e16 100644 --- a/Examples/UIExplorer/SwitchAndroidExample.android.js +++ b/Examples/UIExplorer/SwitchAndroidExample.android.js @@ -56,7 +56,7 @@ var SwitchAndroidExample = React.createClass({ onValueChange={(value) => this.setState({eventSwitchIsOn: value})} style={{marginBottom: 10}} value={this.state.eventSwitchIsOn} /> - {this.state.eventSwitchIsOn ? "On" : "Off"} + {this.state.eventSwitchIsOn ? 'On' : 'Off'} diff --git a/Examples/UIExplorer/SwitchIOSExample.js b/Examples/UIExplorer/SwitchIOSExample.js index 3a70e2b5a..feedfbff3 100644 --- a/Examples/UIExplorer/SwitchIOSExample.js +++ b/Examples/UIExplorer/SwitchIOSExample.js @@ -107,7 +107,7 @@ var EventSwitchExample = React.createClass({ onValueChange={(value) => this.setState({eventSwitchIsOn: value})} style={{marginBottom: 10}} value={this.state.eventSwitchIsOn} /> - {this.state.eventSwitchIsOn ? "On" : "Off"} + {this.state.eventSwitchIsOn ? 'On' : 'Off'} this.setState({eventSwitchRegressionIsOn: value})} style={{marginBottom: 10}} value={this.state.eventSwitchRegressionIsOn} /> - {this.state.eventSwitchRegressionIsOn ? "On" : "Off"} + {this.state.eventSwitchRegressionIsOn ? 'On' : 'Off'} ); diff --git a/Examples/UIExplorer/TimerExample.js b/Examples/UIExplorer/TimerExample.js index 8d28e18ae..55272a822 100644 --- a/Examples/UIExplorer/TimerExample.js +++ b/Examples/UIExplorer/TimerExample.js @@ -19,9 +19,7 @@ var React = require('react-native'); var { AlertIOS, Platform, - Text, ToastAndroid, - TouchableHighlight, View, } = React; var TimerMixin = require('react-timer-mixin'); diff --git a/Libraries/JavaScriptAppEngine/Initialization/ExceptionsManager.js b/Libraries/JavaScriptAppEngine/Initialization/ExceptionsManager.js index a1335722b..41b94be0b 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/ExceptionsManager.js +++ b/Libraries/JavaScriptAppEngine/Initialization/ExceptionsManager.js @@ -114,7 +114,7 @@ function stackFrameToString(stackFrame, maxLength) { var fileName = fileNameParts[fileNameParts.length - 1]; if (fileName.length > 18) { - fileName = fileName.substr(0, 17) + '\u2026' /* ... */; + fileName = fileName.substr(0, 17) + '\u2026'; /* ... */ } var spaces = fillSpaces(maxLength - stackFrame.methodName.length); diff --git a/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js b/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js index 80b7fc5a3..de96ad2be 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js +++ b/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js @@ -48,7 +48,7 @@ function fetchSourceMap(): Promise { return Promise.resolve(url); }) .then(fetch) - .then(response => response.text()) + .then(response => response.text()); } function extractSourceMapURL({url, text, fullSourceMappingURL}): ?string { diff --git a/Libraries/ReactIOS/WarningBox.js b/Libraries/ReactIOS/WarningBox.js index 8caaa5e02..09ac954c5 100644 --- a/Libraries/ReactIOS/WarningBox.js +++ b/Libraries/ReactIOS/WarningBox.js @@ -135,12 +135,12 @@ var WarningRow = React.createClass({ }); this.panGesture = PanResponder.create({ onStartShouldSetPanResponder: () => { - return !! this.dismissalSpring.getCurrentValue(); + return !!this.dismissalSpring.getCurrentValue(); }, onMoveShouldSetPanResponder: () => true, onPanResponderGrant: () => { this.isResponderOnlyToBlockTouches = - !! this.dismissalSpring.getCurrentValue(); + !!this.dismissalSpring.getCurrentValue(); }, onPanResponderMove: (e, gestureState) => { if (this.isResponderOnlyToBlockTouches) { diff --git a/Libraries/Text/Text.js b/Libraries/Text/Text.js index 3d98ff56a..c9ca8357d 100644 --- a/Libraries/Text/Text.js +++ b/Libraries/Text/Text.js @@ -113,7 +113,6 @@ var Text = React.createClass({ isHighlighted: false, }); }, - getDefaultProps: function(): Object { return { allowFontScaling: true,