babel-eslint
Advanced tools
Comparing version 3.1.13 to 3.1.14
@@ -76,6 +76,2 @@ var traverse = require("babel-core").traverse; | ||
function isCompatTag(tagName) { | ||
return tagName && /^[a-z]|\-/.test(tagName); | ||
} | ||
function convertTemplateType(tokens) { | ||
@@ -128,3 +124,3 @@ var startingToken = 0; | ||
} | ||
} | ||
}; | ||
@@ -179,3 +175,3 @@ // put new token in place of old tokens | ||
noScope: true, | ||
exit: function (node, parent) { | ||
exit: function (node) { /* parent */ | ||
if (this.isSpreadProperty()) { | ||
@@ -182,0 +178,0 @@ node.type = "Property"; |
37
index.js
var acornToEsprima = require("./acorn-to-esprima"); | ||
var traverse = require("babel-core").traverse; | ||
var assign = require("lodash.assign"); | ||
@@ -57,3 +56,3 @@ var pick = require("lodash.pick"); | ||
try { | ||
var referencerLoc = Module._resolveFilename("./referencer", escopeMod); | ||
referencerLoc = Module._resolveFilename("./referencer", escopeMod); | ||
} catch (err) { | ||
@@ -68,3 +67,3 @@ throw new ReferenceError("couldn't resolve escope/referencer"); | ||
try { | ||
var definitionLoc = Module._resolveFilename("./definition", referencerMod); | ||
definitionLoc = Module._resolveFilename("./definition", referencerMod); | ||
} catch (err) { | ||
@@ -151,4 +150,4 @@ throw new ReferenceError("couldn't resolve escope/definition"); | ||
} else if (propertyType.type === "typeParameters") { | ||
for (var j = 0; j < node.typeParameters.params.length; j++) { | ||
checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); | ||
for (var l = 0; l < node.typeParameters.params.length; l++) { | ||
checkIdentifierOrVisit.call(this, node.typeParameters.params[l]); | ||
} | ||
@@ -190,9 +189,9 @@ } else if (propertyType.type === "id") { | ||
if (node.typeParameters) { | ||
for (var i = 0; i < node.typeParameters.params.length; i++) { | ||
checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); | ||
for (var j = 0; j < node.typeParameters.params.length; j++) { | ||
checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); | ||
} | ||
} | ||
if (node.superTypeParameters) { | ||
for (var i = 0; i < node.superTypeParameters.params.length; i++) { | ||
checkIdentifierOrVisit.call(this, node.superTypeParameters.params[i]); | ||
for (var k = 0; k < node.superTypeParameters.params.length; k++) { | ||
checkIdentifierOrVisit.call(this, node.superTypeParameters.params[k]); | ||
} | ||
@@ -227,4 +226,4 @@ } | ||
if (node.typeParameters) { | ||
for (var i = 0; i < node.typeParameters.params.length; i++) { | ||
checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); | ||
for (var j = 0; j < node.typeParameters.params.length; j++) { | ||
checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); | ||
} | ||
@@ -240,6 +239,12 @@ } | ||
for (var i = 0; i < node.declarations.length; i++) { | ||
var type = node.declarations[i].id.typeAnnotation; | ||
if (type) { | ||
checkIdentifierOrVisit.call(this, type); | ||
var id = node.declarations[i].id; | ||
var typeAnnotation = id.typeAnnotation; | ||
if (typeAnnotation) { | ||
checkIdentifierOrVisit.call(this, typeAnnotation); | ||
} | ||
if (id.type === 'ObjectPattern') { | ||
for (var j = 0; j < id.properties.length; j++) { | ||
this.visit(id.properties[j]); | ||
} | ||
} | ||
} | ||
@@ -273,3 +278,3 @@ } | ||
} | ||
} | ||
}; | ||
@@ -292,3 +297,3 @@ referencer.prototype.ComprehensionBlock = function(node) { | ||
} | ||
} | ||
}; | ||
} | ||
@@ -295,0 +300,0 @@ |
{ | ||
"name": "babel-eslint", | ||
"version": "3.1.13", | ||
"version": "3.1.14", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -423,3 +423,3 @@ /*eslint-env mocha*/ | ||
); | ||
}) | ||
}); | ||
@@ -676,3 +676,3 @@ it("10", function () { | ||
"import type Foo from 'foo';", | ||
'var {x}: {x: Foo; } = { x: "hello" }; x;' | ||
"var {x}: {x: Foo; } = { x: 'hello' }; x;" | ||
].join("\n"), | ||
@@ -688,3 +688,3 @@ { "no-unused-vars": 1, "no-undef": 1 }, | ||
"import type Foo from 'foo';", | ||
'var [x]: Array<Foo> = [ "hello" ]; x;' | ||
"var [x]: Array<Foo> = [ 'hello' ]; x;" | ||
].join("\n"), | ||
@@ -770,4 +770,4 @@ { "no-unused-vars": 1, "no-undef": 1 }, | ||
[ | ||
'import type {foo, bar} from "baz";', | ||
'foo; bar;' | ||
"import type {foo, bar} from 'baz';", | ||
"foo; bar;" | ||
].join("\n"), | ||
@@ -782,4 +782,4 @@ { "no-unused-vars": 1, "no-undef": 1 }, | ||
[ | ||
'import type {foo as bar} from "baz";', | ||
'bar;' | ||
"import type {foo as bar} from 'baz';", | ||
"bar;" | ||
].join("\n"), | ||
@@ -794,4 +794,4 @@ { "no-unused-vars": 1, "no-undef": 1 }, | ||
[ | ||
'import type from "foo";', | ||
'type;' | ||
"import type from 'foo';", | ||
"type;" | ||
].join("\n"), | ||
@@ -806,4 +806,4 @@ { "no-unused-vars": 1, "no-undef": 1 }, | ||
[ | ||
'import type, {foo} from "bar";', | ||
'type; foo;' | ||
"import type, {foo} from 'bar';", | ||
"type; foo;" | ||
].join("\n"), | ||
@@ -818,4 +818,4 @@ { "no-unused-vars": 1, "no-undef": 1 }, | ||
[ | ||
'import type * as namespace from "bar";', | ||
'namespace;' | ||
"import type * as namespace from 'bar';", | ||
"namespace;" | ||
].join("\n"), | ||
@@ -1099,4 +1099,12 @@ { "no-unused-vars": 1, "no-undef": 1 }, | ||
[ "1:4 unused is defined but never used no-unused-vars" ] | ||
); | ||
}); | ||
it("visits excluded properties left of spread #95", function () { | ||
verifyAndAssertMessages( | ||
"var originalObject = {}; var {field1, field2, ...clone} = originalObject;", | ||
{ "no-undef": 1, "no-unused-vars": 1 }, | ||
[] | ||
) | ||
}); | ||
}); |
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
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
59092
10
1823