Added react lint support and fixed possible NaN

Signed-off-by: FrenchBen <me@frenchben.com>
This commit is contained in:
FrenchBen 2015-08-31 14:05:38 -04:00
parent 9d830fc5ac
commit 98bb98934e
4 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,8 @@
root: true root: true
plugins:
- react
ecmaFeatures: ecmaFeatures:
modules: true modules: true
jsx: true jsx: true

View File

@ -65,7 +65,8 @@
"babel": "^5.1.10", "babel": "^5.1.10",
"babel-jest": "^5.2.0", "babel-jest": "^5.2.0",
"electron-prebuilt": "^0.27.3", "electron-prebuilt": "^0.27.3",
"eslint": "^1.0.0", "eslint": "^1.3.1",
"eslint-plugin-react": "^3.3.0",
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-babel": "^5.0.1", "grunt-babel": "^5.0.1",
"grunt-chmod": "^1.0.3", "grunt-chmod": "^1.0.3",

View File

@ -46,7 +46,7 @@ var ContainerHome = React.createClass({
render: function () { render: function () {
if (!this.props.container) { if (!this.props.container) {
return; return '';
} }
let body; let body;
@ -70,6 +70,9 @@ var ContainerHome = React.createClass({
} }
sum = sum / this.props.container.Progress.amount; sum = sum / this.props.container.Progress.amount;
if (isNaN(sum)) {
sum = 0;
}
body = ( body = (
<div className="details-progress"> <div className="details-progress">