quick-lint-js

Find bugs in JavaScript programs.

E0062: missing name or parentheses for function

If a statement begins with the function keyword, the declared function must have a name. It is an error to start a statement with function but not give a name to the function:

function() {  // IIFE for our module
  class PublicClass {}
  class PrivateClass {}
  window.PublicClass = PublicClass;
}()

To fix this error, wrap the IIFE (Immediately Invoked Function Expression) in parentheses:

(function() {  // IIFE for our module
  class PublicClass {}
  class PrivateClass {}
  window.PublicClass = PublicClass;
}())

Introduced in quick-lint-js version 0.2.0.

Documentation for other errors