Skip to content

Commit

Permalink
fixes #348
Browse files Browse the repository at this point in the history
  • Loading branch information
benmosher committed Jun 21, 2016
1 parent 1e05a0f commit 66c84ea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/core/getExports.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,11 @@ export default class ExportMap {
this.namespace.forEach((v, n) =>
callback.call(thisArg, v, n, this))

this.reexports.forEach(({ getImport, local }, name) =>
callback.call(thisArg, getImport().get(local), name, this))
this.reexports.forEach(({ getImport, local }, name) => {
const reexported = getImport()
// can't look up meta for ignored re-exports (#348)
callback.call(thisArg, reexported && reexported.get(local), name, this)
})

this.dependencies.forEach(dep => dep().forEach((v, n) =>
n !== 'default' && callback.call(thisArg, v, n, this)))
Expand Down
4 changes: 3 additions & 1 deletion tests/src/rules/export.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test } from '../utils'
import { test, SYNTAX_CASES } from '../utils'

import { RuleTester } from 'eslint'

Expand All @@ -24,6 +24,8 @@ ruleTester.run('export', rule, {

// #328: "export * from" does not export a default
test({ code: 'export default foo; export * from "./bar"' }),

...SYNTAX_CASES,
],

invalid: [
Expand Down
6 changes: 6 additions & 0 deletions tests/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,10 @@ export const SYNTAX_CASES = [
code: 'import { foo } from "./issue-370-commonjs-namespace/bar"',
settings: { 'import/ignore': ['foo'] },
}),

// issue #348: deep commonjs re-export
test({
code: 'export * from "./issue-370-commonjs-namespace/bar"',
settings: { 'import/ignore': ['foo'] },
}),
]

0 comments on commit 66c84ea

Please sign in to comment.