22

When using "unsafe characters" (e.g. umlauts) in comments I get the following error:

This character may get silently deleted by one or more browsers.

Is there any way to disable this check for comments (globally)?

Morten Siebuhr
  • 6,068
  • 4
  • 31
  • 43
jpo
  • 2,550
  • 2
  • 19
  • 16
  • "messy white space" , don't know why but that's the one. – Benjamin Gruenbaum May 24 '13 at 12:47
  • 1
    @BenjaminGruenbaum: unfortunately does not work for me: `white: false` gives me the exact same error messages, `white: true` results in many additional errors on top. – jpo May 27 '13 at 09:31

3 Answers3

29

I fixed it in one specific file by adding /* jshint -W100 */ in the top of the file.

To ignore it globally, I guess you have to add it somewhere in .jshintrc (though I don't know where).

Morten Siebuhr
  • 6,068
  • 4
  • 31
  • 43
15

I was able to fix this problem by saving the document as UTF-8.

I have several files all created the same way, three of them are giving me this error using gulp + jslint, I dont know why but I managed to get rid of the error in Sublime Text by going to:

File > Save with Encoding > UTF-8

Errors magically disappear!

Fasani
  • 5,141
  • 1
  • 23
  • 24
  • In Visual Studio, select File -> Advanced Save Options... -> Choose 'Unicode (UTF-8 with signature).." – martinoss Aug 12 '15 at 16:52
  • Correction, in Visual Studio, select File -> Advanced Save Options... -> Choose 'Unicode (UTF-8 _without_ signature)...' – a11smiles Jan 19 '16 at 03:35
0

I solve this problem as follows ... in jshint.js change the lines

char = this.scanUnsafeChars();

if (char >= 0) {
     this.trigger("warning", 
     { code: "W100", line: this.line, character: char });
}

to

char = this.scanUnsafeChars();

if (char >= 0) {
  var inCommentW100 = this.inComment ||
    startsWith.call(inputTrimmed, "//") ||
    startsWith.call(inputTrimmed, "/*");

  if(!inCommentW100) {
     this.trigger("warning", 
        { code: "W100", line: this.line, character: char });
  }
}
mmso
  • 1