
org.sonar.l10n.javascript.rules.javascript.S2508.html Maven / Gradle / Ivy
When using the Backbone.js framework, the names of model attributes should not contain spaces. This is because the Events object accepts space-delimited lists of events, so an attributes with spaces in the names could be misinterpreted.
Noncompliant Code Example
Person = Backbone.Model.extend({
defaults: {
'first name': 'Bob', // Noncompliant
'birth date': new Date() // Noncompliant
},
});
Compliant Solution
Person = Backbone.Model.extend({
defaults: {
firstName: 'Bob',
birthDate: new Date()
},
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy