eslint-plugin-backbone
Advanced tools
Comparing version
@@ -0,0 +0,0 @@ # Require all collections to declare model (collection-model) |
@@ -0,0 +0,0 @@ # Require defaults to be on top of the model (defaults-on-top) |
@@ -0,0 +0,0 @@ # Verify that scope is passed into event handlers (event-scope) |
@@ -0,0 +0,0 @@ # Events should be the first thing registered in the View (events-on-top) |
@@ -0,0 +0,0 @@ # Requires initialize to be the first property of Backbone Views/Models/Collections (initialize-on-top) |
@@ -0,0 +0,0 @@ # Require all models to have defaults section (model-defaults) |
@@ -0,0 +0,0 @@ # Prevent setting changed attribute of the model in views (no-changed-set) |
@@ -0,0 +0,0 @@ # Prevent access to models property of collections (no-collection-models) |
@@ -0,0 +0,0 @@ # Prevent assigning el or $el inside views (no-el-assign) |
@@ -0,0 +0,0 @@ # Prevent access to attributes collection inside models (no-model-attributes) |
@@ -0,0 +0,0 @@ # Prevent usage of $ in the views (no-native-jquery) |
@@ -0,0 +0,0 @@ # Prevent using silent option in functions that cause events (no-silent) |
@@ -0,0 +0,0 @@ # Prevent access to collection's models property inside views (no-view-collection-models) |
@@ -0,0 +0,0 @@ # Prevent access to model's attributes collection inside views (no-view-model-attributes) |
@@ -0,0 +0,0 @@ # Prevent using on/off bindings inside views (no-view-onoff-binding) |
@@ -0,0 +0,0 @@ # Enforces render function to always return this (render-return) |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -18,5 +18,2 @@ function isBackboneBase(node, settings) { | ||
return settings.map(function(setting) { | ||
if (typeof setting === "object") { | ||
return setting; | ||
} | ||
var splitValue = setting.split("."); | ||
@@ -27,10 +24,12 @@ return splitValue.length > 1 ? { prefix: splitValue[0], postfix: splitValue[1] } : { prefix: splitValue[0] }; | ||
function normalizeSettings(settings) { | ||
function normalizeSettings(originalSettings) { | ||
"use strict"; | ||
settings = settings || {}; | ||
settings.Collection = settings.Collection ? settings.Collection.concat("Backbone.Collection") : ["Backbone.Collection"]; | ||
originalSettings = originalSettings || {}; | ||
var settings = {}; | ||
settings.Collection = originalSettings.Collection ? originalSettings.Collection.concat("Backbone.Collection") : ["Backbone.Collection"]; | ||
settings.Collection = parseSettings(settings.Collection); | ||
settings.Model = settings.Model ? settings.Model.concat("Backbone.Model") : ["Backbone.Model"]; | ||
settings.Model = originalSettings.Model ? originalSettings.Model.concat("Backbone.Model") : ["Backbone.Model"]; | ||
settings.Model = parseSettings(settings.Model); | ||
settings.View = settings.View ? settings.View.concat("Backbone.View") : ["Backbone.View"]; | ||
settings.View = originalSettings.View ? originalSettings.View.concat("Backbone.View") : ["Backbone.View"]; | ||
settings.View = parseSettings(settings.View); | ||
@@ -37,0 +36,0 @@ return settings; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
{ | ||
"name": "eslint-plugin-backbone", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Eslint rules for Backbone.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -29,3 +29,4 @@ /** | ||
"var a=6 * 7;", | ||
"Backbone.Model.extend({ defaults: {}, initialize: function() { alert(); } });" | ||
"Backbone.Model.extend({ defaults: {}, initialize: function() { alert(); } });", | ||
{ code: "Model.extend({ initialize: function() { }, defaults: {} });", settings: { backbone: { Model: ["Model"] } }} | ||
], | ||
@@ -32,0 +33,0 @@ |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
92168
-2.19%1491
-0.07%