Skip to content

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

Description

@wKich

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions