When creating a Backbone model, you should always specify defaults. While this is not required by Backbone itself, it increases readability of the code and helps clearly identify properties that should be expected to be in the model. If the model is served from the server-side as JSON, it's sometimes very hard to understand which properties can be expected to be available.
This rule aims to verify that every Backbone model has defaults declared
The following patterns are considered warnings:
Backbone.Model.extend({
initialize: function() { ... }
});
The following patterns are not warnings:
Backbone.Model.extend({
initialize: function() { ... },
defaults: { ... }
})
When the models are created purely on the client-side or when models are created empty.