use eslint autofix to start fixing violations

This commit is contained in:
spalger
2017-06-14 18:48:24 -07:00
parent da8e558817
commit 3d75c6ff0f
97 changed files with 1281 additions and 1280 deletions

View File

@ -1,14 +1,14 @@
var get = require('lodash.get');
var utils = require('../utils');
var fromRoot = require('path').join.bind(null, __dirname, '..', '..');
const get = require('lodash.get');
const utils = require('../utils');
const fromRoot = require('path').join.bind(null, __dirname, '..', '..');
var release = process.env.ES_RELEASE;
var ref = process.env.ES_REF;
var port = parseFloat(get(process.env, 'ES_PORT', 9400));
var host = get(process.env, 'ES_HOST', 'localhost');
const release = process.env.ES_RELEASE;
const ref = process.env.ES_REF;
const port = parseFloat(get(process.env, 'ES_PORT', 9400));
const host = get(process.env, 'ES_HOST', 'localhost');
var Version = require('../../scripts/Version');
var versionedOpts = [
const Version = require('../../scripts/Version');
const versionedOpts = [
{
version: '*',
directory: fromRoot('esvm'),
@ -90,8 +90,8 @@ utils.branches.forEach(function (branch) {
// ci target, based on env variables
(function () {
var v;
var opts = {
let v;
const opts = {
config: {
'http.port': port
}

View File

@ -1,12 +1,12 @@
var root = require('find-root')(__dirname);
var rel = require('path').resolve.bind(null, root);
var rootReq = function (p) { return require(rel(p)); };
var _ = rootReq('src/lib/utils');
var grunt = require('grunt');
const root = require('find-root')(__dirname);
const rel = require('path').resolve.bind(null, root);
const rootReq = function (p) { return require(rel(p)); };
const _ = rootReq('src/lib/utils');
const grunt = require('grunt');
var JENKINS_REPORTER = rel('test/utils/jenkins-reporter.js');
const JENKINS_REPORTER = rel('test/utils/jenkins-reporter.js');
var config = {
const config = {
unit: {
src: 'test/unit/index.js',
options: {

View File

@ -1,6 +1,6 @@
var utils = require('../utils');
const utils = require('../utils');
var config = {
const config = {
generate: {
exec: 'node ./scripts/generate/index.js',
options: {

View File

@ -1,4 +1,4 @@
var config = {};
let config = {};
try {
config = require('../../.aws-config.json');
} catch (e) {}

View File

@ -1,4 +1,4 @@
var slk = require('../../test/utils/slk');
const slk = require('../../test/utils/slk');
module.exports = {
all: {
options: {

View File

@ -4,4 +4,4 @@ module.exports = {
require('../../webpack_config/angular'),
require('../../webpack_config/jquery'),
]
}
};

View File

@ -1,8 +1,8 @@
module.exports = function (grunt) {
var Promise = require('bluebird');
var utils = require('./utils');
var readFile = Promise.promisify(require('fs').readFile);
var writeFile = Promise.promisify(require('fs').writeFile);
const Promise = require('bluebird');
const utils = require('./utils');
const readFile = Promise.promisify(require('fs').readFile);
const writeFile = Promise.promisify(require('fs').writeFile);
// Default task runs the build process.
@ -11,12 +11,12 @@ module.exports = function (grunt) {
]);
grunt.registerTask('test', function (branch) {
var tasks = [
const tasks = [
branch ? 'run:generate_' + branch : 'run:generate',
'mochacov:unit'
];
var branches = branch ? [branch] : utils.branches;
const branches = branch ? [branch] : utils.branches;
process.env.ES_PORT = process.env.ES_PORT || 9400;
process.env.ES_HOST = process.env.ES_HOST || 'localhost';
@ -38,10 +38,10 @@ module.exports = function (grunt) {
]);
grunt.registerTask('version', function (nextVersion) {
var root = require('path').join.bind(null, __dirname, '..');
var readmePath = root('README.md');
var packagePath = root('package.json');
var browserBuildsPath = root('docs/browser_builds.asciidoc');
const root = require('path').join.bind(null, __dirname, '..');
const readmePath = root('README.md');
const packagePath = root('package.json');
const browserBuildsPath = root('docs/browser_builds.asciidoc');
Promise.all([
require(packagePath),
@ -49,7 +49,7 @@ module.exports = function (grunt) {
readFile(browserBuildsPath, 'utf8')
])
.spread(function (pkg, readme, browserBuilds) {
var current = pkg.version;
const current = pkg.version;
pkg.version = nextVersion;
browserBuilds = utils.replaceAll(browserBuilds, current, nextVersion);

View File

@ -1,10 +1,10 @@
var _ = require('../src/lib/utils');
const _ = require('../src/lib/utils');
var root = require('find-root')(__dirname);
var pkg = require(root + '/package.json');
var stable = pkg.config.supported_es_branches;
var unstable = pkg.config.unstable_es_branches;
var branches = [].concat(stable, unstable);
const root = require('find-root')(__dirname);
const pkg = require(root + '/package.json');
const stable = pkg.config.supported_es_branches;
const unstable = pkg.config.unstable_es_branches;
const branches = [].concat(stable, unstable);
var utils = {
branchSuffix: function (branch) {
@ -29,7 +29,7 @@ utils.minorVersion = function (version) {
* increment the version based on the release "type"
*/
utils.increaseVersion = function (version, type) {
var i;
let i;
switch (type) {
case 'major':
i = 0;
@ -47,14 +47,14 @@ utils.increaseVersion = function (version, type) {
}
// breakout the current version
var next = version.split('.').map(function (n) {
const next = version.split('.').map(function (n) {
return parseInt(n, 10);
});
// increment the version type
next[i] += 1;
// clear out all following numbers
for (i ++; i < next.length; i++) next[i] = 0;
for (i++; i < next.length; i++) next[i] = 0;
// join back together with '.'
return next.join('.');
};
@ -63,9 +63,9 @@ utils.increaseVersion = function (version, type) {
* replace all instances of `replace` with `replacement` without creating a regexp object
*/
utils.replaceAll = function (str, replace, replacement) {
var out = '';
var remaining = str;
var i = 0;
let out = '';
let remaining = str;
let i = 0;
while (~(i = remaining.indexOf(replace))) {
out += remaining.substring(0, i) + replacement;