Skip to content

Commit a0ff055

Browse files
Andrew Ralstonjustin808
Andrew Ralston
authored andcommitted
Update lint dependencies and configure for project
1 parent 5bbc68b commit a0ff055

File tree

9 files changed

+28
-27
lines changed

9 files changed

+28
-27
lines changed

Diff for: client/.eslintrc.yml

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ rules:
2424
indent: [1, 2, { SwitchCase: 1, VariableDeclarator: 2 }]
2525
id-length: [1, { min: 2, exceptions: [_, e, i, k, v] }]
2626
space-before-function-paren: [1, "never"]
27+
no-underscore-dangle: 0
28+
29+
### Imports
30+
import/no-unresolved: 0
2731

2832
### React
2933
jsx-quotes: [1, prefer-double]

Diff for: client/app/bundles/comments/reducers/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import commentsReducer from './commentsReducer';
2-
import { $$initialState as $$commentsState } from './commentsReducer';
1+
import commentsReducer, { $$initialState as $$commentsState } from './commentsReducer';
32

43
export default {
54
$$commentsStore: commentsReducer,

Diff for: client/app/bundles/comments/startup/ClientApp.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import NonRouterCommentsContainer from '../containers/NonRouterCommentsContainer
77
export default props => {
88
const store = createStore(props);
99
return (
10-
<Provider store={store}>
11-
<NonRouterCommentsContainer />
12-
</Provider>
10+
<Provider store={store}>
11+
<NonRouterCommentsContainer />
12+
</Provider>
1313
);
1414
};

Diff for: client/app/bundles/comments/startup/ServerApp.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import NonRouterCommentsContainer from '../containers/NonRouterCommentsContainer
77
export default props => {
88
const store = createStore(props);
99
return (
10-
<Provider store={store}>
11-
<NonRouterCommentsContainer />
12-
</Provider>
10+
<Provider store={store}>
11+
<NonRouterCommentsContainer />
12+
</Provider>
1313
);
1414
};

Diff for: client/app/bundles/comments/store/commentsStore.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { compose, createStore, applyMiddleware, combineReducers } from 'redux';
22
import thunkMiddleware from 'redux-thunk';
33
import loggerMiddleware from 'libs/middlewares/loggerMiddleware';
4-
import reducers from '../reducers';
5-
import { initialStates } from '../reducers';
4+
import reducers, { initialStates } from '../reducers';
65

76
export default props => {
87
const initialComments = props.comments;

Diff for: client/app/bundles/comments/store/routerCommentsStore.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { applyMiddleware, compose, createStore, combineReducers } from 'redux';
22
import thunkMiddleware from 'redux-thunk';
33
import loggerMiddleware from 'libs/middlewares/loggerMiddleware';
4-
import reducers from '../reducers';
4+
import reducers, { initialStates } from '../reducers';
55
import { routerReducer } from 'react-router-redux';
6-
import { initialStates } from '../reducers';
76

87
export default props => {
98
const initialComments = props.comments;

Diff for: client/app/libs/middlewares/loggerMiddleware.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export default function logger({ getState }) {
1010
// We can't _read_ immutable objects in console out-of-the-box.
1111
const state = getState();
1212
const readableState = {};
13-
for (const storeItem in state) {
14-
if (state.hasOwnProperty(storeItem)) {
15-
readableState[storeItem] = (
16-
state[storeItem].toJS ? state[storeItem].toJS() : state[storeItem]
17-
);
18-
}
19-
}
13+
14+
Object.keys(state).forEach(storeItem => {
15+
readableState[storeItem] = (
16+
state[storeItem].toJS ? state[storeItem].toJS() : state[storeItem]
17+
);
18+
return;
19+
});
2020

2121
console.log('state after dispatch', readableState);
2222

Diff for: client/app/libs/testHelper.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ global.window = win;
1212

1313
// from mocha-jsdom https://github.com/rstacruz/mocha-jsdom/blob/master/index.js#L80
1414
function propagateToGlobal(window) {
15-
for (const key in window) {
16-
if (!window.hasOwnProperty(key)) continue;
17-
if (key in global) continue;
18-
15+
Object.keys(window).forEach(key => {
16+
if (key in global) return;
1917
global[key] = window[key];
20-
}
18+
});
2119
}
2220

2321
// take all properties of the window object and also attach it to the

Diff for: client/package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@
9494
"body-parser": "^1.15.0",
9595
"chai": "^3.5.0",
9696
"chai-immutable": "^1.5.4",
97-
"eslint": "^2.7.0",
98-
"eslint-config-shakacode": "^4.0.0",
99-
"eslint-plugin-react": "^4.3.0",
97+
"eslint": "^2.10.1",
98+
"eslint-config-shakacode": "^5.0.0",
99+
"eslint-plugin-import": "^1.8.0",
100+
"eslint-plugin-jsx-a11y": "^1.2.0",
101+
"eslint-plugin-react": "^5.1.1",
100102
"estraverse-fb": "^1.3.1",
101103
"express": "^4.13.4",
102104
"pug": "^2.0.0-alpha3",

0 commit comments

Comments
 (0)