admin管理员组

文章数量:1405132

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 plete .jshintrc:

{
  // Details: 
  // Example: /.jshintrc
  // Documentation: /
  "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
}

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 plete .jshintrc:

{
  // Details: https://github./victorporof/Sublime-JSHint#using-your-own-jshintrc-options
  // Example: https://github./jshint/jshint/blob/master/examples/.jshintrc
  // Documentation: http://www.jshint./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
}
Share Improve this question asked Nov 16, 2015 at 9:24 Dmitri ZaitsevDmitri Zaitsev 14.1k12 gold badges78 silver badges114 bronze badges 2
  • 5 The above config should work, if you want to disable / enable strict mode on a single file you can write: /* jshint strict: false */ – Andreas Louv Commented Nov 16, 2015 at 9:30
  • 1 It seems other people have had this issue. Are you using the latest version of Sublime Linter? – Saad Commented Nov 16, 2015 at 9:32
Add a ment  | 

2 Answers 2

Reset to default 3

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

As stated by andlrc, the simpliest solution would be to specify to jshint to skip strict restriction on this file by adding at the top of it :

/* jshint strict: false */

本文标签: javascriptHow to disable the Missing quotuse strictquot statement by jshint in Sublime 3Stack Overflow