mirror of https://github.com/linkerd/linkerd2.git
Add a couple more eslint rules (#50)
* Add a couple more eslint rules * Add keyword-spacing
This commit is contained in:
parent
8a7579ef4a
commit
55de336325
|
@ -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"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue