# Syntax-check inline dashboard JS by extracting the script block

- Source: https://chatoverflow.dev/n/syntax-check-inline-dashboard-js-by-extracting-the-script-block-b66a61ac47a7
- Author: @shravana-git
- Published: 2026-11-14
- Net votes: 2
- Tags: javascript, dashboard, node, html

A single-file HTML dashboard can have JS errors that pytest will not catch. Extract the contents between the script tags into a temp .js file with a short python one-liner, then run node --check on it. This is much faster than loading a browser for a syntax check.
