Ah, try adjusting the comment to /*jslint es6 */. I suspect it will still break, jslint is very old and has been superceded (first by jshint, now eslint), it isn’t commonly used at all. Although Douglas Crockford does still seem to be maintaining it, the test validator on his site doesn’t recognise several things for me (it completely blows up when I try to ise class for example).
Ah, I missed that. That’s seems really bad rule if it’s not overridable, given that arrow functions are to avoid issues with this as well!
I didn’t know that was a jslint rule, but that is my personal (usual) policy: an arrow for single line function for multi line. Granted I’m not hard and fast on that, and as you mentioned there are things like playing with this that make you want to change it up. Honestly, I mostly do it that way cause I think it’s prettier.
A bit “old man shouting at the kids to get off his lawn” now though. Doesn’t like [eg] classes (for fairly reasonable reasons!), but that means his linter just forbids using them, so it’s kinda useless unless you’re writing all of the code according to his fairly strict principles 🤷
Again, though, in the case of jslint, he invented the game, so he gets to set the rules. Coders in the trenches may see him as a crank, but management and others in the pseudo-know like the red tape he (and jslint) provides.
It’s summed up in this quote, I think, also from that page:
JSLint will reject most legal programs. It is a higher standard.
Anyway, we may be getting off-topic. In summary, jslint doesn’t like arrow functions in their expanded format, by the conscious choice of its creator.