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) {
|
||||
checkIdentifierOrVisit.call(this, typeAnnotation);
|
||||
}
|
||||
if (!patternVisitor) {
|
||||
// Old method. Once escope in eslint is updated, this code is not necessary.
|
||||
if (id.type === "ObjectPattern") {
|
||||
// check if object destructuring has a spread
|
||||
var hasSpread = id.properties.filter(function(p) {
|
||||
return p._babelType === "SpreadProperty";
|
||||
});
|
||||
// visit properties if so
|
||||
if (hasSpread.length > 0) {
|
||||
for (var j = 0; j < id.properties.length; j++) {
|
||||
this.visit(id.properties[j]);
|
||||
}
|
||||
if (id.type === "ObjectPattern") {
|
||||
// check if object destructuring has a spread
|
||||
var hasSpread = id.properties.filter(function(p) {
|
||||
return p._babelType === "SpreadProperty";
|
||||
});
|
||||
// visit properties if so
|
||||
if (hasSpread.length > 0) {
|
||||
for (var j = 0; j < id.properties.length; j++) {
|
||||
this.visit(id.properties[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user