Merge pull request babel/babel-eslint#212 from evocateur/fix-with-latest-eslint
Avoid errors with eslint 1.10.x when excluding destructured properties
This commit is contained in:
parent
0859607b4e
commit
3d901f5960
@ -295,18 +295,15 @@ function monkeypatch() {
|
|||||||
if (typeAnnotation) {
|
if (typeAnnotation) {
|
||||||
checkIdentifierOrVisit.call(this, typeAnnotation);
|
checkIdentifierOrVisit.call(this, typeAnnotation);
|
||||||
}
|
}
|
||||||
if (!patternVisitor) {
|
if (id.type === "ObjectPattern") {
|
||||||
// Old method. Once escope in eslint is updated, this code is not necessary.
|
// check if object destructuring has a spread
|
||||||
if (id.type === "ObjectPattern") {
|
var hasSpread = id.properties.filter(function(p) {
|
||||||
// check if object destructuring has a spread
|
return p._babelType === "SpreadProperty";
|
||||||
var hasSpread = id.properties.filter(function(p) {
|
});
|
||||||
return p._babelType === "SpreadProperty";
|
// visit properties if so
|
||||||
});
|
if (hasSpread.length > 0) {
|
||||||
// visit properties if so
|
for (var j = 0; j < id.properties.length; j++) {
|
||||||
if (hasSpread.length > 0) {
|
this.visit(id.properties[j]);
|
||||||
for (var j = 0; j < id.properties.length; j++) {
|
|
||||||
this.visit(id.properties[j]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user