better support for import collision checking - todo: check exports for collisions
This commit is contained in:
@@ -50,7 +50,8 @@ DefaultFormatter.prototype.checkImportAssignments = function () {
|
||||
var file = this.file;
|
||||
|
||||
var isLocalReference = function (node, scope) {
|
||||
return t.isIdentifier(node) && localImports[node.name];
|
||||
var localImport = localImports[node.name];
|
||||
return t.isIdentifier(node) && localImport && localImport !== node;
|
||||
};
|
||||
|
||||
var check = function (node) {
|
||||
@@ -69,7 +70,7 @@ DefaultFormatter.prototype.checkImportAssignments = function () {
|
||||
}
|
||||
|
||||
check(left);
|
||||
} else if (t.isDeclaration(node) && !t.isImportDeclaration(node)) {
|
||||
} if (t.isDeclaration(node)) {
|
||||
_.each(t.getIds(node, true), check);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,6 +384,7 @@ t.getIds = function (node, map, ignoreTypes) {
|
||||
|
||||
t.getIds.nodes = {
|
||||
AssignmentExpression: ["left"],
|
||||
ImportBatchSpecifier: ["name"],
|
||||
ImportSpecifier: ["name", "id"],
|
||||
ExportSpecifier: ["name", "id"],
|
||||
VariableDeclarator: ["id"],
|
||||
|
||||
Reference in New Issue
Block a user