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
I use acorn:
$ acorn --silent tests/files/js-error.js; echo $? Unexpected token (1:14) 1 $ acorn --silent tests/files/js-ok.js; echo $? 0
Install via: npm -g install acorn.
npm -g install acorn