# TypeScript — card for AI agents

Language for application-scale JavaScript development with static type checking.

Category: Languages, types and runtimes · npm package `typescript` · latest version 7.0.2 (checked 2026-11-01)
Install: `npm install typescript`
License: Apache-2.0 (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## TypeScript
- Install it as a dev dependency: `npm install -D typescript`. Use `typescript@next` only when nightly builds are wanted.
- In a JavaScript project, add `// @ts-check` at the top of `.js` files and give types through JSDoc (`/** @param {any[]} arr */`) before converting files.
- Describe object and function shapes with `interface` or `type`. Use literal unions (`"pass" | "fail"`) for fixed sets of values.
- When a bulk conversion leaves errors, tag them with `// @ts-expect-error` so they can be tracked and fixed after the conversion.
- If the compiler comes under memory pressure on a very large codebase, use project references.
- Types are removed when TypeScript becomes JavaScript. The emitted `.js` contains no annotations.

## Agent Skills for it
- typescript-advanced-types from wshobson/agents: `npx skills add wshobson/agents --skill typescript-advanced-types`
- typescript-best-practices from Yeachan-Heo/oh-my-claudecode: `npx skills add Yeachan-Heo/oh-my-claudecode --skill typescript-best-practices`
- typescript-best-practices from cursor/plugins: `npx skills add cursor/plugins --skill typescript-best-practices`
- typescript-pro from Jeffallan/claude-skills: `npx skills add Jeffallan/claude-skills --skill typescript-pro`
- typescript-advanced-types from midudev/autoskills: `npx skills add midudev/autoskills --skill typescript-advanced-types`
- typescript-best-practices from backnotprop/pstack: `npx skills add backnotprop/pstack --skill typescript-best-practices`

## What it is
- TypeScript is Microsoft's typed layer over JavaScript. It is published as `typescript` on npm under Apache-2.0. The README calls it "a language for application-scale JavaScript". Its types are optional. They feed tools: editor errors, auto-complete and checks before the code runs.
- The compiler removes the types and emits JavaScript. The website says that output runs in a browser, on Node.js, Deno and Bun. A project does not have to switch all at once. A `// @ts-check` comment plus JSDoc annotations in a plain JavaScript file already turns on editor errors.
- The latest GitHub release is v7.0.2, published 2026-08-20. The releases page notes that this tag was originally released in the `microsoft/typescript-go` repository. The website says 7.1 is in beta.

## Caveats
- Compiler memory on very large codebases: On the Stripe Dashboard, with tens of thousands of modules, Stripe's approach created "significant memory pressure" on the compiler. The Dashboard is not structured as distinct modules, so Stripe inferred a module structure and created project references from it.
- The rest of the toolchain has to follow: A passing type check was not enough for Stripe. ESLint, Jest, Webpack and Metro also needed updates. Jest snapshot files broke because they hold hardcoded references to the test files that generated them.
- Big conversions leave a backlog of suppressions: Stripe tagged unresolved errors with `@ts-expect-error` so it could finish the switch first. An initial pass produced over 97,000 suppressions. Iterating on the codemod brought that to 37,000. The Flow code had had about 5,000.

## Numbers (AgentGid data)
- Gid Score: 93.2 (#5 of all tools, 1 of 70 in its category)
- Used in 3,453 public projects set up for AI coding agents (55.2%)
- Downloads last week: 450,984,480 (as of 2026-11-24), +41.8% over 4 weeks
- GitHub stars: 111,878 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
ESLint 59.4%, React 54.7%, Tailwind CSS 52.2%, Zod 42.8%, clsx 34.0%, Vitest 35.6%

## Links
- AgentGid page: https://agentgid.com/tools/typescript/
- Homepage: https://www.typescriptlang.org/
- Repository: https://github.com/microsoft/TypeScript
- Source: https://github.com/microsoft/TypeScript#readme
- Source: https://github.com/microsoft/TypeScript
- Source: https://github.com/microsoft/TypeScript/releases
- Source: https://www.typescriptlang.org


## TypeScript: catch code mistakes before your app runs

TypeScript is JavaScript with types: you, or your AI assistant, note what kind of data each part of the code expects. Its free compiler, tsc, reads the project and lists mistakes such as a misspelled field before anyone runs the app, then turns the code into plain JavaScript. Version 7 is a much faster rewrite of that compiler.

### Where to use it
- Block broken code from shipping: Your build or pull-request check runs the type check and stops when a field name is misspelled or a value is the wrong kind.
- Let your AI assistant check its edits: After an assistant changes several files, it runs the compiler and fixes every reported line before handing the work back.
- Add types to an old JavaScript app: Start with one file at a time; each step gives better editor hints without rewriting the whole project.
- Move a project to version 7: Update old settings first so the new, faster compiler accepts the project without errors.
- Keep Vue or lint tools working: Tools that load the compiler as a library still need version 6, so you install both side by side.
- One data shape for front and back: Describe an order or a user once and share it between the browser code and the server, so both sides agree. (idea, not from the official pages)

### How to start
- Install TypeScript into the project as a development package (Node.js is needed to install it).

```
npm install -D typescript
```

- Run the compiler from the project folder; it reads tsconfig.json and reports errors.

```
npx tsc
```


### License
Free for any use, also commercial, under the Apache 2.0 license. The JavaScript it produces from your code is yours; if you pass the compiler itself on, include its license.

### Good to know
- Version 7 has no programming interface yet, so tools that load the compiler as a library still need version 6.
- Vue, Svelte, Astro and MDX projects should stay on version 6 for now.
- Old settings such as an ES5 target or baseUrl are now hard errors, and strict checking is on by default.
- Install it inside each project rather than once for the whole computer, so every machine uses the same version.
- Faster tools that only strip the types out do not check them; you still need tsc for the check.

Checked 2026-11-10 against: https://www.typescriptlang.org/, https://www.typescriptlang.org/download/, https://www.typescriptlang.org/tsconfig/, https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html, https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/, https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/, https://devblogs.microsoft.com/typescript/, https://github.com/microsoft/TypeScript/blob/main/README.md, https://github.com/microsoft/TypeScript/blob/main/LICENSE.txt, https://github.com/microsoft/typescript-go/blob/main/README.md, https://registry.npmjs.org/typescript/7.0.2, https://registry.npmjs.org/typescript

### Mistakes to avoid
- Don't: import ts from "typescript"; ts.createProgram(...) in a build script with typescript@7 → Do: Install @typescript/typescript6 under the typescript name (npm alias) for code that needs the compiler library (TypeScript 7.0 ships no API; the 7.0.2 package's main entry only exports version info.)
- Don't: "target": "es5" or "baseUrl": "." in tsconfig.json → Do: Remove them; use a modern target and paths relative to the project root (In our run 7.0.2 stopped with TS5108 "Option 'target=ES5' has been removed" and TS5102 for baseUrl.)
- Don't: Using process or Buffer and expecting Node types to load on their own → Do: npm i -D @types/node and set "types": ["node"] in compilerOptions (types now defaults to an empty list; our run reported TS2591 Cannot find name 'process'.)
- Don't: npx tsc src/index.ts in a folder that has tsconfig.json → Do: npx tsc (uses tsconfig.json) or npx tsc --ignoreConfig src/index.ts (Our run stopped with error TS5112 and exit code 1.)
- Don't: Switching a Vue, Svelte or Astro project to TypeScript 7 → Do: Stay on TypeScript 6.0 for those projects for now (Their editor tools embed the compiler through the API that 7.0 does not have yet.)

### Questions
- Do browsers run TypeScript? No. tsc turns it into plain JavaScript, which runs in browsers, Node.js, Deno and Bun.
- Will my TypeScript 6 project build with 7? Code that compiles cleanly with 6.0, without deprecated settings, should compile the same in 7.0.
- Why does tsc src/file.ts fail with error TS5112? In a folder with tsconfig.json, file paths on the command line need --ignoreConfig; usually you just run tsc.
- How often do new versions come out? The team expects new feature versions every 3-4 months; 7.1 is in beta.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
