diff --git a/docs/modules/tsc.md b/docs/modules/tsc.md new file mode 100644 index 00000000..7e6d5dde --- /dev/null +++ b/docs/modules/tsc.md @@ -0,0 +1,30 @@ +--- +description: Modern alternatives to the tsc package for the TypeScript compiler +--- + +# Replacements for `tsc` + +The npm package [`tsc`](https://github.com/basarat/tsc) is **not** the TypeScript compiler — it is a deprecated stub that prints _"This is not the tsc command you are looking for"_ when run. + +## `typescript` + +The [`typescript`](https://github.com/microsoft/TypeScript) package is the official compiler and provides the real `tsc` binary via `node_modules/.bin`. Replace `tsc` in your dependencies: + +```json +{ + "devDependencies": { + "tsc": "^2.0.4", // [!code --] + "typescript": "^5.9.0" // [!code ++] + } +} +``` + +Existing `"build": "tsc"` scripts work unchanged once `typescript` is installed. For `npx` or global installs, use `typescript` — not `tsc`: + +```bash +npx tsc --init # [!code --] +npx --package typescript tsc --init # [!code ++] + +npm install -g tsc # [!code --] +npm install -g typescript # [!code ++] +``` diff --git a/manifests/preferred.json b/manifests/preferred.json index 1860d349..35724786 100644 --- a/manifests/preferred.json +++ b/manifests/preferred.json @@ -2642,6 +2642,12 @@ "replacements": ["neotraverse"], "url": {"type": "e18e", "id": "traverse"} }, + "tsc": { + "type": "module", + "moduleName": "tsc", + "replacements": ["tsc"], + "url": {"type": "e18e", "id": "tsc"} + }, "tsup": { "type": "module", "moduleName": "tsup", @@ -3484,6 +3490,12 @@ "type": "documented", "replacementModule": "ts-graphviz" }, + "tsc": { + "id": "tsc", + "type": "removal", + "url": {"type": "e18e", "id": "tsc"}, + "description": "The `tsc` npm package is not the TypeScript compiler. Remove it and install `typescript` instead." + }, "tsdown": { "id": "tsdown", "type": "documented",