Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
re-enable no-var rule and autofix violations
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Aug 29, 2016
1 parent c95067b commit f0def9d
Show file tree
Hide file tree
Showing 88 changed files with 443 additions and 444 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
extends: '@elastic/kibana'
rules:
no-unused-vars: off
no-var: off
prefer-const: off
no-extra-semi: off
quotes: off
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function keysDeep(object, base) {
let delimitedBase = base ? base + '.' : '';

_.forEach(object, (value, key) => {
var fullKey = delimitedBase + key;
let fullKey = delimitedBase + key;
if (_.isPlainObject(value)) {
result = result.concat(keysDeep(value, fullKey));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ modules.get('apps/management')
const ingest = Private(IngestProvider);
const $state = this.state = new AppState();

var notify = new Notifier({
let notify = new Notifier({
location: 'Add Data'
});

var totalSteps = 4;
let totalSteps = 4;
this.stepResults = {};

this.setCurrentStep = (step) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ modules.get('apps/management')
const ingest = Private(IngestProvider);
const $state = this.state = new AppState();

var notify = new Notifier({
let notify = new Notifier({
location: 'Add Data'
});

var totalSteps = 3;
let totalSteps = 3;
this.stepResults = {};

this.setCurrentStep = (step) => {
Expand Down
2 changes: 1 addition & 1 deletion src/core_plugins/table_vis/public/table_vis_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const module = uiModules.get('kibana/table_vis', ['kibana']);
module.controller('KbnTableVisController', function ($scope, Private) {
const tabifyAggResponse = Private(AggResponseTabifyTabifyProvider);

var uiStateSort = ($scope.uiState) ? $scope.uiState.get('vis.params.sort') : {};
let uiStateSort = ($scope.uiState) ? $scope.uiState.get('vis.params.sort') : {};
assign($scope.vis.params.sort, uiStateSort);

$scope.sort = $scope.vis.params.sort;
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/mock_ui_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default {
},
on: _.noop,
off: _.noop
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ let stringList = [

let lists = [objectList, stringList, []];

var $scope;
var $element;
var $isolatedScope;
let $scope;
let $element;
let $isolatedScope;

lists.forEach(function (list) {
let isArrayOfObjects = list.every((item) => {
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/kbn_top_nav/__tests__/kbn_top_nav_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ describe('KbnTopNavController', function () {
expect(controller.menuItems).to.have.length(4);

// check that the items were added
var matches = controller.menuItems.reduce((acc, item) => {
let matches = controller.menuItems.reduce((acc, item) => {
if (item.key === 'green' || item.key === 'red') {
acc[item.key] = item;
}
Expand All @@ -324,7 +324,7 @@ describe('KbnTopNavController', function () {
expect(controller.menuItems).to.have.length(3);

// check that the items were added
var match = controller.menuItems.filter((item) => {
let match = controller.menuItems.filter((item) => {
return item.key === 'green';
});
expect(match[0]).to.have.property('run');
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/paginated_table/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('paginated table', function () {
paginatedTable.sortColumn(1);
$scope.$digest();

var tableRows = $el.find('tbody tr');
let tableRows = $el.find('tbody tr');
expect(tableRows.eq(2).find('td').eq(1).text()).to.be('cccc');
expect(tableRows.eq(1).find('td').eq(1).text()).to.be('bbbb');
expect(tableRows.eq(0).find('td').eq(1).text()).to.be('aaaa');
Expand All @@ -175,7 +175,7 @@ describe('paginated table', function () {
paginatedTable.sortColumn(1, 'desc');
$scope.$digest();

var tableRows = $el.find('tbody tr');
let tableRows = $el.find('tbody tr');
expect(tableRows.eq(0).find('td').eq(1).text()).to.be('zzzz');
expect(tableRows.eq(1).find('td').eq(1).text()).to.be('cccc');
expect(tableRows.eq(2).find('td').eq(1).text()).to.be('bbbb');
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/pattern_checker/pattern_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.directive('patternChecker', function () {
controller: function (Notifier, $scope, $timeout, $http) {
let validationTimeout;

var notify = new Notifier({
let notify = new Notifier({
location: 'Add Data'
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ describe('Vislib Split Function Test Suite', function () {
});

describe('chart title split function', function () {
var visEl;
var newEl;
var fixture;
let visEl;
let newEl;
let fixture;

beforeEach(ngMock.inject(function () {
visEl = el.append('div').attr('class', 'vis-wrapper');
Expand Down
8 changes: 4 additions & 4 deletions tasks/build/babel_options.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = function (grunt) {

var srcFile = 'build/kibana/src/optimize/babel_options.js';
var buildFile = 'build/kibana/src/optimize/babel_options.build.js';
var rename = require('fs').renameSync;
var unlink = require('fs').unlinkSync;
let srcFile = 'build/kibana/src/optimize/babel_options.js';
let buildFile = 'build/kibana/src/optimize/babel_options.build.js';
let rename = require('fs').renameSync;
let unlink = require('fs').unlinkSync;

grunt.registerTask('_build:babelOptions', function () {
unlink(srcFile);
Expand Down
4 changes: 2 additions & 2 deletions tasks/build/download_node_builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ module.exports = function (grunt) {

activeDownloads.push(platform);

var bytes = parseInt(resp.headers['content-length'], 10) || 'unknown number of';
var mb = ((bytes / 1024) / 1024).toFixed(2);
let bytes = parseInt(resp.headers['content-length'], 10) || 'unknown number of';
let mb = ((bytes / 1024) / 1024).toFixed(2);
grunt.log.ok(`downloading ${platform.name} - ${mb} mb`);
};

Expand Down
4 changes: 2 additions & 2 deletions tasks/build/install_npm_deps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (grunt) {
var { exec } = require('child_process');
var { resolve } = require('path');
let { exec } = require('child_process');
let { resolve } = require('path');

grunt.registerTask('_build:installNpmDeps', function () {
grunt.file.mkdir('build/kibana/node_modules');
Expand Down
12 changes: 6 additions & 6 deletions tasks/build/shasums.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var { promisify } = require('bluebird');
var readdir = promisify(require('fs').readdir);
var exec = promisify(require('child_process').exec);
var platform = require('os').platform();
var cmd = /^win/.test(platform) ? 'sha1sum ' : 'shasum ';
let { promisify } = require('bluebird');
let readdir = promisify(require('fs').readdir);
let exec = promisify(require('child_process').exec);
let platform = require('os').platform();
let cmd = /^win/.test(platform) ? 'sha1sum ' : 'shasum ';

module.exports = function (grunt) {
grunt.registerTask('_build:shasums', function () {
var targetDir = grunt.config.get('target');
let targetDir = grunt.config.get('target');

// for when shasums is run but archives and ospackages was not
grunt.file.mkdir(targetDir);
Expand Down
2 changes: 1 addition & 1 deletion tasks/config/eslint.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var resolve = require('path').resolve;
let resolve = require('path').resolve;

module.exports = function (grunt) {
return {
Expand Down
8 changes: 4 additions & 4 deletions tasks/config/esvm.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = function (grunt) {
var resolve = require('path').resolve;
var directory = resolve(__dirname, '../../esvm');
var dataDir = resolve(directory, 'data_dir');
var serverConfig = require('../../test/server_config');
let resolve = require('path').resolve;
let directory = resolve(__dirname, '../../esvm');
let dataDir = resolve(directory, 'data_dir');
let serverConfig = require('../../test/server_config');

return {
options: {
Expand Down
2 changes: 1 addition & 1 deletion tasks/config/intern.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var path = require('path');
let path = require('path');


module.exports = function (grunt) {
Expand Down
2 changes: 1 addition & 1 deletion tasks/config/s3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function (grunt) {
var { config } = grunt;
let { config } = grunt;

return {
release: {
Expand Down
2 changes: 1 addition & 1 deletion tasks/lint_staged_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function (grunt) {
grunt.task.requires('collectFilesToCommit');

// match these patterns
var patterns = grunt.config.get('eslint.source.files.src');
let patterns = grunt.config.get('eslint.source.files.src');
if (!patterns) grunt.fail.warn('eslint file pattern is not defined');

const files = grunt.config
Expand Down
2 changes: 1 addition & 1 deletion tasks/release_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default (grunt) => {
grunt.fail.fatal('Aborting publish');
}

var rl = readline.createInterface({
let rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
Expand Down
2 changes: 1 addition & 1 deletion tasks/sterilize.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function (grunt) {

rl.on('close', this.async());
rl.question(`\n${danger} Do you really want to delete all of the above files?, [N/y] `, function (resp) {
var yes = resp.toLowerCase().trim()[0] === 'y';
let yes = resp.toLowerCase().trim()[0] === 'y';
rl.close();

if (yes) {
Expand Down
10 changes: 5 additions & 5 deletions tasks/utils/install_or_update_repo.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var Promise = require('bluebird');
var spawn = require('./spawn');
var grunt = require('grunt');
let Promise = require('bluebird');
let spawn = require('./spawn');
let grunt = require('grunt');

module.exports = function (repo, dir) {
// store the previous and new hash from the repo
// to know if there was an update from fetch
var prevHash;
var newHash;
let prevHash;
let newHash;

return Promise.resolve()
.then(function () {
Expand Down
14 changes: 7 additions & 7 deletions tasks/utils/update_version.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var _ = require('lodash');
let _ = require('lodash');

module.exports = updateVersion;

var versions = [
let versions = [
'major',
'minor',
'patch',
Expand Down Expand Up @@ -44,7 +44,7 @@ var versions = [
function updateVersion(version, expr) {
expr = String(expr).split('=');

var change = {
let change = {
name: expr[0],
val: expr[1] || null
};
Expand All @@ -58,7 +58,7 @@ function updateVersion(version, expr) {
}

// parse the current version
var parts = _.chain(version.split('.'))
let parts = _.chain(version.split('.'))

// ensure that their are three pieces, either x.x.x or x.x.x-y
.tap(function (versionNumbers) {
Expand All @@ -70,7 +70,7 @@ function updateVersion(version, expr) {
// describe all of the version parts with a name, parse
// the numbers, and extract tag from patch
.transform(function (parts, v, i) {
var name = versions[i];
let name = versions[i];

if (name !== 'patch') {
parts[name] = _.parseInt(v);
Expand All @@ -86,7 +86,7 @@ function updateVersion(version, expr) {
// sanity check
.tap(function (parts) {

var valid = true;
let valid = true;
valid = valid && _.isNumber(parts.major);
valid = valid && _.isNumber(parts.minor);
valid = valid && _.isNumber(parts.patch);
Expand Down Expand Up @@ -121,7 +121,7 @@ function updateVersion(version, expr) {
}

// properties that are zero-d by the previous update
var emptyUpdates = versions.slice(versions.indexOf(change.name) + 1);
let emptyUpdates = versions.slice(versions.indexOf(change.name) + 1);
while (emptyUpdates.length) {
parts[emptyUpdates.shift()] = '';
}
Expand Down
Loading

0 comments on commit f0def9d

Please sign in to comment.