Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-eslint

Package Overview
Dependencies
Maintainers
1
Versions
135
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-eslint - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

51

acorn-to-esprima.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc