JavaScript & TypeScript Code Hygiene

Type, module, asynchronous, React, and Node.js lifecycle hygiene.

Choose a focused JavaScript & TypeScript recipe

This collection contains 5 bounded JavaScript & TypeScript workflows. Choose the recipe whose objective matches the repository evidence instead of combining unrelated cleanup into one run.

How to use this collection

Read the repository’s configured runtime, compiler, framework, analyzer, and test commands before selecting a workflow. Start in audit mode, record file and symbol evidence, and authorize a fix only after the candidate scope is reviewable. Preserve supported versions, public behavior, and existing tool configuration.

If the evidence is a named CVE, scanner finding, exposed secret, authorization flaw, or injection path, use the focused vulnerability-remediation playbook instead of a code-hygiene recipe. Stop when the safe result requires an owner decision about architecture, compatibility, production data, or deployment state.

Full recipe list

TypeScript strictness and escape-hatch debt

development

TypeScript strictness and escape-hatch debt: Reduce unsafe any, ignore directives, assertions, and disabled strict checks incrementally.

author security-recipes.ai contributorsteam Security EngineeringTested withgpt-5-codexupdated 2026-08-21
code-hygienejavascript-typescripttypescriptstrictanyts-ignore

JavaScript promise, abort, and listener lifecycle

development

JavaScript promise, abort, and listener lifecycle: Close floating promises, lost failures, uncancelled work, and leaked event listeners.

author security-recipes.ai contributorsteam Security EngineeringTested withgpt-5-codexupdated 2026-08-21
code-hygienejavascript-typescriptjavascriptpromisesabortcontrollerlisteners

JavaScript module cycles, side effects, and unused exports

development

JavaScript module cycles, side effects, and unused exports: Make module initialization order and public exports predictable.

author security-recipes.ai contributorsteam Security EngineeringTested withgpt-5-codexupdated 2026-08-21
code-hygienejavascript-typescriptjavascriptmodulescyclesexports

React hook, effect, and state lifecycle

development

React hook, effect, and state lifecycle: Remove stale closures, redundant state, and effect cleanup defects.

author security-recipes.ai contributorsteam Security EngineeringTested withgpt-5-codexupdated 2026-08-21
code-hygienejavascript-typescriptreacthookseffectsstate

Node.js stream, emitter, and handle lifecycle

development

Node.js stream, emitter, and handle lifecycle: Prevent stream stalls, duplicate listeners, and handles that keep processes alive.

author security-recipes.ai contributorsteam Security EngineeringTested withgpt-5-codexupdated 2026-08-21
code-hygienejavascript-typescriptnodejsstreamseventemitterhandles