Why does JSHint throw a warning if I am using const?

When relying upon ECMAScript 6 features such as const, you should set this option so JSHint doesn’t raise unnecessary warnings. /*jshint esnext: true */ (Edit 2015.12.29: updated syntax to reflect @Olga’s comments) This option, as the name suggests, tells JSHint that your code uses ECMAScript 6 specific syntax. http://jshint.com/docs/options/#esversion Edit 2017.06.11: added another option based on this answer. While inline … Read more

Should I use JSLint or JSHint JavaScript validation?

[EDIT]This answer has been edited. I’m leaving the original answer below for context (otherwise the comments wouldn’t make sense). When this question was originally asked, JSLint was the main linting tool for JavaScript. JSHint was a new fork of JSLint, but had not yet diverged much from the original. Since then, JSLint has remained pretty … Read more