My understanding is a defensive defensive semicolon is needed before a line that starts with an open parenthesis, such as an immediately executed anonymous function:
;(function() {})();
But I don't see why it would be needed before var. I'm asking because currently there is no way for plates.js to pass jshint without removing the semicolon. I requested a jshint option to be more lenient on defensive semicolons, but @antonkovalyov didn't see the reasoning either and it was understandably rejected:
https://github.com/jshint/jshint/issues/487
If there is a good reason for it, let me know, and I'll reopen the jshint issue.
Apologies in advance for nit-picking, but is there a specific scenario where the defensive semicolon at the beginning of
plates.js
is necessary?My understanding is a defensive defensive semicolon is needed before a line that starts with an open parenthesis, such as an immediately executed anonymous function:
But I don't see why it would be needed before
var
. I'm asking because currently there is no way forplates.js
to pass jshint without removing the semicolon. I requested a jshint option to be more lenient on defensive semicolons, but @antonkovalyov didn't see the reasoning either and it was understandably rejected: https://github.com/jshint/jshint/issues/487If there is a good reason for it, let me know, and I'll reopen the jshint issue.