Only types,tsconfig, and compiler behavior. For how to run with Node, .ts delegate to the node skill; for Vue SFC / Volar, delegate to the vue skill. Build tools, CSS, and state libraries follow the project; do not specify them in this skill.
Do not write APIs from training data. First determine the version, then read the corresponding reference.
Determine the version
- Readthe installed's
typescriptversion:node_modules/typescript/package.json'sversion, or the lockfile. Do not just look atpackage.json's^/>=range. - When both
typescript@7and@typescript/typescript6(or npm alias) are installed: for application code and the project's existing typecheck entrypoint, go by 7; for tools that need the programmatic API, go by 6. See references/7.md。 - Take major(
5.8.4→5), open the table below. When writing code, only open the current tier; do not blindly read the whole folder.5.x, also note the minor: use only the5.0…5.ysubsection.
| major | file |
|---|---|
| 5 | references/5.md |
| 6 | references/6.md |
| 7 | references/7.md |
Newer majors not listed: use the highest covered tier as a base, then check the official Announcing / handbook release notes. Older: do not use the new APIs in this skill.
Baseline syntax (all 5.0+ should use)
- Use
satisfiesfor literal narrowing, notasas a catch-all. - When library authors want to preserve tuples / object literals, write the generic parameter as
const T, do not make callers sprinkleas const。 - New decorators usestandard decorators. Do not enable
experimentalDecorators, unless the project has already pinned the old semantics. - Enable
verbatimModuleSyntax: value imports andimport typeare separate; do not rely on import elision. moduleResolution: usebundlerfor bundler / Vite; for running Node directly use the current tier'snodenext/node20/node18. Do not usenode10/node。- The resolution strategy must match
--module; for details (bundlercan it be paired withcommonjs、require(esm)whichmoduleit falls under) see the current tier.