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:
parent
79e33078f2
commit
8fb9cc8fc1
|
@ -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}/>
|
||||
);
|
||||
},
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -99,7 +99,7 @@ var ShareActionSheetExample = React.createClass({
|
|||
} else {
|
||||
text = 'You didn\'t share';
|
||||
}
|
||||
this.setState({text})
|
||||
this.setState({text});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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} />; }
|
||||
},
|
||||
];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -23,7 +23,6 @@ var {
|
|||
Text,
|
||||
TouchableHighlight,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} = React;
|
||||
|
||||
var cssVar = require('cssVar');
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 />
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
|
|
|
@ -19,9 +19,7 @@ var React = require('react-native');
|
|||
var {
|
||||
AlertIOS,
|
||||
Platform,
|
||||
Text,
|
||||
ToastAndroid,
|
||||
TouchableHighlight,
|
||||
View,
|
||||
} = React;
|
||||
var TimerMixin = require('react-timer-mixin');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -113,7 +113,6 @@ var Text = React.createClass({
|
|||
isHighlighted: false,
|
||||
});
|
||||
},
|
||||
|
||||
getDefaultProps: function(): Object {
|
||||
return {
|
||||
allowFontScaling: true,
|
||||
|
|
Loading…
Reference in New Issue