Last Updated: July 03, 2017
·
2.386K
· fluxsauce

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.