Socket
Socket
Sign inDemoInstall

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 5.0.0 to 6.0.0-beta.1

babylon-to-espree/attachComments.js

24

index.js

@@ -1,2 +0,2 @@

var acornToEsprima = require("acorn-to-esprima");
var babylonToEspree = require("./babylon-to-espree");
var assign = require("lodash.assign");

@@ -383,3 +383,5 @@ var pick = require("lodash.pick");

exports.parse = function (code) {
exports.parse = function (code, options) {
options = options || {};
try {

@@ -392,8 +394,8 @@ monkeypatch();

return exports.parseNoPatch(code);
return exports.parseNoPatch(code, options);
}
exports.parseNoPatch = function (code) {
exports.parseNoPatch = function (code, options) {
var opts = {
sourceType: "module",
sourceType: options.sourceType || "module",
strictMode: true,

@@ -427,3 +429,3 @@ allowImportExportEverywhere: false, // consistent with espree

err.lineNumber = err.loc.line;
err.column = err.loc.column;
err.column = err.loc.column + 1;

@@ -443,9 +445,9 @@ // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start

// convert tokens
ast.tokens = acornToEsprima.toTokens(ast.tokens, tt, code);
ast.tokens = babylonToEspree.toTokens(ast.tokens, tt, code);
// add comments
acornToEsprima.convertComments(ast.comments);
babylonToEspree.convertComments(ast.comments);
// transform esprima and acorn divergent nodes
acornToEsprima.toAST(ast, traverse, code);
babylonToEspree.toAST(ast, traverse, code);

@@ -457,3 +459,3 @@ // ast.program.tokens = ast.tokens;

// remove File
ast.type = 'Program';
ast.type = "Program";
ast.sourceType = ast.program.sourceType;

@@ -465,5 +467,5 @@ ast.directives = ast.program.directives;

acornToEsprima.attachComments(ast, ast.comments, ast.tokens);
babylonToEspree.attachComments(ast, ast.comments, ast.tokens);
return ast;
}
{
"name": "babel-eslint",
"version": "5.0.0",
"description": "",
"version": "6.0.0-beta.1",
"description": "Custom parser for ESLint",
"main": "index.js",
"files": [
"index.js"
"index.js",
"babylon-to-espree"
],

@@ -14,3 +15,2 @@ "repository": {

"dependencies": {
"acorn-to-esprima": "^2.0.4",
"babel-traverse": "^6.0.20",

@@ -26,3 +26,4 @@ "babel-types": "^6.0.19",

"test": "mocha",
"lint": "./node_modules/eslint/bin/eslint.js ./test index.js acorn-to-esprima.js",
"lint": "./node_modules/eslint/bin/eslint.js index.js babylon-to-espree test",
"fix": "./node_modules/eslint/bin/eslint.js index.js babylon-to-espree test --fix",
"preversion": "npm test"

@@ -37,6 +38,6 @@ },

"devDependencies": {
"eslint": "^1.10.2",
"espree": "^2.2.5",
"eslint": "^2.0.0",
"espree": "^3.0.0",
"mocha": "^2.3.3"
}
}

@@ -46,3 +46,3 @@ # babel-eslint [![Build Status][travis-image]][travis-url]

```sh
$ npm install eslint babel-eslint --save-dev
$ npm install eslint@1.x babel-eslint --save-dev
```

@@ -49,0 +49,0 @@

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