babel-eslint
Advanced tools
Comparing version 5.0.0-beta9 to 5.0.0
21
index.js
@@ -50,4 +50,8 @@ var acornToEsprima = require("acorn-to-esprima"); | ||
// contains all the instances of estraverse so we can modify them if necessary | ||
var estraverses = []; | ||
// monkeypatch estraverse | ||
estraverse = estraverseRelative.require("estraverse"); | ||
estraverses.push(estraverse); | ||
assign(estraverse.VisitorKeys, t.VISITOR_KEYS); | ||
@@ -57,2 +61,3 @@ | ||
var estraverseFb = eslintMod.require("estraverse-fb"); | ||
estraverses.push(estraverseFb); | ||
assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); | ||
@@ -63,2 +68,3 @@ | ||
if (estraverseOfEslint !== estraverseFb) { | ||
estraverses.push(estraverseOfEslint); | ||
assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); | ||
@@ -86,3 +92,3 @@ } | ||
var referencer = require(referencerLoc); | ||
if (typeof referencer === 'object' && referencer.default) { | ||
if (referencer.__esModule) { | ||
referencer = referencer.default; | ||
@@ -99,3 +105,3 @@ } | ||
patternVisitor = require(patternVisitorLoc); | ||
if (typeof patternVisitor === 'object' && patternVisitor.default) { | ||
if (patternVisitor.__esModule) { | ||
patternVisitor = patternVisitor.default; | ||
@@ -287,3 +293,14 @@ } | ||
} | ||
// set ArrayPattern/ObjectPattern visitor keys back to their original. otherwise | ||
// escope will traverse into them and include the identifiers within as declarations | ||
estraverses.forEach(function (estraverse) { | ||
estraverse.VisitorKeys.ObjectPattern = ["properties"]; | ||
estraverse.VisitorKeys.ArrayPattern = ["elements"]; | ||
}); | ||
visitFunction.call(this, node); | ||
// set them back to normal... | ||
estraverses.forEach(function (estraverse) { | ||
estraverse.VisitorKeys.ObjectPattern = t.VISITOR_KEYS.ObjectPattern; | ||
estraverse.VisitorKeys.ArrayPattern = t.VISITOR_KEYS.ArrayPattern; | ||
}); | ||
if (typeParamScope) { | ||
@@ -290,0 +307,0 @@ this.close(node); |
{ | ||
"name": "babel-eslint", | ||
"version": "5.0.0-beta9", | ||
"version": "5.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"repository": { | ||
@@ -7,0 +10,0 @@ "type": "git", |
@@ -6,3 +6,3 @@ # babel-eslint [![Build Status][travis-image]][travis-url] | ||
`babel-eslint` is successfully linting [babel core](https://github.com/babel/babel/blob/master/.eslintrc) and many other projects. | ||
`babel-eslint` is successfully linting babel and many other projects. | ||
@@ -39,2 +39,5 @@ > If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! | ||
Basically `babel-eslint` exports an [`index.js`](/index.js) that a linter can use. | ||
It just needs to export a `parse` method that takes in a string of code and outputs an AST. | ||
## Usage | ||
@@ -45,3 +48,3 @@ | ||
```sh | ||
$ npm install -g eslint babel-eslint | ||
$ npm install eslint babel-eslint --save-dev | ||
``` | ||
@@ -48,0 +51,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
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
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
0
72
5
19706
4
420
1
1