requireAnonymousFunctions

Requires that a function expression be anonymous.

Type: Boolean

Values:

  • true
  • Object:
    • 'allExcept' array of exceptions:
      • 'declarations' ignores function declarations

Example

"requireAnonymousFunctions": true
Valid
var a = function() {

};

$('#foo').click(function() {

})
Invalid
var a = function foo() {

};

$('#foo').click(function bar() {

});
Valid for { "allExcept": ["declarations"] }
function foo() {

}

$('#foo').click(function() {

})
Rule source
Test source