I have the same error when I run jshint app.js or use Sublime 2.0 with sublimelinter.
My configuration looks very similar in sublimelinter and in package.json:
"evil": true,
"regexdash": true,
"browser": true,
"wsh": true,
"trailing": true,
"sub": true,
"predef": ["angular"],
"globalstrict": true,
"node": true,
"strict": true,
"es5": true,
"predef": {
"angular": true
}
My code:
'use strict';
// Declare app level module which depends on filters, and services
angular.module('myApp', [
'ngRoute',
'myApp.filters',
'myApp.services',
'myApp.directives',
'myApp.controllers'
]).
config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: 'MyCtrl1'});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: 'MyCtrl2'});
$routeProvider.otherwise({redirectTo: '/view1'});
}]);
This error is very annoying Use the function form of "use strict" How can I configure jshint in sublimelinter and package.json (jshint) to do not show this error again ?