Skip to content

Commit e51db47

Browse files
committed
eslint additions
1 parent 43b789f commit e51db47

File tree

7 files changed

+11
-34
lines changed

7 files changed

+11
-34
lines changed

mobile/ReactNativeTutorial/.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["react-native"]
3-
}
2+
"presets": ["react-native"]
3+
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
node_modules
21
ios
32
android
4-
.git
Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
22
extends:
33
- "eslint-config-shakacode"
4+
- "plugin:lodash-fp/recommended"
5+
- "plugin:flowtype/recommended"
46
plugins:
57
- "react-native"
68
- "flowtype"
79
- "babel"
10+
- "lodash-fp"
811

912
env:
1013
node: true
@@ -22,21 +25,14 @@
2225
onlyFilesWithFlowAnnotation: true
2326
globals:
2427
__DEV__: true
25-
ReactClass: true
26-
ReactElement: true
2728
fetch: true
2829
rules:
2930
new-cap: 0
30-
react/sort-comp: 0
31-
no-console: 0
32-
import/imports-first: 2
33-
import/prefer-default-export: 2
34-
no-duplicate-imports: 0
31+
react/sort-comp: 2
32+
no-console: 2
3533

3634
babel/no-await-in-loop: 1
3735

38-
# Delegating proptypes check to flow
39-
react/prop-types: 0
4036
generator-star-spacing: 0
4137

4238
react-native/no-unused-styles: 2
@@ -47,21 +43,3 @@
4743
react/jsx-filename-extension:
4844
- 1
4945
- extensions: [".js", ".jsx"]
50-
51-
flowtype/require-parameter-type: 1
52-
flowtype/require-return-type:
53-
- 0
54-
- "always"
55-
- annotateUndefined: "never"
56-
flowtype/require-valid-file-annotation:
57-
- 2
58-
- "always"
59-
flowtype/space-after-type-colon:
60-
- 2
61-
- "always"
62-
flowtype/space-before-type-colon:
63-
- 2
64-
- "never"
65-
flowtype/type-id-match:
66-
- 2
67-
- "^([A-Z][a-z0-9]+)+Type$"

mobile/ReactNativeTutorial/app/bundles/comments/effects/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ import { actions as reduxActions } from 'ReactNativeTutorial/app/reducers';
88
import * as api from 'ReactNativeTutorial/app/api';
99

1010
export const fetch = () =>
11-
async function fetchCommentsEffect(dispatch, _, { call }) {
11+
async function fetchCommentsEffect(dispatch, _getState, { call }) {
1212
dispatch(reduxActions.setLoadingComments(true));
1313
let response;
1414
try {
1515
response = await call(api.fetchComments);
1616
} catch (e) {
17-
call(console.log, e);
1817
call(Alert.alert, 'Error', 'Could not connect to server', [{ text: 'OK' }]);
1918
return;
2019
} finally {
@@ -39,7 +38,6 @@ export const createComment = () =>
3938
try {
4039
response = await call(api.postComment, comment);
4140
} catch (e) {
42-
call(console.log, e);
4341
call(Alert.alert, 'Error', 'Could not post your comment', [{ text: 'OK' }]);
4442
return;
4543
} finally {

mobile/ReactNativeTutorial/app/setup/Router/Router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import React from 'react';
23
import { Scene, Router, Reducer } from 'react-native-router-flux';
34
import Add from '../../bundles/comments/containers/Add';

mobile/ReactNativeTutorial/app/setup/loggerMiddleware.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import _ from 'lodash/fp';
23

34
export default function logger({ getState }) {

mobile/ReactNativeTutorial/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"eslint-plugin-flowtype": "^2.25.0",
4040
"eslint-plugin-import": "^1.16.0",
4141
"eslint-plugin-jsx-a11y": "^2.2.3",
42+
"eslint-plugin-lodash-fp": "^2.1.3",
4243
"eslint-plugin-react": "^6.7.1",
4344
"eslint-plugin-react-native": "^2.1.0",
4445
"flow-bin": "^0.33.0",

0 commit comments

Comments
 (0)