ilyavolodin / eslint-plugin-backbone

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

"Cannot read property 'name' of undefined" in checkForBackboneType #42

Closed texclayton closed 9 years ago

texclayton commented 9 years ago

We have a unit test that does something similar to: View.extend({ initialize: function () { //do stuff } });

This throws an exception in backbone-helper.js in checkForBackboneType because item.postfix is truthy, but object.property is undefined.

ilyavolodin commented 9 years ago

Thanks for the report. Yes, it's not one of the use cases that I though about. It's supposed to only get triggered by Backbone.View.extend.

ilyavolodin commented 9 years ago

Adam, can you tell me what's in your settings property in .eslintrc? I can't reproduce this issue, but the checkForBackboneType function is driven by settings.

texclayton commented 9 years ago

"settings": { "backbone": { "View": ["View"], "Model": [] } },