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

babel-eslint

Package Overview
Dependencies
Maintainers
2
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 3.1.7 to 3.1.8

17

acorn-to-esprima.js

@@ -83,4 +83,6 @@ var traverse = require("babel-core").traverse;

var currentToken = 0;
// track use of {}
var numBraces = 0;
var hasTemplateEnded = true;
// track number of nested templates
var numBackQuotes = 0;

@@ -93,3 +95,4 @@ function isBackQuote(token) {

return isBackQuote(token) ||
tokens[token].type === tt.braceR;
// only can be a template starter when in a template already
tokens[token].type === tt.braceR && numBackQuotes > 0;
}

@@ -143,2 +146,6 @@

if (isTemplateStarter(startingToken) && numBraces === 0) {
if (isBackQuote(startingToken)) {
numBackQuotes++;
}
currentToken = startingToken + 1;

@@ -159,6 +166,8 @@

hasTemplateEnded = isBackQuote(currentToken);
if (isBackQuote(currentToken)) {
numBackQuotes--;
}
// template start and end found: create new token
replaceWithTemplateType(startingToken, currentToken);
} else if (!hasTemplateEnded) {
} else if (numBackQuotes > 0) {
trackNumBraces(startingToken);

@@ -165,0 +174,0 @@ }

{
"name": "babel-eslint",
"version": "3.1.7",
"version": "3.1.8",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,2 +9,4 @@ # babel-eslint [![Build Status][travis-image]][travis-url]

If there's an issue, check if it can be reproduced with the regular parser and with the latest versions of `eslint` and `babel-eslint`. For issues related to JSX, see if [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) helps!
## How does it work?

@@ -11,0 +13,0 @@

@@ -36,12 +36,25 @@ var babelEslint = require("..");

var esAST = espree.parse(code, {
env: {
"es6": true,
"node": true
},
ecmaFeatures: {
arrowFunctions: true,
blockBindings: true,
destructuring: true,
regexYFlag: true,
regexUFlag: true,
templateStrings: true,
binaryLiterals: true,
octalLiterals: true,
unicodeCodePointEscapes: true,
defaultParams: true,
restParams: true,
forOf: true,
objectLiteralComputedProperties: true,
objectLiteralShorthandMethods: true,
objectLiteralShorthandProperties: true,
objectLiteralDuplicateProperties: true,
generators: true,
spread: true,
classes: true,
modules: true,
classes: true,
jsx: true
jsx: true,
globalReturn: true
},

@@ -128,2 +141,13 @@ tokens: true,

});
it("template with destructuring #31", function () {
parseAndAssertSame([
"module.exports = {",
"render() {",
"var {name} = this.props;",
"return Math.max(null, `Name: ${name}, Name: ${name}`);",
"}",
"};"
].join("\n"));
});
});

@@ -130,0 +154,0 @@

@@ -167,2 +167,15 @@ /*eslint-env mocha*/

it("template with destructuring #31", function () {
verifyAndAssertMessages([
"module.exports = {",
"render() {",
"var {name} = this.props;",
"return Math.max(null, `Name: ${name}, Name: ${name}`);",
"}",
"};"].join("\n"),
{ "comma-spacing": 1 },
[]
);
});
describe("decorators #72", function () {

@@ -169,0 +182,0 @@ it("class declaration", function () {

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