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