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

Commit 26dc258

Browse files
committed
cleaned up some formatting and added linter
1 parent cdfc678 commit 26dc258

32 files changed

+43
-55
lines changed

.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "airbnb",
3+
"plugins": [
4+
"react",
5+
"jsx-a11y",
6+
"import"
7+
]
8+
}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
"chalk": "1.1.3",
3131
"cross-spawn": "4.0.0",
3232
"css-loader": "0.23.1",
33-
"eslint": "^3.5.0",
33+
"eslint": "^3.19.0",
34+
"eslint-config-airbnb": "^15.0.1",
3435
"eslint-loader": "1.4.1",
35-
"eslint-plugin-import": "^1.14.0",
36-
"eslint-plugin-react": "5.2.2",
36+
"eslint-plugin-import": "^2.3.0",
37+
"eslint-plugin-jsx-a11y": "^5.0.3",
38+
"eslint-plugin-react": "^7.0.1",
3739
"extract-text-webpack-plugin": "1.0.1",
3840
"file-loader": "0.9.0",
3941
"fs-extra": "^0.30.0",

src/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
* Method to log user into admin
77
* @param {string} email - email address of the user that is trying to log in
88
* @param {string} pass - the password for the user that is trying to log in
9-
* @param {fucntion} handleLoggedInCallback - function to call on user logged in
9+
* @param {function} handleLoggedInCallback - function to call on user logged in
1010
* @param {function} dispatch - redux dispatch method
1111
* @return {undefined}
1212
*/

src/components/StyleContextProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ class ContextProvider extends React.Component {
3535
}
3636
}
3737

38-
export default ContextProvider
38+
export default ContextProvider;

src/form-validation/validations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ module.exports = {
117117
}
118118
}
119119
}
120-
}
120+
}

src/form-validation/validator.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,3 @@ const Validator = {
5757
}
5858

5959
export default Validator;
60-
61-
62-
63-
64-
65-
66-
67-
68-
69-
70-
71-
72-
73-

src/helpers/PageHelper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export function getTemplateName(template_id) {
32
let templateName = 'BasicTemplate';
43

@@ -36,4 +35,4 @@ export function getTemplateName(template_id) {
3635
}
3736

3837
return templateName;
39-
}
38+
}

src/helpers/ResourceHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ export function singularizeName(wordToSingularize){
101101
}
102102
}
103103
}
104-
}
104+
}

src/helpers/ScriptsHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ export function loadStylesheet(filepath, onLoadCallback, onErrorCallback) {
6767
fileref.setAttribute("type", "text/css")
6868
fileref.setAttribute("href", filepath)
6969
document.getElementsByTagName("head")[0].appendChild(fileref)
70-
}
70+
}

src/helpers/StringHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export function slugify(text)
1414
.replace(/[^\w-]+/g, '') // Remove all non-word chars
1515
.replace(/--+/g, '-') // Replace multiple - with single -
1616
.replace(/^-+/, '')
17-
}
17+
}

src/helpers/ValidationHelper.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
// Returns valid validation result. Useful for writing custom rule functions.
21
export function valid(sanitizedValue) {
32
return {isValid: true, reason: null,}
43
}
54

6-
// Returns invalid validation result with specified reason. Useful for writing
7-
// custom rule functions.
85
export function invalid(reason, sanitizedValue) {
96
return {isValid: false, reason: reason, value: sanitizedValue}
10-
}
7+
}

src/http/AuthIntercept.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import { store } from '../redux/store/store'
22

33
const AuthIntercept = require('superagent-intercept')((err, res) => {
4-
// console.log(res.status);
5-
// console.log(res);
64
if(err) {
7-
console.log('ERROR: ', err);
8-
5+
console.warn('ERROR: ', err);
96
} else if(res.status === 401 && store.getState().auth.logged_in && res.body.message === "Token has expired") {
107
// If user is logged in and their token has expired, log them out.
118
store.dispatch({
@@ -15,4 +12,4 @@ const AuthIntercept = require('superagent-intercept')((err, res) => {
1512
}
1613
});
1714

18-
export default AuthIntercept
15+
export default AuthIntercept;

src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Root for client
2-
32
import React from 'react'
43
import ReactDOM from 'react-dom'
54
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'

src/muiTheme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ const muiTheme = getMuiTheme(baseTheme, {
3838
});
3939

4040

41-
export default muiTheme;
41+
export default muiTheme;

src/redux/actions/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ export function uIndexItemDeleted(item_id) {
6464
type: 'U_INDEX_ITEM_DELETED',
6565
item_id
6666
}
67-
}
67+
}

src/redux/actions/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ export function logout_user(redirectPath) {
2020
type: 'USER_LOGGED_OUT',
2121
redirectPath
2222
}
23-
}
23+
}

src/redux/actions/form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ export function updateFormValidationStatus(valid, formName) {
4040
valid,
4141
formName
4242
};
43-
}
43+
}

src/redux/actions/notification.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export function updateSnackbar(show, header, content, notificationType) {
66
content,
77
notificationType
88
};
9-
}
9+
}

src/redux/actions/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export function updateStatusCode(statusCode){
33
type: 'UPDATE_PAGE_STATUS_CODE',
44
statusCode
55
}
6-
}
6+
}

src/redux/actions/payment.js

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

src/redux/actions/tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ export function updateTreeResourceAttributes(pluralName, dataToUpdate, resourceI
1919
pluralName,
2020
resourceId
2121
}
22-
}
22+
}

src/redux/reducers/admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ const adminReducer = (state = initialState, action) => {
5555
}
5656
}
5757

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

src/redux/reducers/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ const auth = (state = initialState, action) => {
2525
}
2626
}
2727

28-
export { auth }
28+
export { auth };

src/redux/reducers/form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ const formReducer = (state = initialState, action) => {
7676
}
7777
}
7878

79-
export {formReducer as forms}
79+
export {formReducer as forms}

src/redux/reducers/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ export * from './form';
44
export * from './notification';
55
export * from './page';
66
export * from './payment';
7-
export * from './tree';
7+
export * from './tree';

src/redux/reducers/notification.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ const notificationReducer = (state = initialState, action) => {
1616
}
1717
}
1818

19-
export {notificationReducer as notifications}
19+
export {notificationReducer as notifications};

src/redux/reducers/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ const page = (state = initialState, action) => {
1111
}
1212
}
1313

14-
export {page}
14+
export {page}

src/redux/reducers/payment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ const paymentReducer = (state = initialState, action) => {
1111
}
1212
}
1313

14-
export {paymentReducer as payments}
14+
export {paymentReducer as payments}

src/redux/reducers/tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ function updateSingleNodeInTree(previousState, action) {
7070
}
7171
}
7272

73-
export {treeReducer as tree}
73+
export {treeReducer as tree}

src/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,4 @@ function getUserCount(nextState, replace, dispatch) {
190190
reject(-1);
191191
})
192192
})
193-
}
193+
}

src/routes/admin/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ const getAdminRoutes = (store) => {
3737
return routes;
3838
}
3939

40-
export default getAdminRoutes;
40+
export default getAdminRoutes;

src/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ function renderPage(renderProps, store){
9898

9999
app.listen(app.get('port'))
100100

101-
console.info('==> Server is listening in ' + process.env.NODE_ENV + ' mode')
102-
console.info('==> Go to http://localhost:%s', app.get('port'))
101+
console.info('==> Server is listening in ' + process.env.NODE_ENV + ' mode');
102+
console.info('==> Go to http://localhost:%s', app.get('port'));

0 commit comments

Comments
 (0)