Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
4kimov committed Jul 29, 2016
1 parent a667201 commit 6f8a6f7
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,9 @@
"before": false,
"after": true
}],
"space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords
"keyword-spacing": 2, // http://eslint.org/docs/rules/keyword-spacing
"space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks
"space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren
"space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops
"space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case
"space-infix-ops": 2 // http://eslint.org/docs/rules/space-infix-ops
}
}
2 changes: 1 addition & 1 deletion Button.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
const Button = (props) => {
return <TouchableNativeFeedback
delayPressIn={0}
background={TouchableNativeFeedback.SelectableBackground()}
background={TouchableNativeFeedback.SelectableBackground()} // eslint-disable-line new-cap
{...props}
>
{props.children}
Expand Down
4 changes: 2 additions & 2 deletions DefaultTabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ const DefaultTabBar = React.createClass({
const fontWeight = isTabActive ? 'bold' : 'normal';

return <Button
style={{flex: 1}}
style={{flex: 1, }}
key={name}
accessible={true}
accessibilityLabel={name}
accessibilityTraits='button'
onPress={() => this.props.goToPage(page)}
>
<View style={[styles.tab, this.props.tabStyle]}>
<View style={[styles.tab, this.props.tabStyle, ]}>
<Text style={[{color: textColor, fontWeight, }, textStyle, ]}>
{name}
</Text>
Expand Down
8 changes: 4 additions & 4 deletions ScrollableTabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const ScrollableTabBar = React.createClass({
let newScrollX = tabOffset + absolutePageOffset;

// center tab and smooth tab change (for when tabWidth changes a lot between two tabs)
newScrollX -= (containerWidth - (1 - pageOffset) * tabWidth - pageOffset * nextTabWidth ) / 2 ;
newScrollX -= (containerWidth - (1 - pageOffset) * tabWidth - pageOffset * nextTabWidth) / 2;
newScrollX = newScrollX >= 0 ? newScrollX : 0;

if (Platform.OS === 'android') {
Expand Down Expand Up @@ -136,7 +136,7 @@ const ScrollableTabBar = React.createClass({
onPress={() => this.props.goToPage(page)}
onLayout={this.measureTab.bind(this, page)}
>
<View style={[styles.tab, this.props.tabStyle]}>
<View style={[styles.tab, this.props.tabStyle, ]}>
<Text style={[{color: textColor, fontWeight, }, textStyle, ]}>
{name}
</Text>
Expand Down Expand Up @@ -164,7 +164,7 @@ const ScrollableTabBar = React.createClass({
};

return <View
style={[styles.container, {backgroundColor: this.props.backgroundColor, }, this.props.style]}
style={[styles.container, {backgroundColor: this.props.backgroundColor, }, this.props.style, ]}
onLayout={this.onContainerLayout}
>
<ScrollView
Expand All @@ -176,7 +176,7 @@ const ScrollableTabBar = React.createClass({
bounces={false}
>
<View
style={[styles.tabs, {width: this.state._containerWidth, }, this.props.tabsContainerStyle]}
style={[styles.tabs, {width: this.state._containerWidth, }, this.props.tabsContainerStyle, ]}
ref={'tabContainer'}
onLayout={this.onTabContainerLayout}
>
Expand Down
6 changes: 3 additions & 3 deletions examples/FacebookTabsExample/DynamicExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import ScrollableTabView, { DefaultTabBar, } from 'react-native-scrollable-tab-v

const Child = React.createClass({
onEnter() {
console.log('enter: ' + this.props.i);
console.log('enter: ' + this.props.i); // eslint-disable-line no-console
},

onLeave() {
console.log('leave: ' + this.props.i);
console.log('leave: ' + this.props.i); // eslint-disable-line no-console
},

render() {
Expand Down Expand Up @@ -51,7 +51,7 @@ export default React.createClass({
>
{this.state.tabs.map((tab, i) => {
return <Child
ref={(ref) => this.children[i] = ref}
ref={(ref) => (this.children[i] = ref)}
tabLabel={`tab${i}`}
i={i}
key={i}
Expand Down
2 changes: 1 addition & 1 deletion examples/FacebookTabsExample/FacebookExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default React.createClass({
<Text>Other nav</Text>
</View>
</ScrollView>
</ScrollableTabView>
</ScrollableTabView>;
},
});

Expand Down
2 changes: 1 addition & 1 deletion examples/FacebookTabsExample/ScrollableTabsExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export default React.createClass({
<Text tabLabel='Tab #3 word word word'>project</Text>
<Text tabLabel='Tab #4 word word word word'>favorite</Text>
<Text tabLabel='Tab #5'>project</Text>
</ScrollableTabView>
</ScrollableTabView>;
},
});
2 changes: 1 addition & 1 deletion examples/FacebookTabsExample/SimpleExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Text,
} from 'react-native';

import ScrollableTabView, {DefaultTabBar} from 'react-native-scrollable-tab-view';
import ScrollableTabView, {DefaultTabBar, } from 'react-native-scrollable-tab-view';

export default React.createClass({
render() {
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ScrollableTabView = React.createClass({
contentProps: PropTypes.object,
scrollWithoutAnimation: PropTypes.bool,
locked: PropTypes.bool,
prerenderingSiblingsNumber: PropTypes.number
prerenderingSiblingsNumber: PropTypes.number,
},

getDefaultProps() {
Expand All @@ -52,7 +52,7 @@ const ScrollableTabView = React.createClass({
contentProps: {},
scrollWithoutAnimation: false,
locked: false,
prerenderingSiblingsNumber: 0
prerenderingSiblingsNumber: 0,
};
},

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint -c .eslintrc .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -30,5 +31,9 @@
"dependencies": {
"react-static-container": "^1.0.1",
"react-timer-mixin": "^0.13.3"
},
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^3.1.1"
}
}

0 comments on commit 6f8a6f7

Please sign in to comment.