ilyavolodin / eslint-plugin-backbone

Backbone specific linting rules for ESLint
MIT License
95 stars 11 forks source link

Exporting a variable called events causes an error #66

Closed jbeezley closed 7 years ago

jbeezley commented 8 years ago
var events = {};
export default events;

results in the following stack trace:

TypeError: Cannot read property 'type' of null
    at isBackboneBase (node_modules/eslint-plugin-backbone/lib/backbone-helper.js:9:16)
    at isBackboneView (node_modules/eslint-plugin-backbone/lib/backbone-helper.js:56:12)
    at Object.exports.checkIfPropertyInBackboneView (node_modules/eslint-plugin-backbone/lib/backbone-helper.js:91:12)
    at EventEmitter.Identifier (node_modules/eslint-plugin-backbone/lib/rules/events-on-top.js:43:32)
    at emitOne (events.js:95:20)
    at EventEmitter.emit (events.js:182:7)
    at NodeEventGenerator.enterNode (node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)
    at CommentEventGenerator.enterNode (node_modules/eslint/lib/util/comment-event-generator.js:97:23)
    at Controller.enter (node_modules/eslint/lib/eslint.js:895:36)