You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
napi strip_typescript_annotations now drops TypeScript method overload signatures and optional-parameter markers, both of which the 0.23.54 fix did not address. When a class defines multiple overload signatures followed by a single implementation (e.g. get(path: string, handler: Fn): this; / get(path: string): (fn: Fn) => Fn; / get(path: string, handler?: Fn): ... { ... }), the prior strip left the signature-only lines (ending in ;) in the emitted service.cjs. JavaScript has no overload concept and rejects bodyless method declarations as syntax errors — the published @spikard/node-style package's service.cjs was unparseable. Separately, optional-parameter markers like handler?: had the type stripped but the ? survived, leaving handler? as a parameter name which is not legal JS. Both fixes are line-shape heuristics in the strip pipeline: bodyless method-header lines (non-import, non-keyword, contains (, ends ;) are dropped wholesale; ? immediately followed by :, ,, or ) is treated as the optional marker and elided. Two regression tests pin each behavior. Combined with 0.23.54's brace-preservation fix, the emitted service.cjs now passes oxlint.