---
title: "Use TypeScript in strict mode · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/testing-and-code-quality/typescript-strict
updated: 2026-10-21
licence: "All rights reserved"
---

# Use TypeScript in strict mode

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- Level: Recommended
- Chapter: [Testing and code quality](https://agentwranglers.se/playbook/stack/testing-and-code-quality)
- Rule: 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: 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](https://agentwranglers.se/playbook/architecture/data-shapes/no-mixed-or-any).
- Check: `tsconfig.json` has no `"strict": false` and no strict sub-flag turned off. `npx tsc --noEmit` exits 0 in the build.

## 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

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

### Shell example

```sh
npx tsc --noEmit
```

## Sources

- [TSConfig strict](https://www.typescriptlang.org/tsconfig/#strict)
- [Announcing TypeScript 7.0](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/)

## Related rules

- [Use TypeScript for web apps and APIs](https://agentwranglers.se/playbook/stack/languages-and-runtimes/typescript) in Software choices
- [Never type anything as mixed or any](https://agentwranglers.se/playbook/architecture/data-shapes/no-mixed-or-any) in Architecture

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/stack/testing-and-code-quality/typescript-strict">Agent Wranglers software choices playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Use Ruff to lint and format Python](https://agentwranglers.se/playbook/stack/testing-and-code-quality/ruff)
- Next: [Use Pyright to check Python types](https://agentwranglers.se/playbook/stack/testing-and-code-quality/pyright)
- [Testing and code quality](https://agentwranglers.se/playbook/stack/testing-and-code-quality)
