fix linting errors

This commit is contained in:
Sebastian McKenzie
2015-02-06 23:06:54 +11:00
parent b66367ddde
commit 399d835285
10 changed files with 9 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
"esnext": true,
"indent": 2,
"freeze": true,
"validthis": true,
"camelcase": true,
"unused": true,
"eqnull": true,

View File

@@ -348,8 +348,6 @@ File.prototype.parse = function (code) {
};
File.prototype.transform = function (ast) {
var self = this;
this.debug();
this.ast = ast;

View File

@@ -3,7 +3,7 @@
var t = require("../../types");
var visitor = {
enter: function (node, parent, scope) {
enter: function (node) {
if (t.isFunction(node)) this.skip();
if (t.isAwaitExpression(node)) {

View File

@@ -1,6 +1,5 @@
module.exports = TransformerPass;
var util = require("../util");
var contains = require("lodash/collection/contains");
/**

View File

@@ -2,7 +2,7 @@ var t = require("../../../types");
exports.optional = true;
exports.ExpressionStatement = function (node, parent, scope) {
exports.ExpressionStatement = function (node) {
// remove consequenceless expressions such as local variables and literals
//
// var foo = true; foo; -> var foo = true;
@@ -16,7 +16,7 @@ exports.ExpressionStatement = function (node, parent, scope) {
};
exports.IfStatement = {
exit: function (node, parent, scope) {
exit: function (node) {
// todo: in scenarios where we can just return the consequent or
// alternate we should drop the block statement if it contains no
// block scoped variables

View File

@@ -6,7 +6,7 @@ var isConsole = t.buildMatchMemberExpression("console", true);
exports.optional = true;
exports.CallExpression = function (node, parent, scope) {
exports.CallExpression = function (node) {
if (isConsole(node.callee)) {
this.remove();
}

View File

@@ -2,7 +2,7 @@ var t = require("../../../types");
exports.optional = true;
exports.ExpressionStatement = function (node, parent, scope) {
exports.ExpressionStatement = function (node) {
if (t.isIdentifier(node.expression, { name: "debugger" })) {
this.remove();
}

View File

@@ -5,6 +5,7 @@ exports.optional = true;
exports.Scope = function () {
// todo: get all binding identifiers, generate compact names
// that wont collide and then call the remap identifier helper
// this transformer **has** to be ran last as it will absolutley
// destroy the scope tree
};

View File

@@ -68,7 +68,7 @@ exports.post = function (file) {
file.scope.traverse(file.ast, astVisitor, file);
};
exports.pre = function ( file) {
exports.pre = function (file) {
file.setDynamic("runtimeIdentifier", function () {
return file.addImport("6to5-runtime/helpers", "to5Helpers");
});

View File

@@ -11,7 +11,7 @@ exports.post = function (file) {
};
exports.FunctionDeclaration =
exports.FunctionExpression = function (node, parent, scope) {
exports.FunctionExpression = function () {
this.skip();
};