[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6WZMXY0XGSDCFPNDSS8XD55":3,"skill-same:01M6WZMXY0XGSDCFPNDSS8XD55":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M6WZMXY0XGSDCFPNDSS8XD55","typescript-update",null,"Guidance for updating to the newer versions of TypeScript. Use this when you need to upgrade TypeScript or as part of a larger dependency update process.","microsoft\u002Ftypescript-skills","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M6WZMFFTDSMABFXBK4RG5787",2,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-update\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"typescript","update","typescript update","dependency update","process","use","dependency","guidance","upgrade","as","you","for","when","2026-11-10 10:12:30",false,"---\nname: typescript-update\ndescription: Guidance for updating to the newer versions of TypeScript. Use this when you need to upgrade TypeScript or as part of a larger dependency update process.\n---\n\n\u003C!-- prettier-ignore-start -->\n\nYour role is to upgrade the project to the latest TypeScript version (7.x, or a later minor such as 7.1 if it is current), leaving the project's own build, typecheck, test and lint commands at least as healthy as they were before you started. You must always finish with the summary described in [Summarize](#summarize), even if you are blocked.\n\n## How To Upgrade\n\n1. **Record the baseline (cheaply).**\n   - Read every `package.json` that declares `typescript`, the package manager (lockfile, `packageManager` field), the `engines.node` range, and `node --version`.\n   - Identify the project's own `build`, `typecheck`\u002F`check-types`, `test` and `lint` scripts.\n   - Reuse an existing `node_modules` if present. Otherwise do **one** non-interactive install (see [Long-Running and Interactive Commands](#long-running-and-interactive-commands)). Do not change the package-manager setup (Corepack, `packageManager`, lockfile format, install modes) just to get a baseline.\n   - Run each of those scripts once, logging output, and note which pass and which fail.\n   - A red or uninstallable baseline is **information to report, never a reason not to upgrade**. Continue with the upgrade and compare against the baseline at the end.\n2. **Read the version guides before your first edit.** Always read [6to7.md](6to7.md). Also read [5to6.md](5to6.md) if starting below 6.0, and [4to5.md](4to5.md) if starting below 5.0. Treat them as checklists of changes to apply up front, not as references to consult only after something breaks.\n3. **Choose the package layout.** Run the API-consumer check in [6to7.md](6to7.md#does-the-project-need-the-typescript-api). If anything in the project or its dependencies uses the TypeScript API, use the side-by-side layout (`typescript` aliased to `@typescript\u002Ftypescript6`, `@typescript\u002Fnative` aliased to `typescript@7`) from the start. Otherwise install plain `typescript@7`.\n4. **Apply all config changes in one pass.** Edit `tsconfig*.json` and related config straight to the target layout, applying every checklist item for every major version between the starting version and 7.0 (e.g. `types`, `module`\u002F`moduleResolution`, `baseUrl`\u002F`paths`, `rootDir`, `esModuleInterop`, removed options). Update `@types\u002F*` and TypeScript-dependent tools (see [`@types` Dependencies](#types-dependencies)).\n5. **Install the target versions once**, then typecheck with the new `tsc` and fix the errors.\n   - Do not install and build every intermediate major version. At most, you may run one optional typecheck with TypeScript 6.0 (e.g. `npx tsc6 --noEmit` from `@typescript\u002Ftypescript6`) to read its more descriptive deprecation messages.\n6. **Run the [Completion Gate](#completion-gate)**, then **[Summarize](#summarize)**.\n\n## Long-Running and Interactive Commands\n\nInstalls and builds in large repositories can take several minutes. Agent terminals may move a command to the background after a timeout; the command is still running.\n\n- Run installs, builds and tests non-interactively, with output redirected to a log file, e.g. `CI=true yarn build > \u002Ftmp\u002Fts-upgrade-build.log 2>&1; echo \"exit=$?\"`. Then read the tail of the log.\n- If the terminal tool reports that a command was moved to the background or timed out, keep polling its output (or the log file) until it exits. **Do not end your turn while a command is still running**, and never end a turn with an empty message.\n- Never run commands that wait for input (e.g. `pnpm patch` without `--edit-dir`, `npx` without `-y`, `npm init`, project generators, `git rebase -i`). If a prompt appears anyway, answer it immediately and finish the workflow it started in the same turn.\n- Prefer upgrading a dependency over patching it. If a dependency must be patched, persist the patch non-interactively and refresh the lockfile:\n  - **pnpm:** `pnpm patch \u003Cpkg>@\u003Cexact-version> --edit-dir \u002Ftmp\u002Fpatch-\u003Cpkg>`, edit the files there, `pnpm patch-commit \u002Ftmp\u002Fpatch-\u003Cpkg>` (writes `patches\u002F` and `patchedDependencies` and updates the lockfile), then verify with `pnpm install --frozen-lockfile`.\n  - **yarn (berry):** `yarn patch \u003Cpkg>@npm:\u003Cexact-version>` prints a folder; edit it, run `yarn patch-commit -s \u003Cfolder>`, then `yarn install`.\n  - **npm:** edit `node_modules\u002F\u003Cpkg>`, run `npx -y patch-package \u003Cpkg>`, and add a `\"postinstall\": \"patch-package\"` script.\n\n## Forbidden Fixes\n\nDo not paper over upgrade errors with suppression escape hatches. Specifically:\n\n- Do not use `ignoreDeprecations`. The target version will not support this option.\n- Do not add `\u002F\u002F @ts-ignore`, `\u002F\u002F @ts-expect-error`, or `\u002F\u002F @ts-nocheck` to silence new errors.\n- Do not use `any` just to make an error go away.\n- Do not disable `tsconfig.json` strictness flags (`strict`, `noImplicitAny`, `strictNullChecks`, `skipLibCheck`, etc.)\n\n## Version-Specific Guidance\n\nAdditional files document version-specific changes and migration steps. Read the ones that apply before editing (see step 2 above):\n\n- [4to5.md](4to5.md) covers upgrading from 4.x to 5.0.\n- [5to6.md](5to6.md) covers upgrading from 5.x to 6.0.\n- [6to7.md](6to7.md) covers upgrading from 6.x to 7.0, including the TypeScript API compatibility layout and troubleshooting for tool-injected `baseUrl`, the Node.js version required by the 7.0 `tsc` launcher, and framework-generated tsconfigs.\n\n## Common Issues\n\nAll versions of TypeScript may include updates to the DOM. These are not specifically documented anywhere. Use your best judgment to determine how to fix these, keeping in mind that you should not be making runtime-affecting changes unless absolutely justified.\n\n## Usercode Bugs\n\nNewer versions TypeScript may sometimes find _unambiguous problems_ in the user's code that were not caught by previous versions.\nSometimes you will be able to easily determine the correct fix (i.e. what was intended).\nIf you can't determine the correct fix, add a temporary `ts-ignore` comment to suppress the error so you can continue with the upgrade process:\n\n```ts\n\u002F\u002F @ts-ignore BUG: This is always a runtime error! Fix as appropriate depending on intended meaning\nconst p = \"foo\" in 42;\n```\n\nWhen you're done, remove the `@ts-ignore` part of the comment, but leave behind the explanation of why the code is wrong.\nReport all bugs you found in the summary.\n\n## `@types` Dependencies\n\nYou may need to update `@types` dependencies alongside the main TypeScript version.\nCheck the `package.json` for any `@types\u002F` entries and update them to the latest version compatible with the corresponding core dependency.\n\n## Completion Gate\n\nThe upgrade is not done until this gate has been run after your last edit:\n\n1. Do a clean, lockfile-respecting install (e.g. `npm ci`, `pnpm install --frozen-lockfile`, `yarn install --immutable`). This proves `package.json`, the lockfile and any `patchedDependencies` agree.\n2. Confirm the installed compiler version, e.g. `npx tsc --version`.\n3. Rerun each baseline command (build, typecheck, test, lint), including tests, and compare each one against the baseline.\n4. Every command that passed in the baseline and fails now must be fixed, or reported in the summary as an explicit failure of the upgrade. Do not label it \"out of scope\". The upgrade is also not complete while the target `tsc` reports errors for the project, including errors from framework-generated tsconfigs.\n\n## Summarize\n\nYour final message must always be this summary, even if you were blocked or stopped early:\n\n- Starting TypeScript version\n- Ending TypeScript version actually installed (from `tsc --version` or the lockfile), and the package layout used (plain `typescript@7` or side-by-side with `@typescript\u002Ftypescript6`)\n- Baseline vs. final result for each build, typecheck, test and lint command\n- Any notable edits you had to make\n- Bugs in usercode you found\n  - Offer to remove the `\u002F\u002F @ts-ignore` comments you added\n- Every gate that is still red, and why\n- If you had to stop before reaching the latest version, explain what happened and what remains to be done\n\n\u003C!-- prettier-ignore-end -->\n","\u003C!-- prettier-ignore-start -->\n\nYour role is to upgrade the project to the latest TypeScript version (7.x, or a later minor such as 7.1 if it is current), leaving the project's own build, typecheck, test and lint commands at least as healthy as they were before you started. You must always finish with the summary described in [Summarize](#summarize), even if you are blocked.\n\n## How To Upgrade\n\n1. **Record the baseline (cheaply).**\n   - Read every `package.json` that declares `typescript`, the package manager (lockfile, `packageManager` field), the `engines.node` range, and `node --version`.\n   - Identify the project's own `build`, `typecheck`\u002F`check-types`, `test` and `lint` scripts.\n   - Reuse an existing `node_modules` if present. Otherwise do **one** non-interactive install (see [Long-Running and Interactive Commands](#long-running-and-interactive-commands)). Do not change the package-manager setup (Corepack, `packageManager`, lockfile format, install modes) just to get a baseline.\n   - Run each of those scripts once, logging output, and note which pass and which fail.\n   - A red or uninstallable baseline is **information to report, never a reason not to upgrade**. Continue with the upgrade and compare against the baseline at the end.\n2. **Read the version guides before your first edit.** Always read [6to7.md](6to7.md). Also read [5to6.md](5to6.md) if starting below 6.0, and [4to5.md](4to5.md) if starting below 5.0. Treat them as checklists of changes to apply up front, not as references to consult only after something breaks.\n3. **Choose the package layout.** Run the API-consumer check in [6to7.md](6to7.md#does-the-project-need-the-typescript-api). If anything in the project or its dependencies uses the TypeScript API, use the side-by-side layout (`typescript` aliased to `@typescript\u002Ftypescript6`, `@typescript\u002Fnative` aliased to `typescript@7`) from the start. Otherwise install plain `typescript@7`.\n4. **Apply all config changes in one pass.** Edit `tsconfig*.json` and related config straight to the target layout, applying every checklist item for every major version between the starting version and 7.0 (e.g. `types`, `module`\u002F`moduleResolution`, `baseUrl`\u002F`paths`, `rootDir`, `esModuleInterop`, removed options). Update `@types\u002F*` and TypeScript-dependent tools (see [`@types` Dependencies](#types-dependencies)).\n5. **Install the target versions once**, then typecheck with the new `tsc` and fix the errors.\n   - Do not install and build every intermediate major version. At most, you may run one optional typecheck with TypeScript 6.0 (e.g. `npx tsc6 --noEmit` from `@typescript\u002Ftypescript6`) to read its more descriptive deprecation messages.\n6. **Run the [Completion Gate](#completion-gate)**, then **[Summarize](#summarize)**.\n\n## Long-Running and Interactive Commands\n\nInstalls and builds in large repositories can take several minutes. Agent terminals may move a command to the background after a timeout; the command is still running.\n\n- Run installs, builds and tests non-interactively, with output redirected to a log file, e.g. `CI=true yarn build > \u002Ftmp\u002Fts-upgrade-build.log 2>&1; echo \"exit=$?\"`. Then read the tail of the log.\n- If the terminal tool reports that a command was moved to the background or timed out, keep polling its output (or the log file) until it exits. **Do not end your turn while a command is still running**, and never end a turn with an empty message.\n- Never run commands that wait for input (e.g. `pnpm patch` without `--edit-dir`, `npx` without `-y`, `npm init`, project generators, `git rebase -i`). If a prompt appears anyway, answer it immediately and finish the workflow it started in the same turn.\n- Prefer upgrading a dependency over patching it. If a dependency must be patched, persist the patch non-interactively and refresh the lockfile:\n  - **pnpm:** `pnpm patch \u003Cpkg>@\u003Cexact-version> --edit-dir \u002Ftmp\u002Fpatch-\u003Cpkg>`, edit the files there, `pnpm patch-commit \u002Ftmp\u002Fpatch-\u003Cpkg>` (writes `patches\u002F` and `patchedDependencies` and updates the lockfile), then verify with `pnpm install --frozen-lockfile`.\n  - **yarn (berry):** `yarn patch \u003Cpkg>@npm:\u003Cexact-version>` prints a folder; edit it, run `yarn patch-commit -s \u003Cfolder>`, then `yarn install`.\n  - **npm:** edit `node_modules\u002F\u003Cpkg>`, run `npx -y patch-package \u003Cpkg>`, and add a `\"postinstall\": \"patch-package\"` script.\n\n## Forbidden Fixes\n\nDo not paper over upgrade errors with suppression escape hatches. Specifically:\n\n- Do not use `ignoreDeprecations`. The target version will not support this option.\n- Do not add `\u002F\u002F @ts-ignore`, `\u002F\u002F @ts-expect-error`, or `\u002F\u002F @ts-nocheck` to silence new errors.\n- Do not use `any` just to make an error go away.\n- Do not disable `tsconfig.json` strictness flags (`strict`, `noImplicitAny`, `strictNullChecks`, `skipLibCheck`, etc.)\n\n## Version-Specific Guidance\n\nAdditional files document version-specific changes and migration steps. Read the ones that apply before editing (see step 2 above):\n\n- [4to5.md](4to5.md) covers upgrading from 4.x to 5.0.\n- [5to6.md](5to6.md) covers upgrading from 5.x to 6.0.\n- [6to7.md](6to7.md) covers upgrading from 6.x to 7.0, including the TypeScript API compatibility layout and troubleshooting for tool-injected `baseUrl`, the Node.js version required by the 7.0 `tsc` launcher, and framework-generated tsconfigs.\n\n## Common Issues\n\nAll versions of TypeScript may include updates to the DOM. These are not specifically documented anywhere. Use your best judgment to determine how to fix these, keeping in mind that you should not be making runtime-affecting changes unless absolutely justified.\n\n## Usercode Bugs\n\nNewer versions TypeScript may sometimes find _unambiguous problems_ in the user's code that were not caught by previous versions.\nSometimes you will be able to easily determine the correct fix (i.e. what was intended).\nIf you can't determine the correct fix, add a temporary `ts-ignore` comment to suppress the error so you can continue with the upgrade process:\n\n```ts\n\u002F\u002F @ts-ignore BUG: This is always a runtime error! Fix as appropriate depending on intended meaning\nconst p = \"foo\" in 42;\n```\n\nWhen you're done, remove the `@ts-ignore` part of the comment, but leave behind the explanation of why the code is wrong.\nReport all bugs you found in the summary.\n\n## `@types` Dependencies\n\nYou may need to update `@types` dependencies alongside the main TypeScript version.\nCheck the `package.json` for any `@types\u002F` entries and update them to the latest version compatible with the corresponding core dependency.\n\n## Completion Gate\n\nThe upgrade is not done until this gate has been run after your last edit:\n\n1. Do a clean, lockfile-respecting install (e.g. `npm ci`, `pnpm install --frozen-lockfile`, `yarn install --immutable`). This proves `package.json`, the lockfile and any `patchedDependencies` agree.\n2. Confirm the installed compiler version, e.g. `npx tsc --version`.\n3. Rerun each baseline command (build, typecheck, test, lint), including tests, and compare each one against the baseline.\n4. Every command that passed in the baseline and fails now must be fixed, or reported in the summary as an explicit failure of the upgrade. Do not label it \"out of scope\". The upgrade is also not complete while the target `tsc` reports errors for the project, including errors from framework-generated tsconfigs.\n\n## Summarize\n\nYour final message must always be this summary, even if you were blocked or stopped early:\n\n- Starting TypeScript version\n- Ending TypeScript version actually installed (from `tsc --version` or the lockfile), and the package layout used (plain `typescript@7` or side-by-side with `@typescript\u002Ftypescript6`)\n- Baseline vs. final result for each build, typecheck, test and lint command\n- Any notable edits you had to make\n- Bugs in usercode you found\n  - Offer to remove the `\u002F\u002F @ts-ignore` comments you added\n- Every gate that is still red, and why\n- If you had to stop before reaching the latest version, explain what happened and what remains to be done\n\n\u003C!-- prettier-ignore-end -->\n",{"name":5,"description":7},"main","9cde090939915a885f841aa6bd65a400ed9f0a62","plugins\u002Ftypescript\u002Fskills\u002Ftypescript-update",1,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-12 03:28:24",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add microsoft\u002Ftypescript-skills --skill typescript-update",{"tool":52,"command":53},"bunx","bunx skills add microsoft\u002Ftypescript-skills --skill typescript-update",{"tool":55,"command":56},"pnpm","pnpm dlx skills add microsoft\u002Ftypescript-skills --skill typescript-update","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-update\u002FSKILL.md",true,[60,66,70],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"4to5.md","REFERENCE","参考文档",4779,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-update\u002F4to5.md",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"5to6.md",12579,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-update\u002F5to6.md",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"6to7.md",6642,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-update\u002F6to7.md",[75,94,108],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":32},"01M6WZMSDHM7W9Z06X10Y76TTK","typescript-strict","Enable TypeScript strict mode (strict, noImplicitAny, strictNullChecks, etc.) in a project and fix the resulting errors without weakening types, tests, or runtime behavior. Use when asked to \"enable strict mode\", \"turn on TypeScript strict\", \"fix strict errors\", or migrate a codebase to strict type checking.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-strict\u002FSKILL.md",[],[19,82,24,83,84,85,86,87,88,89,90,91,92,93,31],"typescript strict","migrate","behavior","fix","project","runtime","tests","type","types","errors","mode","codebase",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":32},"01M6WZMNT6EZNR2A7W527T63E9","typescript-project-setup","How to set up a new TypeScript project","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-project-setup\u002FSKILL.md",[],[101,86,102,19,103,104,105,106,107],"project setup","setup","typescript project setup","how to","SET","up","how",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":32},"01M6WZMHKQ6JP3DMJWG4MG90RB","typescript-build-references","Guidance for configuring TypeScript project references and incremental builds (`tsc -b`\u002F`--build`, `composite`, solution-style tsconfigs) and declaration emission (`.d.ts` files) with `isolatedDeclarations` in an existing repo or monorepo. Use this whenever asked to add project references, build mode, incremental builds, declaration files, or isolated declarations, even when the repo already has a working build or bundler.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-build-references\u002FSKILL.md",[],[19,115,116,117,118,119,120,24,121,122,26,86,123,124,125,92,126,30,127,31],"references","build","typescript build references","add","monorepo","repo","project references","files","style","existing repo","with","bundler","Existing"]