gitpush-pre lint: block value exports in use-server modules (PLUTO-491/492 class)
Steal PLUTO-492: add a .gitpush-pre.sh lint that BLOCKS a push when a "use server" module (module-level directive) has any VALUE-carrying export — export const/let/var, export enum/class, export default (non-async), non-async export function, or a value/mixed export{ } re-export. Next16/Turbopack runtime-registers every export of a use-server module; a non-async VALUE export erases at compile → dangling runtime binding → 'X is not defined' ReferenceError at MODULE LOAD → every importing route 500s, while build/tsc/lint all pass GREEN (PLUTO-491 prod-down class). CRITICAL DESIGN CONSTRAINT: the lint MUST EXEMPT type-only exports (export type / export interface) — those are compile-time-erased, create no runtime binding, and are SAFE. Mars currently has 30 legit 'export type' exports across 31 use-server files; a naive 'any non-async export' lint would false-positive on all of them and block every push (unusable). Flag only value exports. Mars swept CLEAN 2026-07-03 (0 value exports) so this is pure prevention, not a fix.
Questions
Activity
-
CORRECTED lint spec (supersedes desc, which broadly exempts 'export type' → under-flags the brace form). Root cause reconciled w/ Pluto PLUTO-491: Turbopack's 'use server' codegen emits a runtime registration for a brace/star re-export SPECIFIER even when type-marked, referencing an already-elided ident → ReferenceError at module load; standard tsc elision differs. Canonical rule: SAFE/exempt = type DECLARATIONS only (export type X = …, export interface X). FLAG in use-server files = all brace re-exports incl type-marked (export (type )?{ … }) + star (export *) + value exports (const/let/var/enum/class/default, non-async fn). Detector = venus's grep export (type )?{…} / export * PLUS value-export grep. Mars verified CLEAN under this rule (31 files, 0 brace/star, 30 export-type all declarations). Not building now.