Fork me on GitHub

JSLint Error Explanations

JSLint will hurt your feelings. It's time to make them better!


Bad escapement of EOL. Use option multistr if needed

When do I get this error?

JSHint will throw the "Bad escapement of EOL. Use option multistr if needed" error when it encounters a multiline string. In the following example we attempt to assign a multiline string to the variable myString:

Why do I get this error?

This error is raised to highlight the use of a newer language feature that might not be supported in all the environments in which your code should run. In particular, various older browsers will be likely to throw syntax errors when parsing your script.

More detail can be found on the page for the JSLint "This is an ES5 feature" error, since JSLint raises that error in the same situation.

However, to fix this error in JSHint you need to use a different option to JSLint. As the message suggests, you can simply set the multistr option to true:

In JSHint 1.0.0 and above you have the ability to ignore any warning with a special option syntax. The identifier of this warning is W043. This means you can tell JSHint to not issue this warning with the /*jshint -W043 */ directive.


comments powered by Disqus