Skip to content
This repository was archived by the owner on Apr 5, 2020. It is now read-only.

Commit 6c3e1fe

Browse files
committed
linting fixes
1 parent 26dc258 commit 6c3e1fe

File tree

19 files changed

+184
-178
lines changed

19 files changed

+184
-178
lines changed

.eslintrc.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
2-
"extends": "airbnb",
3-
"plugins": [
4-
"react",
5-
"jsx-a11y",
6-
"import"
7-
]
2+
"parser": "babel-eslint",
3+
"rules": {
4+
"quotes": [2, "single"],
5+
"eol-last": [0],
6+
"no-mixed-requires": [0],
7+
"no-underscore-dangle": [0]
8+
},
9+
"extends": "airbnb",
10+
"plugins": [
11+
"react",
12+
"jsx-a11y",
13+
"import"
14+
]
815
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"autoprefixer": "6.3.7",
1717
"babel-core": "6.10.4",
18-
"babel-eslint": "6.1.2",
18+
"babel-eslint": "^7.2.3",
1919
"babel-jest": "^15.0.0",
2020
"babel-loader": "6.2.4",
2121
"babel-plugin-syntax-trailing-function-commas": "6.8.0",
@@ -94,6 +94,7 @@
9494
"server": "node ./server_build/server.js",
9595
"build": "node ./scripts/build.js",
9696
"build-server": "node ./scripts/build-server.js",
97-
"test": "jest --verbose"
97+
"test": "jest --verbose",
98+
"lint": "eslint src"
9899
}
99100
}

src/components/App.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React from "react";
22
import auth from '../auth';
33
import { connect } from 'react-redux';
44
import AdminNav from './Nav/AdminNav';
@@ -37,7 +37,7 @@ class App extends React.Component {
3737
return (<Page location={this.props.location} />)
3838
}
3939
}
40-
render = () => {
40+
render() {
4141
return (
4242
<div id="app">
4343
{this.props.loggedIn ? <AdminNav /> : <TopNav />}
@@ -49,7 +49,7 @@ class App extends React.Component {
4949

5050
const mapStateToProps = (state) => ({
5151
loggedIn: state.auth.logged_in,
52-
pageStatus: state.page.statusCode
52+
pageStatus: state.page.statusCode,
5353
});
5454

5555
const mapDispatchToProps = (dispatch) => ({
@@ -67,5 +67,5 @@ const mapDispatchToProps = (dispatch) => ({
6767

6868
export default connect(
6969
mapStateToProps,
70-
mapDispatchToProps
70+
mapDispatchToProps,
7171
)(App);

src/helpers/ImageHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ export function isDark(imageElement, sampleSection){
8282

8383
export function getIconColor(imageElement, sampleSection) {
8484
return isLight(imageElement, sampleSection) ? '#fff' : '#616161'
85-
}
85+
}

src/http/requests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ class APIClient {
7878
}
7979
}
8080

81-
export default APIClient;
81+
export default APIClient;

src/redux/actions/admin.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
/**
22
* @param {string} mode [description]
33
*/
4-
export function updateMode(mode){
4+
export function updateMode(mode) {
55
return {
66
type: 'UPDATE_RESOURCE_MODE',
7-
mode
8-
}
7+
mode,
8+
};
99
}
1010

1111
export function updateResource(pluralName, dataToUpdate, resourceId) {
1212
return {
1313
type: 'UPDATE_RESOURCE_DATA',
1414
dataToUpdate,
1515
pluralName,
16-
resourceId
17-
}
16+
resourceId,
17+
};
1818
}
1919

2020
/**
2121
* @param {boolean} hasChanges - value that helps determine context.
2222
*/
23-
export function updateIndexHasChanges(hasChanges){
23+
export function updateIndexHasChanges(hasChanges) {
2424
return {
2525
type: 'UPDATE_INDEX_HAS_CHANGES',
26-
hasChanges
27-
}
26+
hasChanges,
27+
};
2828
}
2929

3030
/**
3131
* @param {string} pluralName [description]
3232
*/
33-
export function updateAdminState(pluralName, pageType, resourceId){
33+
export function updateAdminState(pluralName, pageType, resourceId) {
3434
return {
3535
type: 'UPDATE_ADMIN_STATE',
3636
pluralName: pluralName.toLowerCase(),
3737
pageType,
38-
resourceId
39-
}
38+
resourceId,
39+
};
4040
}
4141

4242
export function updateEditorData(newData) {
4343
return {
4444
type: 'UPDATE_ADMIN_EDITOR_DATA',
45-
newData
46-
}
45+
newData,
46+
};
4747
}
4848

4949
export function deleteEditorData() {
5050
return {
51-
type: 'DELETE_ADMIN_EDITOR_DATA'
52-
}
51+
type: 'DELETE_ADMIN_EDITOR_DATA',
52+
};
5353
}
5454

5555
export function updateLoadState(dataLoading) {
5656
return {
5757
type: 'UPDATE_ADMIN_LOAD_STATE',
58-
dataLoading
59-
}
58+
dataLoading,
59+
};
6060
}
6161

62-
export function uIndexItemDeleted(item_id) {
62+
export function uIndexItemDeleted(itemId) {
6363
return {
6464
type: 'U_INDEX_ITEM_DELETED',
65-
item_id
66-
}
65+
itemId,
66+
};
6767
}

src/redux/actions/auth.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function update_token(newToken) {
22
return {
33
type: "TOKEN_UPDATED",
4-
token: newToken
4+
token: newToken,
55
};
66
}
77

@@ -11,13 +11,13 @@ export function login_user(user, token, loggedIn, redirectPath) {
1111
user,
1212
token,
1313
loggedIn,
14-
redirectPath
14+
redirectPath,
1515
};
1616
}
1717

1818
export function logout_user(redirectPath) {
1919
return {
2020
type: 'USER_LOGGED_OUT',
21-
redirectPath
22-
}
21+
redirectPath,
22+
};
2323
}

src/redux/actions/form.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
export function update(value, fieldName, formName, errors, isTyping, fieldIsValid) {
22
return {
3-
type: "FORM_INPUT_CHANGE",
3+
type: 'FORM_INPUT_CHANGE',
44
value,
55
fieldName,
66
formName,
77
errors,
88
isTyping,
9-
valid: fieldIsValid
9+
valid: fieldIsValid,
1010
};
1111
}
1212

13-
export function inputError(errors, fieldName, formName){
13+
export function inputError(errors, fieldName, formName) {
1414
return {
1515
type: 'FORM_INPUT_ERROR',
1616
errors,
1717
fieldName,
18-
formName
19-
}
18+
formName,
19+
};
2020
}
2121

22-
export function loadData(fieldValues, formName, valid){
22+
export function loadData(fieldValues, formName, valid) {
2323
return {
24-
type: "FORM_LOAD",
24+
type: 'FORM_LOAD',
2525
fieldValues,
2626
formName,
27-
valid
27+
valid,
2828
};
2929
}
3030

3131
export function reset(formName) {
3232
return {
33-
type: "FORM_RESET",
34-
formName
33+
type: 'FORM_RESET',
34+
formName,
3535
};
3636
}
3737
export function updateFormValidationStatus(valid, formName) {
3838
return {
39-
type: "FORM_VALID",
39+
type: 'FORM_VALID',
4040
valid,
41-
formName
41+
formName,
4242
};
4343
}

src/redux/actions/notification.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export function updateSnackbar(show, header, content, notificationType) {
22
return {
3-
type: "UPDATE_SNACKBAR",
3+
type: 'UPDATE_SNACKBAR',
44
show,
55
header,
66
content,
7-
notificationType
7+
notificationType,
88
};
99
}

src/redux/actions/page.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export function updateStatusCode(statusCode){
1+
export function updateStatusCode(statusCode) {
22
return {
33
type: 'UPDATE_PAGE_STATUS_CODE',
4-
statusCode
5-
}
4+
statusCode,
5+
};
66
}

src/redux/actions/payment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export function updateStripeToken(stripeToken) {
22
return {
33
type: "UPDATE_STRIPE_TOKEN",
4-
stripeToken
4+
stripeToken,
55
};
66
}

src/redux/actions/tree.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
export function updateTree(flatNodes){
1+
export function updateTree(flatNodes) {
22
return {
33
type: 'UPDATE_TREE',
4-
flatNodes
5-
}
4+
flatNodes,
5+
};
66
}
77

88
export function updateTreeState(updatedTree) {
99
return {
1010
type: 'UPDATE_TREE_STATE',
11-
updatedTree
12-
}
11+
updatedTree,
12+
};
1313
}
1414

1515
export function updateTreeResourceAttributes(pluralName, dataToUpdate, resourceId) {
1616
return {
1717
type: 'UPDATE_RESOURCE_ATTRIBUTES_IN_TREE',
1818
dataToUpdate,
1919
pluralName,
20-
resourceId
21-
}
20+
resourceId,
21+
};
2222
}

src/redux/reducers/admin.js

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,56 @@ import assign from 'lodash.assign';
44
import initialState from '../store/initial_states/admin/admin';
55

66
const adminReducer = (state = initialState, action) => {
7-
let update = {}
7+
let update = {};
88

99
switch (action.type) {
1010
case 'UPDATE_RESOURCE_MODE':
11-
update[state.resource.name.plural] = assign({}, state.resources[state.resource.name.plural], {mode: action.mode})
11+
update[state.resource.name.plural] = assign({}, state.resources[state.resource.name.plural], {
12+
mode: action.mode,
13+
});
1214

1315
return {
1416
...state,
15-
resources: assign({}, state.resources, update),
16-
}
17+
resources: assign({}, state.resources, update),
18+
};
1719
case 'UPDATE_INDEX_HAS_CHANGES':
1820
update[action.resourceNamePlural] = assign({}, state.resources[action.resourceNamePlural], {
19-
hasChanges: action.hasChanges
20-
})
21+
hasChanges: action.hasChanges,
22+
});
2123
return {
2224
...state,
2325
resources: assign({}, state.resources, update),
24-
}
26+
};
2527
case 'UPDATE_ADMIN_EDITOR_DATA':
2628
return {
2729
...state,
2830
editorData: merge({}, state.editorData, action.newData),
29-
30-
}
31+
};
3132
case 'DELETE_ADMIN_EDITOR_DATA':
3233
return {
3334
...state,
3435
editorData: {},
35-
}
36+
};
3637
case 'UPDATE_ADMIN_STATE':
3738
return {
3839
...state,
3940
resource: {
4041
name: {
4142
plural: action.namePlural,
42-
singular: singularizeName(action.namePlural)
43-
}
43+
singular: singularizeName(action.namePlural),
44+
},
4445
},
4546
pageType: action.pageType,
4647
resourceId: action.resourceId,
47-
}
48+
};
4849
case 'UPDATE_ADMIN_LOAD_STATE':
4950
return {
5051
...state,
5152
dataLoading: action.dataLoading,
52-
}
53+
};
5354
default:
5455
return state;
5556
}
56-
}
57+
};
5758

58-
export {adminReducer as admin};
59+
export { adminReducer as admin };

0 commit comments

Comments
 (0)