fix linting errors
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
"esnext": true,
|
||||
"indent": 2,
|
||||
"freeze": true,
|
||||
"validthis": true,
|
||||
"camelcase": true,
|
||||
"unused": true,
|
||||
"eqnull": true,
|
||||
|
||||
@@ -348,8 +348,6 @@ File.prototype.parse = function (code) {
|
||||
};
|
||||
|
||||
File.prototype.transform = function (ast) {
|
||||
var self = this;
|
||||
|
||||
this.debug();
|
||||
|
||||
this.ast = ast;
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module.exports = TransformerPass;
|
||||
|
||||
var util = require("../util");
|
||||
var contains = require("lodash/collection/contains");
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ exports.post = function (file) {
|
||||
};
|
||||
|
||||
exports.FunctionDeclaration =
|
||||
exports.FunctionExpression = function (node, parent, scope) {
|
||||
exports.FunctionExpression = function () {
|
||||
this.skip();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user