node.js - Is it possible to check JavaScript files with node and get errors when a semicolon is missing? -


i use following command before sending js files server:

node --check <filename>.js 

that way can sure there no gross errors before forwarding file server (i.e. missing ')' generates error).

what noticed, though, node.js not give me error if not put semicolon @ end of line. happen, looking @ command line options, cannot see such feature.

is there way node.js?

what noticed, though, node.js not give me error if not put semicolon @ end of line.

that's because javascript has error-correction mechanism called automatic semicolon insertion (see this question's answers more asi), parser insert semicolons token stream if they're missing in many cases. node isn't going give information.

i recommend using proper lint tool instead, such eslint, jshint, or of several others.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -