mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[internal] Remove all variable redeclarations
Redeclaring variables causes ambiguity and serves no purpose. It actually causes a runtime error when you do it with `let`, and we can enforce not doing it via a linter rule.
This commit is contained in:
parent
fc62113d72
commit
de20762889
6 changed files with 3 additions and 6 deletions
|
@ -30,7 +30,7 @@ export default function RangeAggDefinition(Private) {
|
|||
|
||||
var id = RangeKey.idBucket(bucket);
|
||||
|
||||
var key = keys.get(id);
|
||||
key = keys.get(id);
|
||||
if (!key) {
|
||||
key = new RangeKey(bucket);
|
||||
keys.set(id, key);
|
||||
|
|
|
@ -90,7 +90,7 @@ uiModules.get('kibana')
|
|||
// Most of these functions were moved directly from the old Legend class. Not a fan of this.
|
||||
function getLabels(data, type) {
|
||||
if (!data) return [];
|
||||
var data = data.columns || data.rows || [data];
|
||||
data = data.columns || data.rows || [data];
|
||||
if (type === 'pie') return Data.prototype.pieNames(data);
|
||||
return getSeriesLabels(data);
|
||||
};
|
||||
|
|
1
test/fixtures/scenario_manager.js
vendored
1
test/fixtures/scenario_manager.js
vendored
|
@ -123,7 +123,6 @@ ScenarioManager.prototype.loadIfEmpty = function (id) {
|
|||
var scenario = config[id];
|
||||
if (!scenario) throw new Error('No scenario found for ' + id);
|
||||
|
||||
var self = this;
|
||||
return Promise.all(scenario.bulk.map(function mapBulk(bulk) {
|
||||
var loadIndexDefinition;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ define(function (require) {
|
|||
var collapseExpand = require('./_collapse_expand');
|
||||
|
||||
bdd.describe('discover app', function () {
|
||||
var scenarioManager;
|
||||
var remote;
|
||||
var scenarioManager = new ScenarioManager(url.format(config.servers.elasticsearch));
|
||||
this.timeout = config.timeouts.default;
|
||||
|
|
|
@ -20,7 +20,6 @@ define(function (require) {
|
|||
|
||||
bdd.describe('visualize app', function () {
|
||||
var common;
|
||||
var scenarioManager;
|
||||
var remote;
|
||||
var headerPage;
|
||||
var settingsPage;
|
||||
|
|
|
@ -91,7 +91,7 @@ define(function (require) {
|
|||
return self.remote.getCurrentUrl();
|
||||
})
|
||||
.then(function (currentUrl) {
|
||||
var currentUrl = currentUrl.replace(/\/\/\w+:\w+@/, '//');
|
||||
currentUrl = currentUrl.replace(/\/\/\w+:\w+@/, '//');
|
||||
var navSuccessful = new RegExp(appUrl).test(currentUrl);
|
||||
if (!navSuccessful) {
|
||||
var msg = 'App failed to load: ' + appName +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue