diff --git a/package.json b/package.json index 7af8ab502b7..013d41f5e11 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/public/app/features/dashboard/timepicker/timepicker.ts b/public/app/features/dashboard/timepicker/timepicker.ts index 8fb0427bba3..c8d319a12f2 100644 --- a/public/app/features/dashboard/timepicker/timepicker.ts +++ b/public/app/features/dashboard/timepicker/timepicker.ts @@ -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'; diff --git a/public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts b/public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts index 7c5c06839de..ed5f9418f8f 100644 --- a/public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts +++ b/public/app/plugins/datasource/cloudwatch/specs/datasource_specs.ts @@ -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; } }; }); diff --git a/public/app/plugins/datasource/elasticsearch/specs/elastic_response_specs.ts b/public/app/plugins/datasource/elasticsearch/specs/elastic_response_specs.ts index 3f3ebf745d2..c80fcb7169f 100644 --- a/public/app/plugins/datasource/elasticsearch/specs/elastic_response_specs.ts +++ b/public/app/plugins/datasource/elasticsearch/specs/elastic_response_specs.ts @@ -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: [] }]; diff --git a/public/app/plugins/datasource/graphite/specs/gfunc_specs.ts b/public/app/plugins/datasource/graphite/specs/gfunc_specs.ts index ab49979826c..4f8f00d901b 100644 --- a/public/app/plugins/datasource/graphite/specs/gfunc_specs.ts +++ b/public/app/plugins/datasource/graphite/specs/gfunc_specs.ts @@ -1,6 +1,5 @@ -/// -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() { diff --git a/public/app/plugins/datasource/influxdb/query_part.ts b/public/app/plugins/datasource/influxdb/query_part.ts index 3fc92c4e4d5..922440bd482 100644 --- a/public/app/plugins/datasource/influxdb/query_part.ts +++ b/public/app/plugins/datasource/influxdb/query_part.ts @@ -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; } diff --git a/public/app/plugins/panel/table/renderer.ts b/public/app/plugins/panel/table/renderer.ts index 9223d35dc5d..be73af06e64 100644 --- a/public/app/plugins/panel/table/renderer.ts +++ b/public/app/plugins/panel/table/renderer.ts @@ -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; } diff --git a/public/app/plugins/panel/table/transformers.ts b/public/app/plugins/panel/table/transformers.ts index 493fd354ba6..b1cc644790e 100644 --- a/public/app/plugins/panel/table/transformers.ts +++ b/public/app/plugins/panel/table/transformers.ts @@ -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]; } } diff --git a/tslint.json b/tslint.json index 8a8379e009f..fc50e412f46 100644 --- a/tslint.json +++ b/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,