fix linting errors
This commit is contained in:
parent
b21b0e753e
commit
cfd0059fc7
@ -3,8 +3,6 @@
|
|||||||
var t = require("../../types");
|
var t = require("../../types");
|
||||||
|
|
||||||
exports._params = function (node, print) {
|
exports._params = function (node, print) {
|
||||||
var self = this;
|
|
||||||
|
|
||||||
this.push("(");
|
this.push("(");
|
||||||
|
|
||||||
print.join(node.params, {
|
print.join(node.params, {
|
||||||
|
|||||||
@ -223,7 +223,6 @@ DefaultFormatter.prototype.exportSpecifier = function (specifier, node, nodes) {
|
|||||||
// export * from "foo";
|
// export * from "foo";
|
||||||
nodes.push(this.buildExportsWildcard(ref, node));
|
nodes.push(this.buildExportsWildcard(ref, node));
|
||||||
} else {
|
} else {
|
||||||
var ref;
|
|
||||||
if (t.isSpecifierDefault(specifier) && !this.noInteropRequire) {
|
if (t.isSpecifierDefault(specifier) && !this.noInteropRequire) {
|
||||||
// importing a default so we need to normalise it
|
// importing a default so we need to normalise it
|
||||||
ref = t.callExpression(this.file.addHelper("interop-require"), [ref]);
|
ref = t.callExpression(this.file.addHelper("interop-require"), [ref]);
|
||||||
|
|||||||
@ -3,12 +3,10 @@
|
|||||||
module.exports = CommonJSFormatter;
|
module.exports = CommonJSFormatter;
|
||||||
|
|
||||||
var DefaultFormatter = require("./_default");
|
var DefaultFormatter = require("./_default");
|
||||||
var traverse = require("../../traverse");
|
|
||||||
var util = require("../../util");
|
var util = require("../../util");
|
||||||
var t = require("../../types");
|
var t = require("../../types");
|
||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
|
|
||||||
|
|
||||||
function CommonJSFormatter(file) {
|
function CommonJSFormatter(file) {
|
||||||
DefaultFormatter.apply(this, arguments);
|
DefaultFormatter.apply(this, arguments);
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var traverse = require("../../../traverse");
|
var util = require("../../../util");
|
||||||
var util = require("../../../util");
|
var t = require("../../../types");
|
||||||
var t = require("../../../types");
|
|
||||||
|
|
||||||
var hasDefaults = function (node) {
|
var hasDefaults = function (node) {
|
||||||
for (var i = 0; i < node.params.length; i++) {
|
for (var i = 0; i < node.params.length; i++) {
|
||||||
@ -11,7 +10,7 @@ var hasDefaults = function (node) {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.Function = function (node, parent, scope, context, file) {
|
exports.Function = function (node, parent, scope) {
|
||||||
if (!hasDefaults(node)) return;
|
if (!hasDefaults(node)) return;
|
||||||
|
|
||||||
t.ensureBlock(node);
|
t.ensureBlock(node);
|
||||||
@ -35,7 +34,7 @@ exports.Function = function (node, parent, scope, context, file) {
|
|||||||
var left = param.left;
|
var left = param.left;
|
||||||
var right = param.right;
|
var right = param.right;
|
||||||
|
|
||||||
node.params[i] = scope.generateUidIdentifier("x")
|
node.params[i] = scope.generateUidIdentifier("x");
|
||||||
|
|
||||||
// we're accessing a variable that's already defined within this function
|
// we're accessing a variable that's already defined within this function
|
||||||
var localDeclar = scope.get(left.name, true);
|
var localDeclar = scope.get(left.name, true);
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
module.exports = Node;
|
module.exports = Node;
|
||||||
|
|
||||||
var object = require("../helpers/object");
|
var acorn = require("acorn-6to5");
|
||||||
var acorn = require("acorn-6to5");
|
|
||||||
|
|
||||||
var oldNode = acorn.Node;
|
var oldNode = acorn.Node;
|
||||||
acorn.Node = Node;
|
acorn.Node = Node;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user