Skip to content

Commit

Permalink
[Fix] named, namespace: properly handle ExportAllDeclarations
Browse files Browse the repository at this point in the history
Fixes #2199
  • Loading branch information
ljharb committed Aug 24, 2021
1 parent 51d3973 commit 033ba64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,9 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel

## [Unreleased]

### Fixes
- [`named`], [`namespace`]: properly handle ExportAllDeclarations ([#2199], thanks [@ljharb])

## [2.24.1] - 2021-08-19

### Fixed
Expand Down Expand Up @@ -1152,6 +1155,7 @@ for info on changes for earlier releases.
[#164]: https://github.com/import-js/eslint-plugin-import/pull/164
[#157]: https://github.com/import-js/eslint-plugin-import/pull/157
[#2201]: https://github.com/import-js/eslint-plugin-import/issues/2201
[#2199]: https://github.com/import-js/eslint-plugin-import/issues/2199
[#2161]: https://github.com/import-js/eslint-plugin-import/issues/2161
[#2118]: https://github.com/import-js/eslint-plugin-import/issues/2118
[#2067]: https://github.com/import-js/eslint-plugin-import/issues/2067
Expand Down
6 changes: 3 additions & 3 deletions src/ExportMap.js
Expand Up @@ -421,7 +421,7 @@ ExportMap.parse = function (path, content, context) {

switch (s.type) {
case 'ExportDefaultSpecifier':
if (!n.source) return;
if (!nsource) return;
local = 'default';
break;
case 'ExportNamespaceSpecifier':
Expand All @@ -430,8 +430,8 @@ ExportMap.parse = function (path, content, context) {
}));
return;
case 'ExportAllDeclaration':
local = s.exported ? s.exported.name : s.local.name;
break;
m.namespace.set(s.exported.name, addNamespace(exportMeta, s.source.value));
return;
case 'ExportSpecifier':
if (!n.source) {
m.namespace.set(s.exported.name, addNamespace(exportMeta, s.local));
Expand Down

0 comments on commit 033ba64

Please sign in to comment.