Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Commit

Permalink
Fix eslint errors. (npm start and App work now)
Browse files Browse the repository at this point in the history
  • Loading branch information
barrystaes committed Feb 22, 2016
1 parent 86c59fa commit 6d652f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"no-alert": 0,
"no-lone-blocks": 0,
"jsx-quotes": 1,
"react/display-name": [ 1, {"acceptTranspilerName": true }],
"react/forbid-prop-types": [1, {"forbid": "any"}],
"react/display-name": [ 1, {"ignoreTranspilerName": false }],
"react/forbid-prop-types": [1, {"forbid": ["any"]}],
"react/jsx-boolean-value": 1,
"react/jsx-closing-bracket-location": 0,
"react/jsx-curly-spacing": 1,
Expand Down
20 changes: 11 additions & 9 deletions src/reducers/fuelSavings.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,19 @@ export default function fuelSavingsAppState(state = initialState, action) {
return objectAssign({}, state, { dateModified: dateHelper.getFormattedDateTime(new Date()) });

case CALCULATE_FUEL_SAVINGS:
let newState = objectAssign({}, state);
newState[action.fieldName] = action.value;
let calc = calculator();
newState.necessaryDataIsProvidedToCalculateSavings = calc.necessaryDataIsProvidedToCalculateSavings(newState);
newState.dateModified = dateHelper.getFormattedDateTime(new Date());
{ // limit scope with this code block, to satisfy eslint no-case-declarations rule.
let newState = objectAssign({}, state);
newState[action.fieldName] = action.value;
let calc = calculator();
newState.necessaryDataIsProvidedToCalculateSavings = calc.necessaryDataIsProvidedToCalculateSavings(newState);
newState.dateModified = dateHelper.getFormattedDateTime(new Date());

if (newState.necessaryDataIsProvidedToCalculateSavings) {
newState.savings = calc.calculateSavings(newState);
}
if (newState.necessaryDataIsProvidedToCalculateSavings) {
newState.savings = calc.calculateSavings(newState);
}

return newState;
return newState;
}

default:
return state;
Expand Down

0 comments on commit 6d652f8

Please sign in to comment.