简体   繁体   中英

How to disable the Missing "use strict" statement by jshint in Sublime 3?

I have added "strict": false to the default .jshintrc , yet Sublime 3 still shows the "Missing 'use strict'" In-Editor warning.

Any help how to disable this warning?

Here is my complete .jshintrc :

{
  // Details: https://github.com/victorporof/Sublime-JSHint#using-your-own-jshintrc-options
  // Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc
  // Documentation: http://www.jshint.com/docs/
  "browser": true,
  "camelcase": true,
  "devel": true,  // to suppress 'console' and 'alert'
  "esnext": true,
  //"eqnull": true,
  "expr": true, // This option suppresses warnings about the use of expressions
  "globals": {
    "_": false,
    "angular": false
  },
  "globalstrict": false,
  "strict": false,
  "predef": ["angular"],
  "quotmark": true,
  "smarttabs": true,
  "trailing": true,
  "undef": true,
  "unused": true
}

You need go to sublime text3 > preferences > package settings > jshint gutter > set linting preferences and in this file .jshintrc change option "strict": "false". Then restart you sublimeText3

正如 andlrc 所述,最简单的解决方案是指定 jshint 通过在文件顶部添加来跳过对该文件的严格限制:

/* jshint strict: false */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM