mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(tslint): more tslint work
This commit is contained in:
parent
59c928acc2
commit
08caf4bbde
@ -70,7 +70,7 @@
|
||||
"lodash": "^2.4.1",
|
||||
"sinon": "1.16.1",
|
||||
"systemjs-builder": "^0.14.15",
|
||||
"tslint": "^3.2.0",
|
||||
"tslint": "^5.2.0",
|
||||
"typescript": "^1.7.5"
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
import moment from 'moment'
|
||||
import moment from 'moment';
|
||||
|
||||
import * as rangeUtil from 'app/core/utils/rangeutil';
|
||||
|
||||
|
@ -228,10 +228,8 @@ describe('CloudWatchDatasource', function() {
|
||||
switch (params.data.action) {
|
||||
case 'DescribeAlarmsForMetric':
|
||||
return ctx.$q.when({data: alarmResponse});
|
||||
break;
|
||||
case 'DescribeAlarmHistory':
|
||||
return ctx.$q.when({data: historyResponse});
|
||||
break;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
import {describe, beforeEach, it, sinon, expect} from 'test/lib/common';
|
||||
import {describe, beforeEach, it, expect} from 'test/lib/common';
|
||||
import ElasticResponse from '../elastic_response';
|
||||
|
||||
describe('ElasticResponse', function() {
|
||||
@ -497,11 +497,6 @@ describe('ElasticResponse', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('', function() {
|
||||
|
||||
|
||||
});
|
||||
|
||||
describe('Raw documents query', function() {
|
||||
beforeEach(function() {
|
||||
targets = [{ refId: 'A', metrics: [{type: 'raw_document', id: '1'}], bucketAggs: [] }];
|
||||
|
@ -1,6 +1,5 @@
|
||||
///<amd-dependency path="app/plugins/datasource/graphite/gfunc" name="gfunc" />
|
||||
|
||||
import {describe, beforeEach, it, sinon, expect} from 'test/lib/common';
|
||||
import {describe, it, expect} from 'test/lib/common';
|
||||
import gfunc from '../gfunc';
|
||||
|
||||
describe('when creating func instance from func names', function() {
|
||||
|
@ -126,9 +126,7 @@ function addMathStrategy(selectParts, partModel) {
|
||||
if (selectParts[partCount-2].def.type === 'math') {
|
||||
selectParts[partCount-2] = partModel;
|
||||
return;
|
||||
}
|
||||
// if last is alias add it before
|
||||
else if (selectParts[partCount-1].def.type === 'alias') {
|
||||
} else if (selectParts[partCount-1].def.type === 'alias') { // if last is alias add it before
|
||||
selectParts.splice(partCount-1, 0, partModel);
|
||||
return;
|
||||
}
|
||||
@ -399,8 +397,7 @@ class QueryPart {
|
||||
|
||||
if (strValue === '' && this.def.params[index].optional) {
|
||||
this.params.splice(index, 1);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.params[index] = strValue;
|
||||
}
|
||||
|
||||
|
@ -96,13 +96,12 @@ export class TableRenderer {
|
||||
}
|
||||
|
||||
renderCell(columnIndex, value, addWidthHack = false) {
|
||||
var value = this.formatColumnValue(columnIndex, value);
|
||||
value = this.formatColumnValue(columnIndex, value);
|
||||
var style = '';
|
||||
if (this.colorState.cell) {
|
||||
style = ' style="background-color:' + this.colorState.cell + ';color: white"';
|
||||
this.colorState.cell = null;
|
||||
}
|
||||
else if (this.colorState.value) {
|
||||
} else if (this.colorState.value) {
|
||||
style = ' style="color:' + this.colorState.value + '"';
|
||||
this.colorState.value = null;
|
||||
}
|
||||
|
@ -52,8 +52,7 @@ transformers['timeseries_to_columns'] = {
|
||||
if (!points[timeKey]) {
|
||||
points[timeKey] = {time: dp[1]};
|
||||
points[timeKey][i] = dp[0];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
points[timeKey][i] = dp[0];
|
||||
}
|
||||
}
|
||||
|
15
tslint.json
15
tslint.json
@ -4,17 +4,12 @@
|
||||
"comment-format": [true, "check-space"],
|
||||
"curly": true,
|
||||
"eofline": true,
|
||||
"forin": true,
|
||||
"forin": false,
|
||||
"indent": [true, "spaces"],
|
||||
"label-position": true,
|
||||
"label-undefined": true,
|
||||
"max-line-length": [true, 140],
|
||||
"member-access": false,
|
||||
"member-ordering": [true,
|
||||
"public-before-private",
|
||||
"static-before-instance",
|
||||
"variables-before-functions"
|
||||
],
|
||||
"no-arg": true,
|
||||
"no-bitwise": true,
|
||||
"no-console": [true,
|
||||
@ -31,13 +26,13 @@
|
||||
"no-empty": true,
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": true,
|
||||
"no-shadowed-variable": true,
|
||||
"no-string-literal": true,
|
||||
"no-shadowed-variable": false,
|
||||
"no-string-literal": false,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-comma": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-unused-expression": false,
|
||||
"no-unused-variable": false,
|
||||
"no-unreachable": true,
|
||||
"no-use-before-declare": true,
|
||||
"no-var-keyword": false,
|
||||
|
Loading…
Reference in New Issue
Block a user