Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-deprecated: Cannot read property 'namespace' of undefined #370

Closed
wKich opened this issue Jun 6, 2016 · 1 comment
Closed

no-deprecated: Cannot read property 'namespace' of undefined #370

wKich opened this issue Jun 6, 2016 · 1 comment
Labels
Milestone

Comments

@wKich
Copy link
Contributor

wKich commented Jun 6, 2016

If I have this structure of modules

// foo.js
module.exports = { foo: 'foo' }

// bar.js
export { default as foo } from './foo'

// baz.js
import { foo } from './bar'

And try to lint baz.js, I get this:

Cannot read property 'namespace' of undefined
TypeError: Cannot read property 'namespace' of undefined
    at /usr/local/lib/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js:73:35
    at Array.forEach (native)
    at checkSpecifiers (/usr/local/lib/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js:40:21)
    at Array.forEach (native)
    at EventEmitter.Program (/usr/local/lib/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js:89:19)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.enterNode (/usr/local/lib/node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (/usr/local/lib/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:607:
23)
    at CommentEventGenerator.enterNode (/usr/local/lib/node_modules/eslint/lib/util/comment-event-generator.js:97:23)

If I change module.exports to export default in foo.js all works fine.

@benmosher
Copy link
Member

Ah, interesting. Yeah, it can't handle anything but ES modules all the way down if you want good messages, but it definitely shouldn't throw exceptions. Will take a look, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants