build: check that css template literals were not ended by a comment

A backtick inside a comment in a css`` literal ends the literal. It has
cost four sessions across three plans, it is written down in CLAUDE.md,
the skill and NOTES.md, and it was read twice in the session it then
cost a cycle in. Knowledge that has been ignored three times is not a
knowledge problem.

The expense is the report, not the mistake: the literal ends early, the
rest of the CSS parses as JavaScript, and tsc says 'Class static side
incorrectly extends base class static side' pointing at a line of prose
-- or, in a shared module, every test in the suite fails to import and
the output reads like a broken test runner. make dev-headless mean-
while keeps serving the last good bundle.

Detection is exact rather than heuristic: if a backtick in a comment
closed the literal early, the text the parser took as the literal
contains an unterminated /*. Nothing else produces that. Verified both
ways -- clean on the tree, and red on a deliberately broken comment.
This commit is contained in:
2026-08-13 01:07:08 -04:00
parent 49b1194333
commit 0b7ffd5679
5 changed files with 170 additions and 1 deletions
+10
View File
@@ -155,6 +155,16 @@ jobs:
working-directory: /src/frontend
run: npx tsc --noEmit
# A backtick inside a comment in a css`` literal ends the literal.
# tsc above does fail on it, with a message about CSSResult
# pointing at a line of prose; this one names the cause. It runs
# after tsc for exactly that reason — whichever fails, the log has
# the sentence in it.
- name: CSS template literals are intact
if: ${{ !cancelled() }}
working-directory: /src
run: make css-check
- name: Component and store suite
working-directory: /src
run: make ui-test