javascript - How to disable "use strict" in JSHint - Stack Overflow

I'd like to eliminate the 'Missing "use strict" statement.' warning that JSHin

I'd like to eliminate the 'Missing "use strict" statement.' warning that JSHint shows in my .js files. Now, I want to keep the rest of the functionality intact, and I want a global way to disable the "use strict;" thing, because inserting the "use strict" mand into every file is not an option for me.

I haven't been able to find any solutions that don't involve adding "use strict;" to each file, so I'm hoping this question will point me in the right direction.

Thanks.

I'd like to eliminate the 'Missing "use strict" statement.' warning that JSHint shows in my .js files. Now, I want to keep the rest of the functionality intact, and I want a global way to disable the "use strict;" thing, because inserting the "use strict" mand into every file is not an option for me.

I haven't been able to find any solutions that don't involve adding "use strict;" to each file, so I'm hoping this question will point me in the right direction.

Thanks.

Share Improve this question asked Jun 22, 2016 at 20:08 Justin CarraoJustin Carrao 451 silver badge3 bronze badges 1
  • 1 jshint./docs/options/#strict – acupofjose Commented Jun 22, 2016 at 20:10
Add a ment  | 

1 Answer 1

Reset to default 4

Just set strict option to false, for more details look http://jshint./docs/options/#strict

false - disable warnings about strict mode


This option requires the code to run in ECMAScript 5's strict mode. Strict mode is a way to opt in to a restricted variant of JavaScript. Strict mode eliminates some JavaScript pitfalls that didn't cause errors by changing them to produce errors. It also fixes mistakes that made it difficult for the JavaScript engines to perform certain optimizations.

  • "global" - there must be a "use strict"; directive at global level
  • "implied" - lint the code as if there is the "use strict"; directive
  • false - disable warnings about strict mode
  • true - there must be a "use strict"; directive at function level; this is preferable for scripts intended to be loaded in web browsers directly because enabling strict mode globally could adversely effect other scripts running on the same page

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744805872a4594768.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信