diff --git a/src/server/config/__tests__/config.js b/src/server/config/__tests__/config.js index dbcc1a2e8d3f..7a48a7c61657 100644 --- a/src/server/config/__tests__/config.js +++ b/src/server/config/__tests__/config.js @@ -85,7 +85,7 @@ describe('lib/config/config', function () { describe('#resetTo(object)', function () { - var config; + let config; beforeEach(function () { config = new Config(schema); }); @@ -102,7 +102,7 @@ describe('lib/config/config', function () { describe('#has(key)', function () { - var config; + let config; beforeEach(function () { config = new Config(schema); }); @@ -122,7 +122,7 @@ describe('lib/config/config', function () { }); describe('#set(key, value)', function () { - var config; + let config; beforeEach(function () { config = new Config(schema); @@ -171,7 +171,7 @@ describe('lib/config/config', function () { describe('#get(key)', function () { - var config; + let config; beforeEach(function () { config = new Config(schema); @@ -210,7 +210,7 @@ describe('lib/config/config', function () { }); describe('#extendSchema(key, schema)', function () { - var config; + let config; beforeEach(function () { config = new Config(schema); }); diff --git a/src/server/config/flatten_with.js b/src/server/config/flatten_with.js index c58fd773c7cd..ac4a90713096 100644 --- a/src/server/config/flatten_with.js +++ b/src/server/config/flatten_with.js @@ -1,6 +1,6 @@ import _ from 'lodash'; module.exports = function (dot, nestedObj, flattenArrays) { - var key; // original key + let key; // original key var stack = []; // track key stack var flatObj = {}; (function flattenObj(obj) { diff --git a/src/server/status/__tests__/server_status.js b/src/server/status/__tests__/server_status.js index c1c4228bddfa..82fdeef1675e 100644 --- a/src/server/status/__tests__/server_status.js +++ b/src/server/status/__tests__/server_status.js @@ -7,8 +7,8 @@ import Status from '../status'; import ServerStatus from '../server_status'; describe('ServerStatus class', function () { - var server; - var serverStatus; + let server; + let serverStatus; beforeEach(function () { server = { expose: sinon.stub(), log: sinon.stub() }; diff --git a/src/server/status/__tests__/status.js b/src/server/status/__tests__/status.js index bb550820a0ad..7f41596db8e7 100644 --- a/src/server/status/__tests__/status.js +++ b/src/server/status/__tests__/status.js @@ -4,8 +4,8 @@ import Status from '../status'; import ServerStatus from '../server_status'; describe('Status class', function () { - var server; - var serverStatus; + let server; + let serverStatus; beforeEach(function () { server = { expose: sinon.stub(), log: sinon.stub() }; diff --git a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js index dffaa87e2b66..78fc73fdd6c2 100644 --- a/src/ui/public/agg_response/geo_json/__tests__/geo_json.js +++ b/src/ui/public/agg_response/geo_json/__tests__/geo_json.js @@ -9,11 +9,11 @@ import AggResponseTabifyTabifyProvider from 'ui/agg_response/tabify/tabify'; import AggResponseGeoJsonGeoJsonProvider from 'ui/agg_response/geo_json/geo_json'; describe('GeoJson Agg Response Converter', function () { - var vis; - var tabify; - var convert; - var esResponse; - var aggs; + let vis; + let tabify; + let convert; + let esResponse; + let aggs; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { @@ -108,10 +108,10 @@ describe('GeoJson Agg Response Converter', function () { describe('includes one feature per row in the table', function () { this.timeout(60000); - var table; - var chart; - var geoColI; - var metricColI; + let table; + let chart; + let geoColI; + let metricColI; before(function () { table = makeTable(); diff --git a/src/ui/public/agg_response/hierarchical/__tests__/array_to_linked_list.js b/src/ui/public/agg_response/hierarchical/__tests__/array_to_linked_list.js index c62f04b819cf..eeca8b79a6cd 100644 --- a/src/ui/public/agg_response/hierarchical/__tests__/array_to_linked_list.js +++ b/src/ui/public/agg_response/hierarchical/__tests__/array_to_linked_list.js @@ -4,7 +4,7 @@ import expect from 'expect.js'; describe('buildHierarchicalData()', function () { describe('arrayToLinkedList', function () { - var results; + let results; beforeEach(function () { results = arrayToLinkedList([ { id: 1 }, diff --git a/src/ui/public/agg_response/hierarchical/__tests__/build_hierarchical_data.js b/src/ui/public/agg_response/hierarchical/__tests__/build_hierarchical_data.js index 68e258ba1d06..1498d6eb67f6 100644 --- a/src/ui/public/agg_response/hierarchical/__tests__/build_hierarchical_data.js +++ b/src/ui/public/agg_response/hierarchical/__tests__/build_hierarchical_data.js @@ -9,11 +9,11 @@ import VisAggConfigsProvider from 'ui/vis/agg_configs'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; import AggResponseHierarchicalBuildHierarchicalDataProvider from 'ui/agg_response/hierarchical/build_hierarchical_data'; -var Vis; -var Notifier; -var AggConfigs; -var indexPattern; -var buildHierarchicalData; +let Vis; +let Notifier; +let AggConfigs; +let indexPattern; +let buildHierarchicalData; describe('buildHierarchicalData', function () { @@ -31,8 +31,8 @@ describe('buildHierarchicalData', function () { describe('metric only', function () { - var vis; - var results; + let vis; + let results; beforeEach(function () { var id = 1; @@ -103,8 +103,8 @@ describe('buildHierarchicalData', function () { }); describe('threeTermBuckets', function () { - var vis; - var results; + let vis; + let results; beforeEach(function () { var id = 1; @@ -145,8 +145,8 @@ describe('buildHierarchicalData', function () { }); describe('oneHistogramBucket', function () { - var vis; - var results; + let vis; + let results; beforeEach(function () { var id = 1; @@ -177,8 +177,8 @@ describe('buildHierarchicalData', function () { }); describe('oneRangeBucket', function () { - var vis; - var results; + let vis; + let results; beforeEach(function () { var id = 1; @@ -218,8 +218,8 @@ describe('buildHierarchicalData', function () { }); describe('oneFilterBucket', function () { - var vis; - var results; + let vis; + let results; beforeEach(function () { var id = 1; @@ -254,8 +254,8 @@ describe('buildHierarchicalData', function () { }); describe('oneFilterBucket that is a split', function () { - var vis; - var results; + let vis; + let results; beforeEach(function () { var id = 1; diff --git a/src/ui/public/agg_response/hierarchical/__tests__/collect_branch.js b/src/ui/public/agg_response/hierarchical/__tests__/collect_branch.js index bf3cf2ecfbef..d7dba5977d5c 100644 --- a/src/ui/public/agg_response/hierarchical/__tests__/collect_branch.js +++ b/src/ui/public/agg_response/hierarchical/__tests__/collect_branch.js @@ -3,7 +3,7 @@ import _ from 'lodash'; import collectBranch from 'ui/agg_response/hierarchical/_collect_branch'; import expect from 'expect.js'; describe('collectBranch()', function () { - var results; + let results; var convert = function (name) { return 'converted:' + name; }; diff --git a/src/ui/public/agg_response/hierarchical/__tests__/create_raw_data.js b/src/ui/public/agg_response/hierarchical/__tests__/create_raw_data.js index 2f89a7697bc9..9d05d2335e43 100644 --- a/src/ui/public/agg_response/hierarchical/__tests__/create_raw_data.js +++ b/src/ui/public/agg_response/hierarchical/__tests__/create_raw_data.js @@ -9,14 +9,14 @@ import VisProvider from 'ui/vis'; import VisAggConfigsProvider from 'ui/vis/agg_configs'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; -var AggConfigs; -var Vis; -var indexPattern; +let AggConfigs; +let Vis; +let indexPattern; describe('buildHierarchicalData()', function () { describe('createRawData()', function () { - var vis; - var results; + let vis; + let results; beforeEach(ngMock.module('kibana')); diff --git a/src/ui/public/agg_response/hierarchical/__tests__/transform_aggregation.js b/src/ui/public/agg_response/hierarchical/__tests__/transform_aggregation.js index b40f7a7de905..99afb3bb07f1 100644 --- a/src/ui/public/agg_response/hierarchical/__tests__/transform_aggregation.js +++ b/src/ui/public/agg_response/hierarchical/__tests__/transform_aggregation.js @@ -5,8 +5,8 @@ import AggResponseHierarchicalTransformAggregationProvider from 'ui/agg_response describe('buildHierarchicalData()', function () { describe('transformAggregation()', function () { - var transform; - var fixture; + let transform; + let fixture; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_response/hierarchical/_array_to_linked_list.js b/src/ui/public/agg_response/hierarchical/_array_to_linked_list.js index be26787b56b4..9a2d58f4ecb4 100644 --- a/src/ui/public/agg_response/hierarchical/_array_to_linked_list.js +++ b/src/ui/public/agg_response/hierarchical/_array_to_linked_list.js @@ -1,6 +1,6 @@ import _ from 'lodash'; export default function (buckets) { - var previous; + let previous; _.each(buckets, function (bucket) { if (previous) { bucket._previous = previous; diff --git a/src/ui/public/agg_response/hierarchical/_hierarchical_tooltip_formatter.js b/src/ui/public/agg_response/hierarchical/_hierarchical_tooltip_formatter.js index 7db92b680591..0d4c88554ae3 100644 --- a/src/ui/public/agg_response/hierarchical/_hierarchical_tooltip_formatter.js +++ b/src/ui/public/agg_response/hierarchical/_hierarchical_tooltip_formatter.js @@ -21,7 +21,7 @@ export default function HierarchicalTooltipFormaterProvider($rootScope, $compile _.forEachRight($tooltipScope.rows, function (row, i, rows) { row.spacer = $sce.trustAsHtml(_.repeat(' ', row.depth)); - var percent; + let percent; if (row.item.percentOfGroup != null) { percent = row.item.percentOfGroup; } diff --git a/src/ui/public/agg_response/point_series/__tests__/_add_to_siri.js b/src/ui/public/agg_response/point_series/__tests__/_add_to_siri.js index 483765e37e74..385f5e0a9304 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_add_to_siri.js +++ b/src/ui/public/agg_response/point_series/__tests__/_add_to_siri.js @@ -2,7 +2,7 @@ import expect from 'expect.js'; import ngMock from 'ng_mock'; import AggResponsePointSeriesAddToSiriProvider from 'ui/agg_response/point_series/_add_to_siri'; describe('addToSiri', function () { - var addToSiri; + let addToSiri; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_response/point_series/__tests__/_fake_x_aspect.js b/src/ui/public/agg_response/point_series/__tests__/_fake_x_aspect.js index 5447589c8178..8574fdf0af73 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_fake_x_aspect.js +++ b/src/ui/public/agg_response/point_series/__tests__/_fake_x_aspect.js @@ -6,11 +6,11 @@ import AggTypesAggTypeProvider from 'ui/agg_types/agg_type'; import AggResponsePointSeriesFakeXAspectProvider from 'ui/agg_response/point_series/_fake_x_aspect'; describe('makeFakeXAspect', function () { - var makeFakeXAspect; - var Vis; - var AggType; - var AggConfig; - var indexPattern; + let makeFakeXAspect; + let Vis; + let AggType; + let AggConfig; + let indexPattern; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_response/point_series/__tests__/_get_aspects.js b/src/ui/public/agg_response/point_series/__tests__/_get_aspects.js index 551484c84a79..efad784eacd9 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_get_aspects.js +++ b/src/ui/public/agg_response/point_series/__tests__/_get_aspects.js @@ -9,11 +9,11 @@ import AggResponsePointSeriesGetAspectsProvider from 'ui/agg_response/point_seri import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; describe('getAspects', function () { - var Vis; - var Table; - var AggConfig; - var indexPattern; - var getAspects; + let Vis; + let Table; + let AggConfig; + let indexPattern; + let getAspects; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { @@ -24,8 +24,8 @@ describe('getAspects', function () { indexPattern = Private(FixturesStubbedLogstashIndexPatternProvider); })); - var vis; - var table; + let vis; + let table; var date = _.memoize(function (n) { return moment().startOf('day').add(n, 'hour').valueOf(); diff --git a/src/ui/public/agg_response/point_series/__tests__/_get_point.js b/src/ui/public/agg_response/point_series/__tests__/_get_point.js index 173d68a8983e..6e77d96a695d 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_get_point.js +++ b/src/ui/public/agg_response/point_series/__tests__/_get_point.js @@ -5,7 +5,7 @@ import AggResponsePointSeriesGetPointProvider from 'ui/agg_response/point_series describe('getPoint', function () { - var getPoint; + let getPoint; var truthFormatted = { fieldFormatter: _.constant(_.constant(true)) }; var identFormatted = { fieldFormatter: _.constant(_.identity) }; @@ -16,10 +16,10 @@ describe('getPoint', function () { })); describe('Without series aspect', function () { - var seriesAspect; - var xAspect; - var yAspect; - var yScale; + let seriesAspect; + let xAspect; + let yAspect; + let yScale; beforeEach(function () { seriesAspect = null; @@ -49,10 +49,10 @@ describe('getPoint', function () { }); describe('With series aspect', function () { - var row; - var xAspect; - var yAspect; - var yScale; + let row; + let xAspect; + let yAspect; + let yScale; beforeEach(function () { row = [ { value: 1 }, { value: 2 }, { value: 3 }]; diff --git a/src/ui/public/agg_response/point_series/__tests__/_get_series.js b/src/ui/public/agg_response/point_series/__tests__/_get_series.js index ce2d4506e6a1..c36a00be9628 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_get_series.js +++ b/src/ui/public/agg_response/point_series/__tests__/_get_series.js @@ -3,7 +3,7 @@ import expect from 'expect.js'; import ngMock from 'ng_mock'; import AggResponsePointSeriesGetSeriesProvider from 'ui/agg_response/point_series/_get_series'; describe('getSeries', function () { - var getSeries; + let getSeries; var agg = { fieldFormatter: _.constant(_.identity) }; diff --git a/src/ui/public/agg_response/point_series/__tests__/_init_x_axis.js b/src/ui/public/agg_response/point_series/__tests__/_init_x_axis.js index 4a00b2b5beb6..2ca50fda6bff 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_init_x_axis.js +++ b/src/ui/public/agg_response/point_series/__tests__/_init_x_axis.js @@ -4,7 +4,7 @@ import ngMock from 'ng_mock'; import AggResponsePointSeriesInitXAxisProvider from 'ui/agg_response/point_series/_init_x_axis'; describe('initXAxis', function () { - var initXAxis; + let initXAxis; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_response/point_series/__tests__/_init_y_axis.js b/src/ui/public/agg_response/point_series/__tests__/_init_y_axis.js index 5c42090963b3..ffb5d7e8682c 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_init_y_axis.js +++ b/src/ui/public/agg_response/point_series/__tests__/_init_y_axis.js @@ -4,7 +4,7 @@ import ngMock from 'ng_mock'; import AggResponsePointSeriesInitYAxisProvider from 'ui/agg_response/point_series/_init_y_axis'; describe('initYAxis', function () { - var initYAxis; + let initYAxis; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_response/point_series/__tests__/_main.js b/src/ui/public/agg_response/point_series/__tests__/_main.js index 9563f397e27d..579d434f2212 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_main.js +++ b/src/ui/public/agg_response/point_series/__tests__/_main.js @@ -11,10 +11,10 @@ describe('pointSeriesChartDataFromTable', function () { this.slow(1000); - var pointSeriesChartDataFromTable; - var indexPattern; - var Table; - var Vis; + let pointSeriesChartDataFromTable; + let indexPattern; + let Table; + let Vis; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_response/point_series/__tests__/_ordered_date_axis.js b/src/ui/public/agg_response/point_series/__tests__/_ordered_date_axis.js index 8becee118e43..f0c5bd3aabd1 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_ordered_date_axis.js +++ b/src/ui/public/agg_response/point_series/__tests__/_ordered_date_axis.js @@ -28,7 +28,7 @@ describe('orderedDateAxis', function () { } }; - var orderedDateAxis; + let orderedDateAxis; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_response/point_series/__tests__/_tooltip_formatter.js b/src/ui/public/agg_response/point_series/__tests__/_tooltip_formatter.js index 16ccb6eb78b0..6468fdd72047 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_tooltip_formatter.js +++ b/src/ui/public/agg_response/point_series/__tests__/_tooltip_formatter.js @@ -5,7 +5,7 @@ import ngMock from 'ng_mock'; import AggResponsePointSeriesTooltipFormatterProvider from 'ui/agg_response/point_series/_tooltip_formatter'; describe('tooltipFormatter', function () { - var tooltipFormatter; + let tooltipFormatter; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_response/point_series/_get_series.js b/src/ui/public/agg_response/point_series/_get_series.js index ca79b74afacb..7c05f844a643 100644 --- a/src/ui/public/agg_response/point_series/_get_series.js +++ b/src/ui/public/agg_response/point_series/_get_series.js @@ -37,7 +37,7 @@ export default function PointSeriesGetSeries(Private) { if (multiY) { series = _.sortBy(series, function (siri) { var firstVal = siri.values[0]; - var y; + let y; if (firstVal) { var agg = firstVal.aggConfigResult.aggConfig; diff --git a/src/ui/public/agg_response/tabify/__tests__/_buckets.js b/src/ui/public/agg_response/tabify/__tests__/_buckets.js index 6b2747ebf93b..56c321d6de1b 100644 --- a/src/ui/public/agg_response/tabify/__tests__/_buckets.js +++ b/src/ui/public/agg_response/tabify/__tests__/_buckets.js @@ -2,7 +2,7 @@ import expect from 'expect.js'; import ngMock from 'ng_mock'; import AggResponseTabifyBucketsProvider from 'ui/agg_response/tabify/_buckets'; describe('Buckets wrapper', function () { - var Buckets; + let Buckets; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, $injector) { diff --git a/src/ui/public/agg_response/tabify/__tests__/_get_columns.js b/src/ui/public/agg_response/tabify/__tests__/_get_columns.js index a542c35b1470..c9c844a683b5 100644 --- a/src/ui/public/agg_response/tabify/__tests__/_get_columns.js +++ b/src/ui/public/agg_response/tabify/__tests__/_get_columns.js @@ -4,9 +4,9 @@ import AggResponseTabifyGetColumnsProvider from 'ui/agg_response/tabify/_get_col import VisProvider from 'ui/vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; describe('get columns', function () { - var getColumns; - var Vis; - var indexPattern; + let getColumns; + let Vis; + let indexPattern; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, $injector) { diff --git a/src/ui/public/agg_response/tabify/__tests__/_integration.js b/src/ui/public/agg_response/tabify/__tests__/_integration.js index b8c4816c06e5..3b0ec6737738 100644 --- a/src/ui/public/agg_response/tabify/__tests__/_integration.js +++ b/src/ui/public/agg_response/tabify/__tests__/_integration.js @@ -7,10 +7,10 @@ import VisProvider from 'ui/vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; describe('tabifyAggResponse Integration', function () { - var Vis; - var Buckets; - var indexPattern; - var tabifyAggResponse; + let Vis; + let Buckets; + let indexPattern; + let tabifyAggResponse; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, $injector) { @@ -46,12 +46,12 @@ describe('tabifyAggResponse Integration', function () { describe('transforms a complex response', function () { this.slow(1000); - var vis; - var avg; - var ext; - var src; - var os; - var esResp; + let vis; + let avg; + let ext; + let src; + let os; + let esResp; beforeEach(function () { vis = new Vis(indexPattern, { diff --git a/src/ui/public/agg_response/tabify/__tests__/_response_writer.js b/src/ui/public/agg_response/tabify/__tests__/_response_writer.js index e613da98ee55..608731f263c9 100644 --- a/src/ui/public/agg_response/tabify/__tests__/_response_writer.js +++ b/src/ui/public/agg_response/tabify/__tests__/_response_writer.js @@ -10,14 +10,14 @@ import VisProvider from 'ui/vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; describe('ResponseWriter class', function () { - var Vis; - var Table; - var Buckets; - var Private; - var TableGroup; - var getColumns; - var indexPattern; - var ResponseWriter; + let Vis; + let Table; + let Buckets; + let Private; + let TableGroup; + let getColumns; + let indexPattern; + let ResponseWriter; function defineSetup(stubGetColumns) { beforeEach(ngMock.module('kibana')); diff --git a/src/ui/public/agg_response/tabify/__tests__/_table.js b/src/ui/public/agg_response/tabify/__tests__/_table.js index c3f9aa9f734f..2f0c0f0077f2 100644 --- a/src/ui/public/agg_response/tabify/__tests__/_table.js +++ b/src/ui/public/agg_response/tabify/__tests__/_table.js @@ -4,7 +4,7 @@ import ngMock from 'ng_mock'; import AggResponseTabifyTableProvider from 'ui/agg_response/tabify/_table'; describe('Table class', function () { - var Table; + let Table; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, $injector) { diff --git a/src/ui/public/agg_response/tabify/__tests__/_table_group.js b/src/ui/public/agg_response/tabify/__tests__/_table_group.js index 5c4cd7f51586..08d837290701 100644 --- a/src/ui/public/agg_response/tabify/__tests__/_table_group.js +++ b/src/ui/public/agg_response/tabify/__tests__/_table_group.js @@ -2,7 +2,7 @@ import expect from 'expect.js'; import ngMock from 'ng_mock'; import AggResponseTabifyTableGroupProvider from 'ui/agg_response/tabify/_table_group'; describe('Table Group class', function () { - var TableGroup; + let TableGroup; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, $injector) { diff --git a/src/ui/public/agg_table/__tests__/_group.js b/src/ui/public/agg_table/__tests__/_group.js index 1c36a062c785..1c692da468b1 100644 --- a/src/ui/public/agg_table/__tests__/_group.js +++ b/src/ui/public/agg_table/__tests__/_group.js @@ -8,11 +8,11 @@ import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logsta import VisProvider from 'ui/vis'; describe('AggTableGroup Directive', function () { - var $rootScope; - var $compile; - var tabifyAggResponse; - var Vis; - var indexPattern; + let $rootScope; + let $compile; + let tabifyAggResponse; + let Vis; + let indexPattern; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function ($injector, Private) { @@ -24,7 +24,7 @@ describe('AggTableGroup Directive', function () { $compile = $injector.get('$compile'); })); - var $scope; + let $scope; beforeEach(function () { $scope = $rootScope.$new(); }); diff --git a/src/ui/public/agg_table/__tests__/_table.js b/src/ui/public/agg_table/__tests__/_table.js index b3519a8cb642..8eadb01c5f12 100644 --- a/src/ui/public/agg_table/__tests__/_table.js +++ b/src/ui/public/agg_table/__tests__/_table.js @@ -9,11 +9,11 @@ import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logsta import VisProvider from 'ui/vis'; describe('AggTable Directive', function () { - var $rootScope; - var $compile; - var tabifyAggResponse; - var Vis; - var indexPattern; + let $rootScope; + let $compile; + let tabifyAggResponse; + let Vis; + let indexPattern; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function ($injector, Private) { @@ -25,7 +25,7 @@ describe('AggTable Directive', function () { $compile = $injector.get('$compile'); })); - var $scope; + let $scope; beforeEach(function () { $scope = $rootScope.$new(); }); @@ -134,7 +134,7 @@ describe('AggTable Directive', function () { }); describe('aggTable.exportAsCsv()', function () { - var origBlob; + let origBlob; function FakeBlob(slices, opts) { this.slices = slices; this.opts = opts; diff --git a/src/ui/public/agg_types/__tests__/agg_params.js b/src/ui/public/agg_types/__tests__/agg_params.js index 0fca03b0dda3..4b2719ae3d28 100644 --- a/src/ui/public/agg_types/__tests__/agg_params.js +++ b/src/ui/public/agg_types/__tests__/agg_params.js @@ -8,11 +8,11 @@ import AggTypesParamTypesOptionedProvider from 'ui/agg_types/param_types/optione import AggTypesParamTypesRegexProvider from 'ui/agg_types/param_types/regex'; describe('AggParams class', function () { - var AggParams; - var BaseAggParam; - var FieldAggParam; - var OptionedAggParam; - var RegexAggParam; + let AggParams; + let BaseAggParam; + let FieldAggParam; + let OptionedAggParam; + let RegexAggParam; beforeEach(ngMock.module('kibana')); // stub out the param classes before we get the AggParams diff --git a/src/ui/public/agg_types/__tests__/agg_type.js b/src/ui/public/agg_types/__tests__/agg_type.js index ab8b774cc57d..10dd716ab3b5 100644 --- a/src/ui/public/agg_types/__tests__/agg_type.js +++ b/src/ui/public/agg_types/__tests__/agg_type.js @@ -10,12 +10,12 @@ import AggTypesAggTypeProvider from 'ui/agg_types/agg_type'; import VisAggConfigProvider from 'ui/vis/agg_config'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; describe('AggType Class', function () { - var AggType; - var AggParams; - var AggConfig; - var indexPattern; - var fieldFormat; - var Vis; + let AggType; + let AggParams; + let AggConfig; + let indexPattern; + let fieldFormat; + let Vis; beforeEach(ngMock.module('kibana')); diff --git a/src/ui/public/agg_types/__tests__/bucket_count_between.js b/src/ui/public/agg_types/__tests__/bucket_count_between.js index 34b62e6a98f7..b1da84a139a5 100644 --- a/src/ui/public/agg_types/__tests__/bucket_count_between.js +++ b/src/ui/public/agg_types/__tests__/bucket_count_between.js @@ -8,12 +8,12 @@ import AggTypesIndexProvider from 'ui/agg_types/index'; import VisAggConfigProvider from 'ui/vis/agg_config'; import AggTypesBucketsBucketCountBetweenProvider from 'ui/agg_types/buckets/_bucket_count_between'; describe('bucketCountBetween util', function () { - var indexPattern; - var Vis; - var visTypes; - var aggTypes; - var AggConfig; - var bucketCountBetween; + let indexPattern; + let Vis; + let visTypes; + let aggTypes; + let AggConfig; + let bucketCountBetween; // http://cwestblog.com/2014/02/25/javascript-testing-for-negative-zero/ // works for -0 and +0 diff --git a/src/ui/public/agg_types/__tests__/buckets/_histogram.js b/src/ui/public/agg_types/__tests__/buckets/_histogram.js index 8127a5eb0221..e293c71aa263 100644 --- a/src/ui/public/agg_types/__tests__/buckets/_histogram.js +++ b/src/ui/public/agg_types/__tests__/buckets/_histogram.js @@ -6,7 +6,7 @@ import AggParamWriterProvider from '../agg_param_writer'; describe('Histogram Agg', function () { describe('ordered', function () { - var histogram; + let histogram; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { @@ -24,7 +24,7 @@ describe('Histogram Agg', function () { describe('params', function () { - var paramWriter; + let paramWriter; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/buckets/_range.js b/src/ui/public/agg_types/__tests__/buckets/_range.js index 5c85afeb0d90..3c18eb806060 100644 --- a/src/ui/public/agg_types/__tests__/buckets/_range.js +++ b/src/ui/public/agg_types/__tests__/buckets/_range.js @@ -11,9 +11,9 @@ describe('Range Agg', function () { var buckets = values(resp.aggregations[1].buckets); - var range; - var Vis; - var indexPattern; + let range; + let Vis; + let indexPattern; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/buckets/create_filter/date_histogram.js b/src/ui/public/agg_types/__tests__/buckets/create_filter/date_histogram.js index 3392cb413dbb..86c5fbc7e43f 100644 --- a/src/ui/public/agg_types/__tests__/buckets/create_filter/date_histogram.js +++ b/src/ui/public/agg_types/__tests__/buckets/create_filter/date_histogram.js @@ -12,16 +12,16 @@ import AggTypesBucketsIntervalOptionsProvider from 'ui/agg_types/buckets/_interv describe('AggConfig Filters', function () { describe('date_histogram', function () { - var vis; - var agg; - var field; - var filter; - var bucketKey; - var bucketStart; - var getIntervalStub; - var intervalOptions; + let vis; + let agg; + let field; + let filter; + let bucketKey; + let bucketStart; + let getIntervalStub; + let intervalOptions; - var init; + let init; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, $injector) { @@ -84,7 +84,7 @@ describe('AggConfig Filters', function () { it('extends the filter edge to 1ms before the next bucket for all interval options', function () { intervalOptions.forEach(function (option) { - var duration; + let duration; if (option.val !== 'custom' && moment(1, option.val).isValid()) { duration = moment.duration(10, option.val); diff --git a/src/ui/public/agg_types/__tests__/buckets/create_filter/date_range.js b/src/ui/public/agg_types/__tests__/buckets/create_filter/date_range.js index 5fe8ef92b2b6..140231aeaeab 100644 --- a/src/ui/public/agg_types/__tests__/buckets/create_filter/date_range.js +++ b/src/ui/public/agg_types/__tests__/buckets/create_filter/date_range.js @@ -9,10 +9,10 @@ import AggTypesBucketsCreateFilterDateRangeProvider from 'ui/agg_types/buckets/c describe('AggConfig Filters', function () { describe('Date range', function () { - var AggConfig; - var indexPattern; - var Vis; - var createFilter; + let AggConfig; + let indexPattern; + let Vis; + let createFilter; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/buckets/create_filter/filters.js b/src/ui/public/agg_types/__tests__/buckets/create_filter/filters.js index 6f63705a97d3..8bb6e5a3b64c 100644 --- a/src/ui/public/agg_types/__tests__/buckets/create_filter/filters.js +++ b/src/ui/public/agg_types/__tests__/buckets/create_filter/filters.js @@ -9,10 +9,10 @@ import AggTypesBucketsCreateFilterFiltersProvider from 'ui/agg_types/buckets/cre describe('AggConfig Filters', function () { describe('filters', function () { - var AggConfig; - var indexPattern; - var Vis; - var createFilter; + let AggConfig; + let indexPattern; + let Vis; + let createFilter; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/buckets/create_filter/histogram.js b/src/ui/public/agg_types/__tests__/buckets/create_filter/histogram.js index e807bd8a7e19..094acc337dfc 100644 --- a/src/ui/public/agg_types/__tests__/buckets/create_filter/histogram.js +++ b/src/ui/public/agg_types/__tests__/buckets/create_filter/histogram.js @@ -9,10 +9,10 @@ import AggTypesBucketsCreateFilterHistogramProvider from 'ui/agg_types/buckets/c describe('AggConfig Filters', function () { describe('histogram', function () { - var AggConfig; - var indexPattern; - var Vis; - var createFilter; + let AggConfig; + let indexPattern; + let Vis; + let createFilter; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/buckets/create_filter/ip_range.js b/src/ui/public/agg_types/__tests__/buckets/create_filter/ip_range.js index 6984e0725b7e..93157becdd0e 100644 --- a/src/ui/public/agg_types/__tests__/buckets/create_filter/ip_range.js +++ b/src/ui/public/agg_types/__tests__/buckets/create_filter/ip_range.js @@ -7,10 +7,10 @@ import AggTypesBucketsCreateFilterIpRangeProvider from 'ui/agg_types/buckets/cre describe('AggConfig Filters', function () { describe('IP range', function () { - var AggConfig; - var indexPattern; - var Vis; - var createFilter; + let AggConfig; + let indexPattern; + let Vis; + let createFilter; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/buckets/create_filter/range.js b/src/ui/public/agg_types/__tests__/buckets/create_filter/range.js index 841996b13756..c4ecfdba6f04 100644 --- a/src/ui/public/agg_types/__tests__/buckets/create_filter/range.js +++ b/src/ui/public/agg_types/__tests__/buckets/create_filter/range.js @@ -7,10 +7,10 @@ import AggTypesBucketsCreateFilterRangeProvider from 'ui/agg_types/buckets/creat describe('AggConfig Filters', function () { describe('range', function () { - var AggConfig; - var indexPattern; - var Vis; - var createFilter; + let AggConfig; + let indexPattern; + let Vis; + let createFilter; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/buckets/create_filter/terms.js b/src/ui/public/agg_types/__tests__/buckets/create_filter/terms.js index f5a27342d546..ea99720afb89 100644 --- a/src/ui/public/agg_types/__tests__/buckets/create_filter/terms.js +++ b/src/ui/public/agg_types/__tests__/buckets/create_filter/terms.js @@ -7,10 +7,10 @@ import AggTypesBucketsCreateFilterTermsProvider from 'ui/agg_types/buckets/creat describe('AggConfig Filters', function () { describe('terms', function () { - var AggConfig; - var indexPattern; - var Vis; - var createFilter; + let AggConfig; + let indexPattern; + let Vis; + let createFilter; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js b/src/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js index 5261b02e9ebd..bf2c048ee683 100644 --- a/src/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js +++ b/src/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js @@ -7,11 +7,11 @@ import VisProvider from 'ui/vis'; import AggTypesBucketsIntervalOptionsProvider from 'ui/agg_types/buckets/_interval_options'; describe('editor', function () { - var indexPattern; - var vis; - var agg; - var render; - var $scope; + let indexPattern; + let vis; + let agg; + let render; + let $scope; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, $injector, $compile) { @@ -69,9 +69,9 @@ describe('editor', function () { })); describe('random field/interval', function () { - var params; - var field; - var interval; + let params; + let field; + let interval; beforeEach(ngMock.inject(function (Private) { field = _.sample(indexPattern.fields); @@ -97,7 +97,7 @@ describe('editor', function () { }); describe('interval "auto" and indexPattern timeField', function () { - var params; + let params; beforeEach(function () { params = render({ field: indexPattern.timeFieldName, interval: 'auto' }); diff --git a/src/ui/public/agg_types/__tests__/buckets/date_histogram/_params.js b/src/ui/public/agg_types/__tests__/buckets/date_histogram/_params.js index ae870c5f3c06..8ea6e756df3e 100644 --- a/src/ui/public/agg_types/__tests__/buckets/date_histogram/_params.js +++ b/src/ui/public/agg_types/__tests__/buckets/date_histogram/_params.js @@ -8,13 +8,13 @@ import AggTypesIndexProvider from 'ui/agg_types/index'; import VisAggConfigProvider from 'ui/vis/agg_config'; describe('params', function () { - var paramWriter; - var writeInterval; + let paramWriter; + let writeInterval; - var aggTypes; - var AggConfig; - var setTimeBounds; - var timeField; + let aggTypes; + let AggConfig; + let setTimeBounds; + let timeField; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private, $injector) { diff --git a/src/ui/public/agg_types/__tests__/controls/number_list.js b/src/ui/public/agg_types/__tests__/controls/number_list.js index c73649b67937..509987165249 100644 --- a/src/ui/public/agg_types/__tests__/controls/number_list.js +++ b/src/ui/public/agg_types/__tests__/controls/number_list.js @@ -7,9 +7,9 @@ import 'ui/number_list'; describe('NumberList directive', function () { - var $el; - var $scope; - var compile; + let $el; + let $scope; + let compile; function onlyValidValues() { return $el.find('[ng-model]').toArray().map(function (el) { diff --git a/src/ui/public/agg_types/__tests__/index.js b/src/ui/public/agg_types/__tests__/index.js index 8ceb3c95e9f9..b68dcfc87e28 100644 --- a/src/ui/public/agg_types/__tests__/index.js +++ b/src/ui/public/agg_types/__tests__/index.js @@ -12,8 +12,8 @@ import AggTypesMetricsMetricAggTypeProvider from 'ui/agg_types/metrics/metric_ag describe('AggTypesComponent', function () { describe('bucket aggs', function () { - var bucketAggs; - var BucketAggType; + let bucketAggs; + let BucketAggType; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { @@ -29,8 +29,8 @@ describe('AggTypesComponent', function () { }); describe('metric aggs', function () { - var metricAggs; - var MetricAggType; + let metricAggs; + let MetricAggType; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/param_types/_calculate_interval.js b/src/ui/public/agg_types/__tests__/param_types/_calculate_interval.js index b0eb534a961f..a5b6f033e0b7 100644 --- a/src/ui/public/agg_types/__tests__/param_types/_calculate_interval.js +++ b/src/ui/public/agg_types/__tests__/param_types/_calculate_interval.js @@ -7,11 +7,11 @@ import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logsta import AggTypesParamTypesCalculateIntervalProvider from 'ui/agg_types/param_types/_calculate_interval'; describe('calculateInterval()', function () { - var AggConfig; - var indexPattern; - var Vis; - var createFilter; - var calculateInterval; + let AggConfig; + let indexPattern; + let Vis; + let createFilter; + let calculateInterval; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/agg_types/__tests__/param_types/_field.js b/src/ui/public/agg_types/__tests__/param_types/_field.js index 019d336d8d9b..b4a336957b08 100644 --- a/src/ui/public/agg_types/__tests__/param_types/_field.js +++ b/src/ui/public/agg_types/__tests__/param_types/_field.js @@ -5,8 +5,8 @@ import AggTypesParamTypesBaseProvider from 'ui/agg_types/param_types/base'; import AggTypesParamTypesFieldProvider from 'ui/agg_types/param_types/field'; describe('Field', function () { - var BaseAggParam; - var FieldAggParam; + let BaseAggParam; + let FieldAggParam; beforeEach(ngMock.module('kibana')); // fetch out deps diff --git a/src/ui/public/agg_types/__tests__/param_types/_optioned.js b/src/ui/public/agg_types/__tests__/param_types/_optioned.js index d4d6c7e711a2..14cd247b44b7 100644 --- a/src/ui/public/agg_types/__tests__/param_types/_optioned.js +++ b/src/ui/public/agg_types/__tests__/param_types/_optioned.js @@ -5,8 +5,8 @@ import AggTypesParamTypesBaseProvider from 'ui/agg_types/param_types/base'; import AggTypesParamTypesOptionedProvider from 'ui/agg_types/param_types/optioned'; describe('Optioned', function () { - var BaseAggParam; - var OptionedAggParam; + let BaseAggParam; + let OptionedAggParam; beforeEach(ngMock.module('kibana')); // fetch out deps diff --git a/src/ui/public/agg_types/__tests__/param_types/_raw_json.js b/src/ui/public/agg_types/__tests__/param_types/_raw_json.js index fbfb6a61d949..ee9b995ac04c 100644 --- a/src/ui/public/agg_types/__tests__/param_types/_raw_json.js +++ b/src/ui/public/agg_types/__tests__/param_types/_raw_json.js @@ -7,11 +7,11 @@ import AggTypesParamTypesRawJsonProvider from 'ui/agg_types/param_types/raw_json module.exports = describe('JSON', function () { var paramName = 'json_test'; - var BaseAggParam; - var JsonAggParam; - var aggParam; - var aggConfig; - var output; + let BaseAggParam; + let JsonAggParam; + let aggParam; + let aggConfig; + let output; function initAggParam(config) { config = config || {}; diff --git a/src/ui/public/agg_types/__tests__/param_types/_regex.js b/src/ui/public/agg_types/__tests__/param_types/_regex.js index 5aea856e7484..87f21d2b7d19 100644 --- a/src/ui/public/agg_types/__tests__/param_types/_regex.js +++ b/src/ui/public/agg_types/__tests__/param_types/_regex.js @@ -7,10 +7,10 @@ import VisProvider from 'ui/vis'; import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; describe('Regex', function () { - var BaseAggParam; - var RegexAggParam; - var Vis; - var indexPattern; + let BaseAggParam; + let RegexAggParam; + let Vis; + let indexPattern; beforeEach(ngMock.module('kibana')); // fetch out deps @@ -34,8 +34,8 @@ describe('Regex', function () { }); describe('write results', function () { - var aggParam; - var aggConfig; + let aggParam; + let aggConfig; var output = { params: {} }; var paramName = 'exclude'; diff --git a/src/ui/public/agg_types/__tests__/param_types/_string.js b/src/ui/public/agg_types/__tests__/param_types/_string.js index f6d8629ca72e..0b5c5fcf23f0 100644 --- a/src/ui/public/agg_types/__tests__/param_types/_string.js +++ b/src/ui/public/agg_types/__tests__/param_types/_string.js @@ -6,11 +6,11 @@ import AggTypesParamTypesStringProvider from 'ui/agg_types/param_types/string'; module.exports = describe('String', function () { var paramName = 'json_test'; - var BaseAggParam; - var StringAggParam; - var aggParam; - var aggConfig; - var output; + let BaseAggParam; + let StringAggParam; + let aggParam; + let aggConfig; + let output; function initAggParam(config) { config = config || {}; diff --git a/src/ui/public/agg_types/buckets/create_filter/ip_range.js b/src/ui/public/agg_types/buckets/create_filter/ip_range.js index d71e36bf09a9..490f67b320e0 100644 --- a/src/ui/public/agg_types/buckets/create_filter/ip_range.js +++ b/src/ui/public/agg_types/buckets/create_filter/ip_range.js @@ -2,7 +2,7 @@ import CidrMask from 'ui/utils/cidr_mask'; import buildRangeFilter from 'ui/filter_manager/lib/range'; export default function createIpRangeFilterProvider() { return function (aggConfig, key) { - var range; + let range; if (aggConfig.params.ipRangeType === 'mask') { range = new CidrMask(key).getRange(); } else { diff --git a/src/ui/public/agg_types/buckets/date_histogram.js b/src/ui/public/agg_types/buckets/date_histogram.js index 485ce7e664d0..89cfa6fe33fc 100644 --- a/src/ui/public/agg_types/buckets/date_histogram.js +++ b/src/ui/public/agg_types/buckets/date_histogram.js @@ -45,7 +45,7 @@ export default function DateHistogramAggType(timefilter, config, Private) { }, createFilter: createFilter, decorateAggConfig: function () { - var buckets; + let buckets; return { buckets: { configurable: true, diff --git a/src/ui/public/agg_types/param_types/raw_json.js b/src/ui/public/agg_types/param_types/raw_json.js index 7e11b255ee4b..8cc22af5cdce 100644 --- a/src/ui/public/agg_types/param_types/raw_json.js +++ b/src/ui/public/agg_types/param_types/raw_json.js @@ -25,7 +25,7 @@ export default function RawJSONAggParamFactory(Private) { * @return {undefined} */ RawJSONAggParam.prototype.write = function (aggConfig, output) { - var paramJSON; + let paramJSON; var param = aggConfig.params[this.name]; if (!param) { diff --git a/src/ui/public/bind/__tests__/bind.js b/src/ui/public/bind/__tests__/bind.js index 3b02918a30cd..a0c6b15eeaef 100644 --- a/src/ui/public/bind/__tests__/bind.js +++ b/src/ui/public/bind/__tests__/bind.js @@ -3,8 +3,8 @@ import expect from 'expect.js'; import ngMock from 'ng_mock'; describe('$scope.$bind', function () { - var $rootScope; - var $scope; + let $rootScope; + let $scope; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function ($injector) { diff --git a/src/ui/public/binder/__tests__/binder.js b/src/ui/public/binder/__tests__/binder.js index 6bd2a3406de9..f879ea3b6960 100644 --- a/src/ui/public/binder/__tests__/binder.js +++ b/src/ui/public/binder/__tests__/binder.js @@ -6,7 +6,7 @@ import Binder from 'ui/binder'; import $ from 'jquery'; describe('Binder class', function () { - var $scope; + let $scope; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function ($rootScope) { diff --git a/src/ui/public/chrome/directives/app_switcher/__tests__/app_switcher.js b/src/ui/public/chrome/directives/app_switcher/__tests__/app_switcher.js index d09f9aaf909d..5420c8881c8f 100644 --- a/src/ui/public/chrome/directives/app_switcher/__tests__/app_switcher.js +++ b/src/ui/public/chrome/directives/app_switcher/__tests__/app_switcher.js @@ -12,7 +12,7 @@ import 'ui/chrome'; import '../app_switcher'; describe('appSwitcher directive', function () { - var env; + let env; beforeEach(ngMock.module('kibana')); diff --git a/src/ui/public/compile_recursive_directive.js b/src/ui/public/compile_recursive_directive.js index 4d5506ad5fcf..e02801e6c6b4 100644 --- a/src/ui/public/compile_recursive_directive.js +++ b/src/ui/public/compile_recursive_directive.js @@ -26,7 +26,7 @@ uiModules // Break the recursion loop by removing the contents var contents = element.contents().remove(); - var compiledContents; + let compiledContents; return { pre: (link && link.pre) ? link.pre : null, /** diff --git a/src/ui/public/config/__tests__/config.js b/src/ui/public/config/__tests__/config.js index 29c88060788d..f4cf07d86741 100644 --- a/src/ui/public/config/__tests__/config.js +++ b/src/ui/public/config/__tests__/config.js @@ -2,9 +2,9 @@ import expect from 'expect.js'; import ngMock from 'ng_mock'; import ConfigDefaultsProvider from 'ui/config/defaults'; describe('config component', function () { - var $scope; - var config; - var defaults; + let $scope; + let config; + let defaults; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function ($injector, Private) { diff --git a/src/ui/public/config/_delayed_updater.js b/src/ui/public/config/_delayed_updater.js index 76cdb67e16e1..7997120e3373 100644 --- a/src/ui/public/config/_delayed_updater.js +++ b/src/ui/public/config/_delayed_updater.js @@ -12,7 +12,7 @@ export default function DelayedUpdaterFactory(Private, $rootScope, Promise) { var updater = this; var queue = []; var log = {}; - var timer; + let timer; updater.fire = function () { clearTimeout(timer); @@ -21,8 +21,8 @@ export default function DelayedUpdaterFactory(Private, $rootScope, Promise) { if (updater.fired) return; updater.fired = true; - var method; - var body; + let method; + let body; var updated = []; var deleted = []; diff --git a/src/ui/public/config/config.js b/src/ui/public/config/config.js index 8bb289a0aae7..9291de9e0fc2 100644 --- a/src/ui/public/config/config.js +++ b/src/ui/public/config/config.js @@ -28,7 +28,7 @@ module.service('config', function (Private, kbnVersion, kbnIndex, $rootScope, bu // active or previous instance of DelayedUpdater. This will log and then process an // update once it is requested by calling #set() or #clear(). - var updater; + let updater; var DocSource = Private(DocSourceProvider); var doc = (new DocSource()) @@ -82,7 +82,7 @@ module.service('config', function (Private, kbnVersion, kbnIndex, $rootScope, bu }); config.get = function (key, defaultVal) { - var keyVal; + let keyVal; if (vals[key] == null) { if (defaultVal == null) { diff --git a/src/ui/public/courier/data_source/__tests__/decorate_query.js b/src/ui/public/courier/data_source/__tests__/decorate_query.js index 64b2f7b9b146..c8ff6b846091 100644 --- a/src/ui/public/courier/data_source/__tests__/decorate_query.js +++ b/src/ui/public/courier/data_source/__tests__/decorate_query.js @@ -6,13 +6,13 @@ import DecorateQueryProvider from 'ui/courier/data_source/_decorate_query'; describe('Query decorator', function () { - var config; + let config; - var indexPattern; + let indexPattern; - var getComputedFields; + let getComputedFields; - var fn; + let fn; beforeEach(ngMock.module( 'kibana', function ($provide) { diff --git a/src/ui/public/courier/data_source/__tests__/normalize_sort_request.js b/src/ui/public/courier/data_source/__tests__/normalize_sort_request.js index b891b986ce56..4b11ad8e3e4f 100644 --- a/src/ui/public/courier/data_source/__tests__/normalize_sort_request.js +++ b/src/ui/public/courier/data_source/__tests__/normalize_sort_request.js @@ -5,9 +5,9 @@ import NormalizeSortRequestProvider from 'ui/courier/data_source/_normalize_sort import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; describe('SearchSource#normalizeSortRequest', function () { - var normalizeSortRequest; - var indexPattern; - var normalizedSort; + let normalizeSortRequest; + let indexPattern; + let normalizedSort; beforeEach(ngMock.module('kibana')); beforeEach(ngMock.inject(function (Private) { diff --git a/src/ui/public/courier/data_source/_doc_send_to_es.js b/src/ui/public/courier/data_source/_doc_send_to_es.js index 97a2ce64004e..ac2aea1e9c4c 100644 --- a/src/ui/public/courier/data_source/_doc_send_to_es.js +++ b/src/ui/public/courier/data_source/_doc_send_to_es.js @@ -33,7 +33,7 @@ export default function (Promise, Private, es) { doc._storeVersion(resp._version); doc.id(resp._id); - var docFetchProm; + let docFetchProm; if (method !== 'index') { docFetchProm = doc.fetch(); } else { diff --git a/src/ui/public/courier/data_source/_normalize_sort_request.js b/src/ui/public/courier/data_source/_normalize_sort_request.js index f43a4fc2ccbe..f3bc6a31a436 100644 --- a/src/ui/public/courier/data_source/_normalize_sort_request.js +++ b/src/ui/public/courier/data_source/_normalize_sort_request.js @@ -28,7 +28,7 @@ export default function normalizeSortRequest(config) { var indexField = indexPattern.fields.byName[sortField]; if (indexField && indexField.scripted && indexField.sortable) { - var direction; + let direction; if (_.isString(sortValue)) direction = sortValue; if (_.isObject(sortValue) && sortValue.order) direction = sortValue.order; diff --git a/src/ui/public/courier/data_source/_root_search_source.js b/src/ui/public/courier/data_source/_root_search_source.js index 128f922b8a6c..045dc0611c3c 100644 --- a/src/ui/public/courier/data_source/_root_search_source.js +++ b/src/ui/public/courier/data_source/_root_search_source.js @@ -12,7 +12,7 @@ export default function RootSearchSource(Private, $rootScope, timefilter, Notifi return timefilter.get(globalSource.get('index')); }); - var appSource; // set in setAppSource() + let appSource; // set in setAppSource() resetAppSource(); // when the route changes, clear the appSource diff --git a/src/ui/public/courier/saved_object/saved_object.js b/src/ui/public/courier/saved_object/saved_object.js index 4aae5a210cd1..477c6c76b959 100644 --- a/src/ui/public/courier/saved_object/saved_object.js +++ b/src/ui/public/courier/saved_object/saved_object.js @@ -151,7 +151,7 @@ export default function SavedObjectFactory(es, kbnIndex, Promise, Private, Notif if (!self.searchSource) return; // if we have a searchSource, set its state based on the searchSourceJSON field - var state; + let state; try { state = JSON.parse(searchSourceJson); } catch (e) { diff --git a/src/ui/public/debounce/__tests__/debounce.js b/src/ui/public/debounce/__tests__/debounce.js index 137de3df7144..eec6762a4589 100644 --- a/src/ui/public/debounce/__tests__/debounce.js +++ b/src/ui/public/debounce/__tests__/debounce.js @@ -3,9 +3,9 @@ import sinon from 'auto-release-sinon'; import expect from 'expect.js'; import ngMock from 'ng_mock'; -var debounce; -var $timeout; -var $timeoutSpy; +let debounce; +let $timeout; +let $timeoutSpy; function init() { ngMock.module('kibana'); @@ -19,7 +19,7 @@ function init() { } describe('debounce service', function () { - var spy; + let spy; beforeEach(function () { spy = sinon.spy(function () {}); init(); diff --git a/src/ui/public/debounce/debounce.js b/src/ui/public/debounce/debounce.js index 8669fc73e704..f317ee51b85c 100644 --- a/src/ui/public/debounce/debounce.js +++ b/src/ui/public/debounce/debounce.js @@ -7,10 +7,10 @@ var module = uiModules.get('kibana'); module.service('debounce', ['$timeout', function ($timeout) { return function (func, wait, options) { - var timeout; - var args; - var self; - var result; + let timeout; + let args; + let self; + let result; options = _.defaults(options || {}, { leading: false, trailing: true diff --git a/src/ui/public/directives/__tests__/auto_select_if_only_one.js b/src/ui/public/directives/__tests__/auto_select_if_only_one.js index a6ad20f40c99..21c2f53fd794 100644 --- a/src/ui/public/directives/__tests__/auto_select_if_only_one.js +++ b/src/ui/public/directives/__tests__/auto_select_if_only_one.js @@ -5,8 +5,8 @@ import ngMock from 'ng_mock'; import 'ui/directives/auto_select_if_only_one'; describe('Auto-select if only one directive', function () { - var $compile; - var $rootScope; + let $compile; + let $rootScope; var zeroOptions = []; var oneOption = [{label: 'foo'}]; var multiOptions = [{label: 'foo'}, {label: 'bar'}]; diff --git a/src/ui/public/directives/__tests__/confirm-click.js b/src/ui/public/directives/__tests__/confirm-click.js index 3a6c695f601a..8435eae9b7db 100644 --- a/src/ui/public/directives/__tests__/confirm-click.js +++ b/src/ui/public/directives/__tests__/confirm-click.js @@ -7,11 +7,11 @@ import 'ui/directives/confirm_click'; import 'plugins/kibana/discover/index'; -var $parentScope; +let $parentScope; -var $scope; +let $scope; -var $elem; +let $elem; var init = function (text) { // Load the application @@ -47,7 +47,7 @@ describe('confirmClick directive', function () { describe('event handlers', function () { - var events; + let events; beforeEach(function () { init(); @@ -71,7 +71,7 @@ describe('confirmClick directive', function () { describe('confirmed', function () { - var confirmed; + let confirmed; beforeEach(function () { init(); @@ -98,7 +98,7 @@ describe('confirmClick directive', function () { }); describe('not confirmed', function () { - var confirmed; + let confirmed; beforeEach(function () { init(); diff --git a/src/ui/public/directives/__tests__/css_truncate.js b/src/ui/public/directives/__tests__/css_truncate.js index eceee7700010..417c5a3125e8 100644 --- a/src/ui/public/directives/__tests__/css_truncate.js +++ b/src/ui/public/directives/__tests__/css_truncate.js @@ -4,11 +4,11 @@ import ngMock from 'ng_mock'; import $ from 'jquery'; import 'plugins/kibana/discover/index'; -var $parentScope; +let $parentScope; -var $scope; +let $scope; -var $elem; +let $elem; var init = function (expandable) { // Load the application diff --git a/src/ui/public/directives/__tests__/fixed_scroll.js b/src/ui/public/directives/__tests__/fixed_scroll.js index 3d345e549f61..d3ca2fed7f13 100644 --- a/src/ui/public/directives/__tests__/fixed_scroll.js +++ b/src/ui/public/directives/__tests__/fixed_scroll.js @@ -8,7 +8,7 @@ import Promise from 'bluebird'; describe('FixedScroll directive', function () { - var compile; + let compile; var trash = []; beforeEach(ngMock.module('kibana')); @@ -112,10 +112,10 @@ describe('FixedScroll directive', function () { { from: '$scroller', to: '$container' } ].forEach(function (names) { describe('scroll events ' + JSON.stringify(names), function () { - var spy; - var els; - var $from; - var $to; + let spy; + let els; + let $from; + let $to; beforeEach(function () { spy = sinon.spy($.fn, 'scrollLeft'); diff --git a/src/ui/public/directives/__tests__/inequality.js b/src/ui/public/directives/__tests__/inequality.js index d7b7c5578ba1..cb822a9e5d61 100644 --- a/src/ui/public/directives/__tests__/inequality.js +++ b/src/ui/public/directives/__tests__/inequality.js @@ -4,9 +4,9 @@ import ngMock from 'ng_mock'; import 'ui/directives/inequality'; describe('greater_than model validator directive', function () { - var $compile; - var $rootScope; - var html; + let $compile; + let $rootScope; + let html; beforeEach(ngMock.module('kibana')); @@ -17,7 +17,7 @@ describe('greater_than model validator directive', function () { // no value is the same as 0 describe('without value', function () { - var element; + let element; beforeEach(function () { html = ''; element = $compile(html)($rootScope); @@ -44,7 +44,7 @@ describe('greater_than model validator directive', function () { [0, 1, 10, 42, -12].forEach(function (num) { describe('with value ' + num, function () { - var element; + let element; beforeEach(function () { html = ''; element = $compile(html)($rootScope); diff --git a/src/ui/public/directives/__tests__/input_focus.js b/src/ui/public/directives/__tests__/input_focus.js index 3104be8e46d3..a252ddd97176 100644 --- a/src/ui/public/directives/__tests__/input_focus.js +++ b/src/ui/public/directives/__tests__/input_focus.js @@ -5,13 +5,13 @@ import $ from 'jquery'; import 'ui/directives/input_focus'; describe('Input focus directive', function () { - var $compile; - var $rootScope; - var $timeout; - var element; - var $el; - var selectedEl; - var selectedText; + let $compile; + let $rootScope; + let $timeout; + let element; + let $el; + let selectedEl; + let selectedText; var inputValue = 'Input Text Value'; beforeEach(ngMock.module('kibana')); diff --git a/src/ui/public/directives/__tests__/input_whole_number.js b/src/ui/public/directives/__tests__/input_whole_number.js index 6aaa4cb52bdb..56c375c147c5 100644 --- a/src/ui/public/directives/__tests__/input_whole_number.js +++ b/src/ui/public/directives/__tests__/input_whole_number.js @@ -4,8 +4,8 @@ import ngMock from 'ng_mock'; import 'ui/directives/input_whole_number'; describe('Whole number input directive', function () { - var $compile; - var $rootScope; + let $compile; + let $rootScope; var html = ''; beforeEach(ngMock.module('kibana')); diff --git a/src/ui/public/directives/__tests__/json_input.js b/src/ui/public/directives/__tests__/json_input.js index 8f89ce2b55b2..12713fdaafa8 100644 --- a/src/ui/public/directives/__tests__/json_input.js +++ b/src/ui/public/directives/__tests__/json_input.js @@ -5,10 +5,10 @@ import 'ui/directives/json_input'; describe('JSON input validation', function () { - var $compile; - var $rootScope; + let $compile; + let $rootScope; var html = ''; - var element; + let element; beforeEach(ngMock.module('kibana')); diff --git a/src/ui/public/directives/__tests__/parse_query.js b/src/ui/public/directives/__tests__/parse_query.js index 8f726e83b405..3e78f1e614ac 100644 --- a/src/ui/public/directives/__tests__/parse_query.js +++ b/src/ui/public/directives/__tests__/parse_query.js @@ -5,18 +5,18 @@ import ngMock from 'ng_mock'; // Load the kibana app dependencies. -var $rootScope; -var $timeout; -var $compile; -var Promise; -var Private; -var config; -var $elemScope; -var $elem; +let $rootScope; +let $timeout; +let $compile; +let Promise; +let Private; +let config; +let $elemScope; +let $elem; var cycleIndex = 0; var markup = ''; -var fromUser; +let fromUser; import toUser from 'ui/parse_query/lib/to_user'; import 'ui/parse_query'; import ParseQueryLibFromUserProvider from 'ui/parse_query/lib/from_user'; @@ -102,7 +102,7 @@ describe('parse-query directive', function () { describe('model presentation formatter', function () { it('should present undefined as empty string', function () { - var notDefined; + let notDefined; expect(toUser(notDefined)).to.be(''); }); diff --git a/src/ui/public/directives/__tests__/timepicker.js b/src/ui/public/directives/__tests__/timepicker.js index bd8f9f6fe7be..9d59f9d16675 100644 --- a/src/ui/public/directives/__tests__/timepicker.js +++ b/src/ui/public/directives/__tests__/timepicker.js @@ -12,13 +12,13 @@ import 'plugins/kibana/discover/index'; // TODO: This should not be needed, timefilter is only included here, it should move -var $parentScope; +let $parentScope; -var $scope; +let $scope; -var $elem; +let $elem; var anchor = '2014-01-01T06:06:06.666Z'; -var clock; +let clock; var init = function () { // Load the application @@ -85,7 +85,7 @@ describe('timepicker directive', function () { }); describe('refresh interval', function () { - var $courier; + let $courier; beforeEach(function () { init(); ngMock.inject(function (courier, $rootScope) { @@ -232,7 +232,7 @@ describe('timepicker directive', function () { }); it('disables the submit button if the form is invalid', function (done) { - var button; + let button; button = $elem.find('button[disabled]'); expect(button.length).to.be(0); @@ -359,7 +359,7 @@ describe('timepicker directive', function () { describe('absolute mode', function () { - var inputs; + let inputs; beforeEach(function () { init(); diff --git a/src/ui/public/directives/__tests__/truncate.js b/src/ui/public/directives/__tests__/truncate.js index 1c9e1256051b..695f6d912f64 100644 --- a/src/ui/public/directives/__tests__/truncate.js +++ b/src/ui/public/directives/__tests__/truncate.js @@ -5,11 +5,11 @@ import $ from 'jquery'; import 'plugins/kibana/discover/index'; -var $parentScope; +let $parentScope; -var $scope; +let $scope; -var $elem; +let $elem; var init = function (text) { // Load the application diff --git a/src/ui/public/directives/__tests__/typeahead.js b/src/ui/public/directives/__tests__/typeahead.js index f6d90ed8ad1f..4a5cf3798f3f 100644 --- a/src/ui/public/directives/__tests__/typeahead.js +++ b/src/ui/public/directives/__tests__/typeahead.js @@ -9,12 +9,12 @@ import 'plugins/kibana/discover/index'; var typeaheadHistoryCount = 10; var typeaheadName = 'unittest'; -var $parentScope; -var $typeaheadScope; -var $elem; -var $typeaheadInputScope; -var typeaheadCtrl; -var PersistedLog; +let $parentScope; +let $typeaheadScope; +let $elem; +let $typeaheadInputScope; +let typeaheadCtrl; +let PersistedLog; var markup = '