Skip to content

Commit

Permalink
add test and fix for re-exported commonjs modules
Browse files Browse the repository at this point in the history
  • Loading branch information
redbugz committed Dec 12, 2019
1 parent dca645e commit 6c30aa6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ExportMap.js
Expand Up @@ -106,6 +106,7 @@ export default class ExportMap {
if (name !== 'default') {
for (let dep of this.dependencies) {
let innerMap = dep()
if (innerMap == null) return { found: true, path: [this] }
// todo: report as unresolved?
if (!innerMap) continue

Expand Down
1 change: 1 addition & 0 deletions tests/src/rules/named.js
Expand Up @@ -26,6 +26,7 @@ ruleTester.run('named', rule, {
test({code: 'import { destructingRenamedAssign } from "./named-exports"'}),
test({code: 'import { ActionTypes } from "./qc"'}),
test({code: 'import {a, b, c, d} from "./re-export"'}),
test({code: 'import {a, b, c} from "./re-export-common"'}),
test({code: 'import {RuleTester} from "./re-export-node_modules"'}),

test({ code: 'import { jsxFoo } from "./jsx/AnotherComponent"'
Expand Down

0 comments on commit 6c30aa6

Please sign in to comment.