babel-eslint
Advanced tools
Comparing version 5.0.0 to 6.0.0-beta.1
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 @@ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
34772
5
10
878
0
0
1
- Removedacorn-to-esprima@^2.0.4
- Removedacorn-to-esprima@2.0.8(transitive)