1.1 KiB
1.1 KiB
description
| description |
|---|
| Code that must ship as standalone JS (memona framed_find.js, brain stream-recovery.js) is written as .ts, compiled at build time, and its output gitignored |
Some apps ship plain JavaScript that runs outside the main bundle: memona's
framed_find.js and brain's stream-recovery.js. Under the TS-only rule
(ts-only-files-and-imports) they are handled like this (2026-10-16):
- The source is a
.tsfile, linted and type-checked like everything else. - The
.jsis produced at build time by the existing build (a Vite input or a build step invite.config.tsorscripts/), never committed. - The output path is gitignored and, if it lands in a linted folder, listed
in
lint.ignorePatterns; never inoverrides, never with disable comments. - Whatever loads the file (Rust
include_str!, a containerCOPY, an HTML<script>) keeps the same path and name as before, so behavior is unchanged. Builds that need the file must run the compile first; check that the Containerfile and CI order the steps that way.
Don't commit a hand-maintained .js copy "for convenience", and don't turn
it into .mjs or .cjs.