diff --git a/src/rules/namespace.js b/src/rules/namespace.js index 9033871d4..74e45ccaf 100644 --- a/src/rules/namespace.js +++ b/src/rules/namespace.js @@ -131,11 +131,12 @@ exports.create = function namespaceRule(context) { break } - if (namespace.get(dereference.property.name) == null) return + const exported = namespace.get(dereference.property.name) + if (exported == null) return // stash and pop namepath.push(dereference.property.name) - namespace = namespace.get(dereference.property.name).namespace + namespace = exported.namespace dereference = dereference.parent }