Skip to content

Commit

Permalink
Fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Jun 7, 2017
1 parent 8691938 commit 4a5dfbd
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 25 deletions.
7 changes: 4 additions & 3 deletions examples/react-native-vanilla/__tests__/index.android.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This is the default file as put down by RN
/* eslint-disable */

import 'react-native';
import React from 'react';
import Index from '../index.android.js';
Expand All @@ -6,7 +9,5 @@ import Index from '../index.android.js';
import renderer from 'react-test-renderer';

it('renders correctly', () => {
const tree = renderer.create(
<Index />
);
const tree = renderer.create(<Index />);
});
7 changes: 4 additions & 3 deletions examples/react-native-vanilla/__tests__/index.ios.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This is the default file as put down by RN
/* eslint-disable */

import 'react-native';
import React from 'react';
import Index from '../index.ios.js';
Expand All @@ -6,7 +9,5 @@ import Index from '../index.ios.js';
import renderer from 'react-test-renderer';

it('renders correctly', () => {
const tree = renderer.create(
<Index />
);
const tree = renderer.create(<Index />);
});
2 changes: 1 addition & 1 deletion examples/react-native-vanilla/__tests__/storyshots.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import initStoryshots, { snapshotWithOptions } from '@storybook/addon-storyshots';
import initStoryshots from '@storybook/addon-storyshots';

initStoryshots({
framework: 'react-native',
Expand Down
10 changes: 6 additions & 4 deletions examples/react-native-vanilla/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @flow
*/

/* eslint-disable */

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

Expand Down Expand Up @@ -31,18 +33,18 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
backgroundColor: '#F5FCFF'
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
margin: 10
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
marginBottom: 5
}
});

AppRegistry.registerComponent('ReactNativeVanilla', () => ReactNativeVanilla);
11 changes: 7 additions & 4 deletions examples/react-native-vanilla/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* @flow
*/

// This is the default file as put down by RN
/* eslint-disable */

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

Expand Down Expand Up @@ -31,18 +34,18 @@ const styles = StyleSheet.create({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
backgroundColor: '#F5FCFF'
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
margin: 10
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
marginBottom: 5
}
});

AppRegistry.registerComponent('ReactNativeVanilla', () => ReactNativeVanilla);
1 change: 1 addition & 0 deletions examples/react-native-vanilla/storybook/index.android.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import StorybookUI from './storybook';

export default StorybookUI;
1 change: 1 addition & 0 deletions examples/react-native-vanilla/storybook/index.ios.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import StorybookUI from './storybook';

export default StorybookUI;
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import React from 'react';
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */

import React, { PropTypes } from 'react';
import { TouchableNativeFeedback } from 'react-native';

export default function Button(props) {
return (
<TouchableNativeFeedback onPress={props.onPress || Function()}>
<TouchableNativeFeedback onPress={props.onPress}>
{props.children}
</TouchableNativeFeedback>
);
}

Button.defaultProps = {
children: null,
onPress: () => {},
};

Button.propTypes = {
children: PropTypes.node,
onPress: PropTypes.func,
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import React from 'react';
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */

import React, { PropTypes } from 'react';
import { TouchableHighlight } from 'react-native';

export default function Button(props) {
return (
<TouchableHighlight onPress={props.onPress || Function()}>
<TouchableHighlight onPress={props.onPress}>
{props.children}
</TouchableHighlight>
);
}

Button.defaultProps = {
children: null,
onPress: () => {},
};

Button.propTypes = {
children: PropTypes.node,
onPress: PropTypes.func,
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */

import React, { PropTypes } from 'react';
import { View } from 'react-native';
import style from './style';

Expand All @@ -9,3 +11,11 @@ export default function CenterView(props) {
</View>
);
}

CenterView.defaultProps = {
children: null,
};

CenterView.propTypes = {
children: PropTypes.node,
};
24 changes: 19 additions & 5 deletions examples/react-native-vanilla/storybook/stories/Welcome/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react';
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */

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

export default class Welcome extends React.Component {
Expand All @@ -19,8 +21,8 @@ export default class Welcome extends React.Component {
},
};

showApp(e) {
e.preventDefault();
showApp(event) {
event.preventDefault();
if (this.props.showApp) this.props.showApp();
}

Expand All @@ -29,12 +31,24 @@ export default class Welcome extends React.Component {
<View style={this.styles.wrapper}>
<Text style={this.styles.header}>Welcome to React Native Storybook</Text>
<Text style={this.styles.content}>
This is a UI Component development environment for your React Native app. Here you can display and interact with your UI components as stories. A story is a single state of one or more UI components. You can have as many stories as you want. In other words a story is like a visual test case.
This is a UI Component development environment for your React Native app. Here you can
display and interact with your UI components as stories. A story is a single state of one
or more UI components. You can have as many stories as you want. In other words a story is
like a visual test case.
</Text>
<Text style={this.styles.content}>
We have added some stories inside the "storybook/stories" directory for examples. Try editing the "storybook/stories/Welcome.js" file to edit this message.
We have added some stories inside the "storybook/stories" directory for examples. Try
editing the "storybook/stories/Welcome.js" file to edit this message.
</Text>
</View>
);
}
}

Welcome.defaultProps = {
showApp: null,
};

Welcome.propTypes = {
showApp: PropTypes.func,
};
1 change: 1 addition & 0 deletions examples/react-native-vanilla/storybook/storybook.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { setOptions } from '@storybook/addon-options';

// import stories
configure(() => {
// eslint-disable-next-line global-require
require('./stories');
}, module);

Expand Down

0 comments on commit 4a5dfbd

Please sign in to comment.