Trevor Trevor - 6 months ago 28
Javascript Question

Tolerate ++ operator in JSLint plugin for Sublime Text

I use the

plugin for ST (in addition to the
Sublime‚ÄčLinter-jshint
plugin).

I disagree with the theory that the use of
++
or
--
is evil, tricky etc. and use them quite freely. As such I don't appreciate the warning that I should use
+= 1
instead of
++
throughout my code.

I have tried adding the line
/*jslint plusplus: true */
at the beginning of my code as per Unexpected '++' in jslint
but this did not help.

How can I make a global setting for the JSLint ST plugin to tolerate the usage of
++
and
--
?

Answer

I searched through the JSLint repo on Github, and couldn't find any mention of a plusplus option in the current version of jslint.js. So, I did some digging, and found that the plusplus option was removed in this commit on May 1, 2015 (it was still present in the previous commit). Here is Crockford's announcement that he'll be removing that option, among others, in his next release.

Therefore, because this option was removed about a year ago, you just won't be able to use it with current versions of JSLint.

Comments