babel-eslint
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -25,2 +25,15 @@ var tokTypes = require("babel").acorn.tokTypes; | ||
enter: function (node) { | ||
if (t.isSpreadProperty(node)) { | ||
node.type = "Property"; | ||
node.kind = "init"; | ||
node.computed = false; | ||
node.key = node.value = node.argument; | ||
delete node.argument; | ||
} | ||
if (t.isClassProperty(node)) { | ||
// eslint doesn't like these | ||
this.remove(); | ||
} | ||
if (t.isImportBatchSpecifier(node)) { | ||
@@ -31,4 +44,21 @@ // ImportBatchSpecifier<name> => ImportNamespaceSpecifier<id> | ||
delete node.name; | ||
} else if (t.isFunction(node)) { | ||
// defaults | ||
} | ||
// JSX | ||
if (t.isJSXIdentifier(node)) { | ||
if (node.name === "this" && t.isReferenced(node, parent)) { | ||
return t.thisExpression(); | ||
} else { | ||
node.type = "Identifier"; | ||
} | ||
} | ||
if (t.isJSXMemberExpression(node)) { | ||
node.type = "MemberExpression"; | ||
} | ||
// functions | ||
if (t.isFunction(node)) { | ||
node.defaults = []; | ||
@@ -40,2 +70,3 @@ node.params = node.params.map(function (param) { | ||
} else { | ||
if (t.isRestElement(param)) param = param.argument; | ||
node.defaults.push(null); | ||
@@ -45,17 +76,5 @@ return param; | ||
}); | ||
} | ||
// rest | ||
if (t.isRestElement(node.params[node.params.length - 1])) { | ||
node.rest = node.params.pop(); | ||
} | ||
} else if (t.isSpreadProperty(node)) { | ||
node.type = "Property"; | ||
node.kind = "init"; | ||
node.computed = false; | ||
node.key = node.value = node.argument; | ||
delete node.argument; | ||
} else if (t.isClassProperty(node)) { | ||
// eslint doesn't like these | ||
this.remove(); | ||
} else if (t.isArrowFunctionExpression(node)) { | ||
if (t.isArrowFunctionExpression(node)) { | ||
node.type = "FunctionExpression"; | ||
@@ -62,0 +81,0 @@ } |
{ | ||
"name": "babel-eslint", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6663
143