ilyavolodin / eslint-plugin-backbone

Backbone specific linting rules for ESLint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

texclayton opened this issue · comments

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.

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.

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.

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