Commit 8b878635 authored by Wietse Kuipers's avatar Wietse Kuipers

Fix some linting errors

parent e4795bc9
......@@ -6,7 +6,8 @@
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
"plugin:react/recommended",
"airbnb"
],
"parserOptions": {
"ecmaFeatures": {
......@@ -40,7 +41,9 @@
"react-native/no-unused-styles": 2,
"react-native/split-platform-components": 2,
"react-native/no-inline-styles": 2,
"react-native/no-color-literals": 2
"react-native/no-color-literals": 2,
"react/jsx-filename-extension": 0,
"react/prefer-stateless-function": 1
}
}
......@@ -28,3 +28,8 @@ export default class Login extends Component {
);
}
}
Login.propTypes = {
loggedIn: React.PropTypes.bool.isRequired,
login: React.PropTypes.func.isRequired,
};
......@@ -5,18 +5,26 @@ import Login from '../components/Login';
import * as ThaliAppActions from '../actions/ThaliAppActions';
class ThaliApp extends Component {
render() {
const { state, actions } = this.props;
// const { state, actions } = this.props;
return (
<Login
loggedIn={state.loggedIn}
{...actions}
loggedIn={this.props.state.loggedIn}
{...this.props.actions}
/>
);
}
}
ThaliApp.propTypes = {
state: React.PropTypes.objectOf(React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.bool,
React.PropTypes.number,
])).isRequired,
actions: React.PropTypes.objectOf(React.PropTypes.func).isRequired,
};
export default connect(
state => (
{ state: state.login }
......
import {
React,
AppRegistry
AppRegistry,
} from 'react-native';
import App from './app/containers/app';
......
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import App from './app/containers/app';
export default class ThaliApp extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('ThaliApp', () => ThaliApp);
AppRegistry.registerComponent('ThaliApp', () => App);
......@@ -4,7 +4,8 @@
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
"test": "jest",
"lint": "eslint *.js app --fix"
},
"dependencies": {
"react": "~15.4.0-rc.4",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment