Skip to content

Commit b7aa5ce

Browse files
committed
Add linter
1 parent b28e5d5 commit b7aa5ce

5 files changed

Lines changed: 1021 additions & 19 deletions

File tree

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
extends: 'bambi/web',
3+
rules: {
4+
'prettier/prettier': 'error',
5+
'no-unused-vars': 'error',
6+
},
7+
};

docs/stories/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Text, View } from 'react-native';
2+
import { View } from 'react-native';
33
import MapView from 'react-native-maps';
44

55
import { storiesOf } from '@storybook/react';

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"scripts": {
2323
"prepublish": "yarn build",
2424
"build": "mkdir -p dist && babel src --out-dir dist",
25-
"test": "echo \"Error: no test specified\" && exit 1"
25+
"test:lint": "yarn eslint . --quiet",
26+
"test": "yarn test:lint"
2627
},
2728
"babel": {
2829
"presets": [
@@ -39,7 +40,9 @@
3940
"babel-core": "^6.26.0",
4041
"babel-loader": "^7.1.2",
4142
"babel-preset-react-native": "^4.0.0",
42-
"prettier": "^1.7.3",
43+
"eslint": "^5.15.3",
44+
"eslint-config-bambi": "^1.4.0",
45+
"prettier": "^1.16.4",
4346
"react": "^16.0.0",
4447
"react-dom": "^16.0.0",
4548
"react-native-web": "^0.1.1",

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { View, ActivityIndicator, StyleSheet } from 'react-native';
33
import { withGoogleMap, GoogleMap } from 'react-google-maps';
44
import Marker from './Marker';
55

6-
const GoogleMapContainer = withGoogleMap(props => <GoogleMap {...props} ref={props.handleMapMounted} />);
6+
const GoogleMapContainer = withGoogleMap(props => (
7+
<GoogleMap {...props} ref={props.handleMapMounted} />
8+
));
79

810
class MapView extends Component {
911
constructor(props) {
@@ -36,8 +38,7 @@ class MapView extends Component {
3638
onDragStart={!!this.props.onRegionChange && this.props.onRegionChange}
3739
onDragEnd={this.onDragEnd}
3840
defaultZoom={15}
39-
onClick={this.props.onPress}
40-
>
41+
onClick={this.props.onPress}>
4142
{this.props.children}
4243
</GoogleMapContainer>
4344
</View>

0 commit comments

Comments
 (0)