Lint JSON, expand and simplify lint step

This commit is contained in:
Ray Schamp 2016-05-11 19:55:20 -04:00
parent 31c2f98afc
commit b0b520fe18
6 changed files with 26 additions and 29 deletions

4
.eslintignore Normal file
View file

@ -0,0 +1,4 @@
node_modules/*
static/*
build/*
intl/*

View file

@ -25,7 +25,8 @@
"jsx": true
},
"plugins": [
"react"
"react",
"json"
],
"extends": "eslint:recommended"
}

View file

@ -62,18 +62,9 @@ test:
@echo ""
lint:
$(ESLINT) ./*.js
$(ESLINT) ./dev-server/*.js
$(ESLINT) ./bin/**/*.js
$(ESLINT) ./src/*.js
$(ESLINT) ./src/mixins/*.jsx
$(ESLINT) ./src/views/**/*.jsx
$(ESLINT) ./src/components/**/*.jsx
$(ESLINT) ./src/components/**/**/*.jsx
$(ESLINT) . --ext .js,.jsx,.json
$(SASSLINT) ./src/*.scss
$(SASSLINT) ./src/views/**/*.scss
$(SASSLINT) ./src/components/**/*.scss
$(SASSLINT) ./src/components/**/**/*.scss
$(SASSLINT) ./src/**/*.scss
unit:
$(TAP) ./test/unit/*.js

View file

@ -38,6 +38,7 @@
"copy-webpack-plugin": "0.2.0",
"css-loader": "0.23.1",
"eslint": "1.3.1",
"eslint-plugin-json": "1.2.0",
"eslint-plugin-react": "3.3.1",
"exenv": "1.2.0",
"fastly": "1.2.1",

View file

@ -17,14 +17,14 @@ var Actions = {
return {
type: Types.SET_SESSION_ERROR,
error: error
}
};
},
setSession: function (session) {
return {
type: Types.SET_SESSION,
session: session
}
};
},
refreshSession: function () {
@ -62,7 +62,7 @@ var Actions = {
return dispatch(Actions.setToken(sessionData.token));
});
});
}
};
},
setToken: function (token) {

View file

@ -9,13 +9,13 @@ var sessionReducer = function (state, action) {
state = {};
}
switch (action.type) {
case actionTypes.SET_SESSION:
return action.session;
case actionTypes.SET_SESSION_ERROR:
// TODO: do something with action.error
return state;
default:
return state;
case actionTypes.SET_SESSION:
return action.session;
case actionTypes.SET_SESSION_ERROR:
// TODO: do something with action.error
return state;
default:
return state;
}
};
@ -25,13 +25,13 @@ var tokenReducer = function (state, action) {
state = '';
}
switch (action.type) {
case actionTypes.SET_TOKEN:
return action.token;
case actionTypes.SET_TOKEN_ERROR:
// TODO: do something with the error
return state;
default:
return state;
case actionTypes.SET_TOKEN:
return action.token;
case actionTypes.SET_TOKEN_ERROR:
// TODO: do something with the error
return state;
default:
return state;
}
};