JavaScript programs can be checked for errors in IDEs or using online web apps but I\'m looking for a way to detect syntax errors alone.
I\'ve tried JSLint and
The solution is to enable jshint's --verbose option, which shows the error or warning code (e.g. E020 for Expected '}' to match '{' or W110 for Mixed double and single quotes), then grep for errors only:
--verbose
E020
Expected '}' to match '{'
W110
Mixed double and single quotes
jshint --verbose test.js | grep -E E[0-9]+.$