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 回答1: 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