From 615425c8085455dfa5c28613d47e3467eef7caa5 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 12 Dec 2014 12:14:02 +1100 Subject: [PATCH] fix linting errors --- bin/6to5/file.js | 2 +- lib/6to5/polyfill.js | 2 +- lib/6to5/transformation/modules/amd.js | 2 +- lib/6to5/transformation/modules/common.js | 2 +- .../transformation/transformers/es7-generator-comprehension.js | 2 +- .../transformation/transformers/spec-block-hoist-functions.js | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/6to5/file.js b/bin/6to5/file.js index a118389437..a06bf304ea 100644 --- a/bin/6to5/file.js +++ b/bin/6to5/file.js @@ -113,7 +113,7 @@ module.exports = function (commander, filenames) { walk(); if (commander.watch) { - var watcher = chokidar.watch(filenames, { + chokidar.watch(filenames, { persistent: true, ignoreInitial: true }).on("all", function (type, filename) { diff --git a/lib/6to5/polyfill.js b/lib/6to5/polyfill.js index e9f7342924..5d945d16e8 100644 --- a/lib/6to5/polyfill.js +++ b/lib/6to5/polyfill.js @@ -1,4 +1,4 @@ -/* jshint newcap: false */ +/* jshint newcap: false, freeze: false */ var ensureSymbol = function (key) { Symbol[key] = Symbol[key] || Symbol(key); diff --git a/lib/6to5/transformation/modules/amd.js b/lib/6to5/transformation/modules/amd.js index 23566148a8..49185c5a40 100644 --- a/lib/6to5/transformation/modules/amd.js +++ b/lib/6to5/transformation/modules/amd.js @@ -51,7 +51,7 @@ AMDFormatter.prototype.transform = function (ast) { AMDFormatter.prototype.getModuleName = function () { if (this.file.opts.amdModuleIds) { - return CommonJSFormatter.prototype.getModuleName.apply(this, arguments); + return DefaultFormatter.prototype.getModuleName.apply(this, arguments); } else { return null; } diff --git a/lib/6to5/transformation/modules/common.js b/lib/6to5/transformation/modules/common.js index 1feb646d61..6676511919 100644 --- a/lib/6to5/transformation/modules/common.js +++ b/lib/6to5/transformation/modules/common.js @@ -42,7 +42,7 @@ CommonJSFormatter.prototype.export = function (node, nodes) { var templateName = "exports-default-module"; // exports = module.exports = VALUE; - if (this.hasNonDefaultExports) templateName = "exports-default-module-override" + if (this.hasNonDefaultExports) templateName = "exports-default-module-override"; var assign = util.template(templateName, { VALUE: this._pushStatement(declar, nodes) diff --git a/lib/6to5/transformation/transformers/es7-generator-comprehension.js b/lib/6to5/transformation/transformers/es7-generator-comprehension.js index cb469ef1ce..2034beef85 100644 --- a/lib/6to5/transformation/transformers/es7-generator-comprehension.js +++ b/lib/6to5/transformation/transformers/es7-generator-comprehension.js @@ -6,7 +6,7 @@ exports.ComprehensionExpression = function (node) { var body = []; var container = t.functionExpression(null, [], t.blockStatement(body), true); - container._aliasFunction = true + container._aliasFunction = true; body.push(arrayComprehension._build(node, function () { return t.expressionStatement(t.yieldExpression(node.body)); diff --git a/lib/6to5/transformation/transformers/spec-block-hoist-functions.js b/lib/6to5/transformation/transformers/spec-block-hoist-functions.js index 8dae49c00c..8d18464de0 100644 --- a/lib/6to5/transformation/transformers/spec-block-hoist-functions.js +++ b/lib/6to5/transformation/transformers/spec-block-hoist-functions.js @@ -1,5 +1,4 @@ var t = require("../../types"); -var _ = require("lodash"); exports.BlockStatement = function (node, parent) { if (t.isFunction(parent)) return;