Search code examples
javascriptangularjsjslint

Expected an assignment or function call and instead saw an expression with Angular


I'm using [JSLint][1] with ES6 style IIFE's in my Angular App and I get this error:

Expected an assignment or function call and instead saw an expression

On the following code:

{
  'use strict';
   angular.module('MyModule', []);
}

Should I omit 'use strict' in this case?


Solution

  • You don't need the { and }, it should work then.