diff --git a/public/app/core/components/form_dropdown/form_dropdown.ts b/public/app/core/components/form_dropdown/form_dropdown.ts index 4604e1d7838..134d47e3e53 100644 --- a/public/app/core/components/form_dropdown/form_dropdown.ts +++ b/public/app/core/components/form_dropdown/form_dropdown.ts @@ -2,7 +2,7 @@ import _ from 'lodash'; import coreModule from '../../core_module'; function typeaheadMatcher(item) { - var str = this.query; + let str = this.query; if (str === '') { return true; } diff --git a/public/app/core/components/grafana_app.ts b/public/app/core/components/grafana_app.ts index b715a20e28f..16666dea1b2 100644 --- a/public/app/core/components/grafana_app.ts +++ b/public/app/core/components/grafana_app.ts @@ -50,7 +50,7 @@ export class GrafanaCtrl { $rootScope.onAppEvent = function(name, callback, localScope) { const unbind = $rootScope.$on(name, callback); - var callerScope = this; + let callerScope = this; if (callerScope.$id === 1 && !localScope) { console.log('warning rootScope onAppEvent called without localscope'); } @@ -75,7 +75,7 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop restrict: 'E', controller: GrafanaCtrl, link: (scope, elem) => { - var sidemenuOpen; + let sidemenuOpen; const body = $('body'); // see https://github.com/zenorocha/clipboard.js/issues/155 @@ -108,7 +108,7 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop // tooltip removal fix // manage page classes - var pageClass; + let pageClass; scope.$on('$routeChangeSuccess', function(evt, data) { if (pageClass) { body.removeClass(pageClass); @@ -151,10 +151,10 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop }); // handle in active view state class - var lastActivity = new Date().getTime(); - var activeUser = true; + let lastActivity = new Date().getTime(); + let activeUser = true; const inActiveTimeLimit = 60 * 1000; - var sidemenuHidden = false; + let sidemenuHidden = false; function checkForInActiveUser() { if (!activeUser) { diff --git a/public/app/core/components/layout_selector/layout_selector.ts b/public/app/core/components/layout_selector/layout_selector.ts index a28abe19251..07f1c8628e9 100644 --- a/public/app/core/components/layout_selector/layout_selector.ts +++ b/public/app/core/components/layout_selector/layout_selector.ts @@ -52,7 +52,7 @@ export function layoutMode($rootScope) { scope: {}, link: function(scope, elem) { const layout = store.get('grafana.list.layout.mode') || 'grid'; - var className = 'card-list-layout-' + layout; + let className = 'card-list-layout-' + layout; elem.addClass(className); $rootScope.onAppEvent( diff --git a/public/app/core/components/query_part/query_part_editor.ts b/public/app/core/components/query_part/query_part_editor.ts index cab7907a9a2..ef6423b8812 100644 --- a/public/app/core/components/query_part/query_part_editor.ts +++ b/public/app/core/components/query_part/query_part_editor.ts @@ -91,7 +91,7 @@ export function queryPartEditorDirective($compile, templateSrv) { const typeaheadSource = function(query, callback) { if (param.options) { - var options = param.options; + let options = param.options; if (param.type === 'int') { options = _.map(options, function(val) { return val.toString(); diff --git a/public/app/core/filters/filters.ts b/public/app/core/filters/filters.ts index 098bda58de9..745873369c0 100644 --- a/public/app/core/filters/filters.ts +++ b/public/app/core/filters/filters.ts @@ -56,7 +56,7 @@ coreModule.filter('noXml', function() { /** @ngInject */ function interpolateTemplateVars(templateSrv) { const filterFunc: any = function(text, scope) { - var scopedVars; + let scopedVars; if (scope.ctrl) { scopedVars = (scope.ctrl.panel || scope.ctrl.row).scopedVars; } else { diff --git a/public/app/core/nav_model_srv.ts b/public/app/core/nav_model_srv.ts index 8985b2c489c..300a7f0e208 100644 --- a/public/app/core/nav_model_srv.ts +++ b/public/app/core/nav_model_srv.ts @@ -38,7 +38,7 @@ export class NavModelSrv { } getNav(...args) { - var children = this.navItems; + let children = this.navItems; const nav = new NavModel(); for (const id of args) { diff --git a/public/app/core/specs/datemath.test.ts b/public/app/core/specs/datemath.test.ts index cca6eb31593..8197f01c872 100644 --- a/public/app/core/specs/datemath.test.ts +++ b/public/app/core/specs/datemath.test.ts @@ -55,8 +55,8 @@ describe('DateMath', () => { }); describe('subtraction', () => { - var now; - var anchored; + let now; + let anchored; beforeEach(() => { clock = sinon.useFakeTimers(unix); @@ -83,7 +83,7 @@ describe('DateMath', () => { }); describe('rounding', () => { - var now; + let now; beforeEach(() => { clock = sinon.useFakeTimers(unix); diff --git a/public/app/core/specs/table_model.test.ts b/public/app/core/specs/table_model.test.ts index b88bad12227..990daaaa2da 100644 --- a/public/app/core/specs/table_model.test.ts +++ b/public/app/core/specs/table_model.test.ts @@ -26,7 +26,7 @@ describe('when sorting table desc', () => { }); describe('when sorting table asc', () => { - var table; + let table; const panel = { sort: { col: 1, desc: false }, }; @@ -46,8 +46,8 @@ describe('when sorting table asc', () => { }); describe('when sorting with nulls', () => { - var table; - var values; + let table; + let values; beforeEach(() => { table = new TableModel(); diff --git a/public/app/core/specs/time_series.test.ts b/public/app/core/specs/time_series.test.ts index 605c8fd0a2e..3c0fc42be65 100644 --- a/public/app/core/specs/time_series.test.ts +++ b/public/app/core/specs/time_series.test.ts @@ -174,7 +174,7 @@ describe('TimeSeries', function() { }); describe('can detect if series contains ms precision', function() { - var fakedata; + let fakedata; beforeEach(function() { fakedata = testData; @@ -194,7 +194,7 @@ describe('TimeSeries', function() { }); describe('series overrides', function() { - var series; + let series; beforeEach(function() { series = new TimeSeries(testData); }); @@ -313,7 +313,7 @@ describe('TimeSeries', function() { }); describe('value formatter', function() { - var series; + let series; beforeEach(function() { series = new TimeSeries(testData); }); diff --git a/public/app/core/utils/css_loader.ts b/public/app/core/utils/css_loader.ts index b8aaef47085..19dd84a6087 100644 --- a/public/app/core/utils/css_loader.ts +++ b/public/app/core/utils/css_loader.ts @@ -11,7 +11,7 @@ for (let i = 0; i < links.length; i++) { const isWebkit = !!window.navigator.userAgent.match(/AppleWebKit\/([^ ;]*)/); const webkitLoadCheck = function(link, callback) { setTimeout(function() { - for (var i = 0; i < document.styleSheets.length; i++) { + for (let i = 0; i < document.styleSheets.length; i++) { const sheet = document.styleSheets[i]; if (sheet.href === link.href) { return callback(); @@ -68,7 +68,7 @@ export function fetch(load): any { } // don't reload styles loaded in the head - for (var i = 0; i < linkHrefs.length; i++) { + for (let i = 0; i < linkHrefs.length; i++) { if (load.address === linkHrefs[i]) { return ''; } diff --git a/public/app/features/admin/admin_list_users_ctrl.ts b/public/app/features/admin/admin_list_users_ctrl.ts index 083340a43eb..1b5b27a4d66 100644 --- a/public/app/features/admin/admin_list_users_ctrl.ts +++ b/public/app/features/admin/admin_list_users_ctrl.ts @@ -26,7 +26,7 @@ export default class AdminListUsersCtrl { this.showPaging = this.totalPages > 1; this.pages = []; - for (var i = 1; i < this.totalPages + 1; i++) { + for (let i = 1; i < this.totalPages + 1; i++) { this.pages.push({ page: i, current: i === this.page }); } }); diff --git a/public/app/features/annotations/annotation_tooltip.ts b/public/app/features/annotations/annotation_tooltip.ts index cadbac1bd89..9d1147aba60 100644 --- a/public/app/features/annotations/annotation_tooltip.ts +++ b/public/app/features/annotations/annotation_tooltip.ts @@ -22,12 +22,12 @@ export function annotationTooltipDirective($sanitize, dashboardSrv, contextSrv, }, link: function(scope, element) { const event = scope.event; - var title = event.title; - var text = event.text; + let title = event.title; + let text = event.text; const dashboard = dashboardSrv.getCurrent(); - var tooltip = '