There's an eslint plugin for extracting JS from HTML, so you can catch issues even when using inline JS!
miniblog.
Related Posts
Many languages use docstrings rather than doc comments: it certainly makes extracting them easier. You just parse the code.
Could you go further and require all comments to be string literals? I'm struggling to think of many downsides.
Extracting machine-readable specs from natural language specs for ARM architectures, and finding ambiguities!
Dash.el has destructuring -lambda, which is hugely underrated. (-map (-lambda ((fst snd)) snd) pairs) is a lovely way of extracting items!