Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable "use the function form of use strict" but keep the "Missing 'use strict' statement" warning

I am using jslint to validate my code.
I have "use strict" on all my pages.
How can I disable the message "use the function form of 'use strict'" but keep the "Missing 'use strict' statement" warning, so I won't forget to put it on new files?

Thanks

like image 932
Randall Flagg Avatar asked Jan 21 '12 14:01

Randall Flagg


1 Answers

According to Crockford's post, you'll want to wrap everything in a function...

(function () {
    "use strict";
    // the rest of your file goes here...
}());

You could also use jshint instead, which has a "globalstrict" option that can do exactly what you're asking for without having to wrap everything in a function

like image 119
Paul Armstrong Avatar answered Oct 11 '22 13:10

Paul Armstrong