Skip to content

Commit

Permalink
lint all examples using eslint (jestjs#3080)
Browse files Browse the repository at this point in the history
* lint examples/react-native

* correct indentations for react-native example
  • Loading branch information
abdulhannanali authored and skovhus committed Apr 29, 2017
1 parent fce932e commit 019bf9b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
**/vendor/**
bin/
docs/
examples/react-native
flow-typed/**
packages/*/build/**
types/**
Expand Down
34 changes: 17 additions & 17 deletions examples/react-native/Intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,45 @@
* https://github.com/facebook/react-native
* @flow
*/
'use strict';
'use strict';

import React, {Component} from 'react';
import {
StyleSheet,
Text,
View
View,
} from 'react-native';

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
flex: 1,
justifyContent: 'center',
},
instructions: {
color: '#333333',
marginBottom: 5,
textAlign: 'center',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});

export default class Intro extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
This is a React Native snapshot test.
</Text>
</View>
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
This is a React Native snapshot test.
</Text>
</View>
);
}
}
4 changes: 2 additions & 2 deletions examples/react-native/__tests__/Intro-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ it('renders the Image component', done => {
const Image = require('Image');
Image.getSize('path.jpg', (width, height) => {
const tree = renderer.create(
<Image style={{width, height}} />
<Image style={{height, width}} />
).toJSON();
expect(tree).toMatchSnapshot();
done();
Expand Down Expand Up @@ -59,7 +59,7 @@ it('renders the ListView component', () => {
const tree = renderer.create(
<ListView
dataSource={dataSource}
renderRow={(rowData) => <Text>{rowData}</Text>}
renderRow={rowData => <Text>{rowData}</Text>}
/>
).toJSON();
expect(tree).toMatchSnapshot();
Expand Down

0 comments on commit 019bf9b

Please sign in to comment.