Use Node.js's built-in syntax error checker on your entire project
This is academic, not practical. If you want to lint your entire codebase, use something like ESLint instead.
I was writing some content about linters and was curious, does Node.js have a built-in linter? It does, but it's incredibly minimal. It checks one file at a time.
node --check ./path/to/file.js
If you'd like to syntax check your entire Node.js codebase, excluding node_modules
:
find . -path ./node_modules -prune -o -name "*.js" -exec node -c {} \;
Again, you should be using ESLint to do this.
Written by Jon Peck
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Node
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#