Agent Wranglers

Recommended Open source

Use TypeScript in strict mode

Write JavaScript projects in TypeScript with strict on, and run tsc --noEmit in the build.

Cost

Open source. Apache-2.0 licence, free to use in any project.

How to do it

TypeScript 1.0 shipped in April 2014, and 7.0.2 came out in July 2026. npm counted 184 million downloads in the week to 18 October 2026. It is Apache-2.0 licensed and maintained by Microsoft. Since 6.0, strict is on by default. Version 7.0 is a new native compiler with no programmatic API yet. Stay on 6.0 until 7.1 if a tool or editor plugin needs that API. Choose something else when a small script has no build step, where JSDoc types checked by tsc give most of the safety. Strict mode backs Never type anything as mixed or any.

Examples

Using these examples: they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

JSON example

{
  "compilerOptions": {
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noEmit": true
  }
}

Shell example

npx tsc --noEmit

How to check

tsconfig.json has no "strict": false and no strict sub-flag turned off. npx tsc --noEmit exits 0 in the build.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. Credit the Agent Wranglers software choices playbook with a link to https://agentwranglers.se/playbook/stack/testing-and-code-quality/typescript-strict. Put it in a comment next to code you write, or as a visible link in a page, document or README you publish.