Add a couple more eslint rules (#50)

* Add a couple more eslint rules

* Add keyword-spacing
This commit is contained in:
Risha Mars 2017-12-15 12:24:42 -08:00 committed by GitHub
parent 8a7579ef4a
commit 55de336325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 7 deletions

View File

@ -13,7 +13,7 @@
"env": {
"browser": true,
"es6": true,
"mocha": true,
"mocha": true
},
"extends" : ["eslint:recommended", "plugin:react/recommended"],
"rules": {
@ -22,6 +22,7 @@
"eqeqeq": [2, "smart"],
"indent": [2, 2],
"jsx-quotes": 1,
"keyword-spacing": 1,
"no-console": [1, { "allow": ["warn", "error"] }], // minor offense
"no-redeclare": [1], // minor offense
"no-trailing-spaces": 1,
@ -48,6 +49,8 @@
"react/sort-prop-types": 1,
"semi": [2, "always"],
"sort-imports": [1, { "ignoreCase": true, "memberSyntaxSortOrder": ["single", "multiple", "all", "none"] }],
"space-before-blocks": [1, "always"],
"space-before-function-paren": [1, "never"],
"strict": [1, "safe"]
}
}

View File

@ -63,7 +63,7 @@ export default class LineGraph extends React.Component {
let hideLabels = false;
if (_.size(this.props.data) > horizontalLabelLimit) {
if(_.size(this.props.data) > labelLimit) {
if (_.size(this.props.data) > labelLimit) {
// if there are way too many bars, don't label at all
hideLabels = true;
} else {

View File

@ -99,7 +99,7 @@ export default class Deployments extends React.Component {
pendingRequests: false
};
if(limitSparklineData) {
if (limitSparklineData) {
// don't fetch timeseries for every deploy
let leastHealthyDeployments = this.getLeastHealthyDeployments(meshDeployMetrics);

View File

@ -109,7 +109,7 @@ export default class MultiLineGraph extends React.Component {
this.updateAxes();
}
updateGraph(){
updateGraph() {
let d = _.isEmpty(this.props.data) ? dataDefaults : this.props.data;
this.svg.select(".line-p50")
@ -132,7 +132,7 @@ export default class MultiLineGraph extends React.Component {
updateAxes() {
// Same as ScatterPlot.jsx
if(this.props.showAxes) {
if (this.props.showAxes) {
let xAxis = d3.axisBottom(this.xScale)
.ticks(5)
.tickSize(5);

View File

@ -124,7 +124,7 @@ export default class LineGraph extends React.Component {
}
updateAxes() {
if(this.props.showAxes) {
if (this.props.showAxes) {
this.xAxis
.call(d3.axisBottom(this.xScale)); // add x axis labels

View File

@ -128,7 +128,7 @@ export default class PodDetail extends React.Component {
}
render() {
if(!this.state.loaded){
if (!this.state.loaded) {
return <ConduitSpinner />;
} else return (
<div className="page-content pod-detail">