/validate-js
Run node --check on every .js file in the project root to verify syntax.
Steps
- •Find all
.jsfiles in the project root directory (non-recursive — this is a flat, no-build project). - •Run
node --check <file>on each file. - •Report results per file: PASS or FAIL with the error message.
- •Print a summary line:
X/Y files passed.
Example output
code
background.js: PASS constants.js: PASS content.js: PASS popup.js: FAIL — SyntaxError: Unexpected token (line 42) Result: 3/4 files passed