Fix 16 linter warnings in Examples/

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
This commit is contained in:
Bill Glover
2015-10-16 04:02:18 -07:00
committed by facebook-github-bot-4
parent 79e33078f2
commit 8fb9cc8fc1
14 changed files with 18 additions and 24 deletions

View File

@@ -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 (
<View key={"SEP_" + sectionID + "_" + rowID} style={style}/>
<View key={'SEP_' + sectionID + '_' + rowID} style={style}/>
);
},

View File

@@ -44,7 +44,7 @@ var AccessibilityIOSExample = React.createClass({
Accessibility label example
</Text>
</View>
<View accessibilityTraits={["button", "selected"]}
<View accessibilityTraits={['button', 'selected']}
accessible={true}>
<Text>
Accessibility traits example

View File

@@ -99,7 +99,7 @@ var ShareActionSheetExample = React.createClass({
} else {
text = 'You didn\'t share';
}
this.setState({text})
this.setState({text});
});
}
});

View File

@@ -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 <AppStateSubscription showMemoryWarnings={true} />; }
},
];

View File

@@ -21,8 +21,7 @@ var {
ScrollView,
Text,
TouchableHighlight,
TouchableOpacity,
View,
TouchableOpacity
} = React;
var _getRandomRoute = function() {
@@ -82,19 +81,19 @@ var BreadcrumbNavSample = React.createClass({
return (
<ScrollView style={styles.scene}>
<NavButton
onPress={() => { navigator.push(_getRandomRoute()) }}
onPress={() => { navigator.push(_getRandomRoute()); }}
text="Push"
/>
<NavButton
onPress={() => { navigator.immediatelyResetRouteStack([_getRandomRoute(), _getRandomRoute()]) }}
onPress={() => { navigator.immediatelyResetRouteStack([_getRandomRoute(), _getRandomRoute()]); }}
text="Reset w/ 2 scenes"
/>
<NavButton
onPress={() => { navigator.popToTop() }}
onPress={() => { navigator.popToTop(); }}
text="Pop to top"
/>
<NavButton
onPress={() => { navigator.replace(_getRandomRoute()) }}
onPress={() => { navigator.replace(_getRandomRoute()); }}
text="Replace"
/>
<NavButton

View File

@@ -23,7 +23,6 @@ var {
Text,
TouchableHighlight,
TouchableOpacity,
View,
} = React;
var cssVar = require('cssVar');

View File

@@ -134,7 +134,7 @@ var TabBarExample = React.createClass({
<Navigator
ref={this._setNavigatorRef}
style={styles.container}
initialRoute={{ message: "First Scene", }}
initialRoute={{ message: 'First Scene', }}
renderScene={this.renderScene}
configureScene={(route) => {
if (route.sceneConfig) {

View File

@@ -56,7 +56,7 @@ var SwitchAndroidExample = React.createClass({
onValueChange={(value) => this.setState({eventSwitchIsOn: value})}
style={{marginBottom: 10}}
value={this.state.eventSwitchIsOn} />
<Text>{this.state.eventSwitchIsOn ? "On" : "Off"}</Text>
<Text>{this.state.eventSwitchIsOn ? 'On' : 'Off'}</Text>
</UIExplorerBlock>
<UIExplorerBlock title="Switches are controlled components">
<SwitchAndroid />

View File

@@ -107,7 +107,7 @@ var EventSwitchExample = React.createClass({
onValueChange={(value) => this.setState({eventSwitchIsOn: value})}
style={{marginBottom: 10}}
value={this.state.eventSwitchIsOn} />
<Text>{this.state.eventSwitchIsOn ? "On" : "Off"}</Text>
<Text>{this.state.eventSwitchIsOn ? 'On' : 'Off'}</Text>
</View>
<View>
<SwitchIOS
@@ -118,7 +118,7 @@ var EventSwitchExample = React.createClass({
onValueChange={(value) => this.setState({eventSwitchRegressionIsOn: value})}
style={{marginBottom: 10}}
value={this.state.eventSwitchRegressionIsOn} />
<Text>{this.state.eventSwitchRegressionIsOn ? "On" : "Off"}</Text>
<Text>{this.state.eventSwitchRegressionIsOn ? 'On' : 'Off'}</Text>
</View>
</View>
);

View File

@@ -19,9 +19,7 @@ var React = require('react-native');
var {
AlertIOS,
Platform,
Text,
ToastAndroid,
TouchableHighlight,
View,
} = React;
var TimerMixin = require('react-timer-mixin');