What the agent does
TypeScript 5.0 deprecated a group of compiler options and 5.5 removed them. For importsNotUsedAsValues the two stages read differently. On 5.0 to 5.4, tsc stops with error TS5101: Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5, and offers "ignoreDeprecations": "5.0" to silence it. From 5.5 the message is error TS5102: Option 'importsNotUsedAsValues' has been removed. Please remove it from your configuration, followed by Use 'verbatimModuleSyntax' instead, and ignoreDeprecations no longer helps: with both settings present, TS5102 is still reported. A project that silenced the first message two years ago meets the second on its next compiler bump.
The error can sit unnoticed in a healthy repository, and FrankerFaceZ/FrankerFaceZ, a browser extension for Twitch, shows how. Line 21 of its tsconfig.json sets "importsNotUsedAsValues": "error", package.json asks for "typescript": "^5.8.3", and pnpm-lock.yaml resolves 5.8.3. Yet the build never runs the compiler. webpack.config.js sends .ts and .tsx files through esbuild-loader, which strips types without checking them, and the CI workflow runs only pnpm install and pnpm build. tsc is invoked by one script, build:types, which runs tsc --declaration --emitDeclarationOnly --outDir typedist to produce the type package for add-on authors. That script is where the removed option is fatal.
The agent runs tsc --noEmit to get the configuration error on its own, then decides between two fixes by reading what the option was doing. Set to error, it kept every import statement in the output and reported any import that was only used as a type but not written as import type. verbatimModuleSyntax is the successor to that behaviour: imports without a type modifier are kept, and a type imported without one is error TS1484. A codebase that passed under the old error setting already writes import type nearly everywhere, so the agent makes the swap and lets tsc list the files that still need a modifier. If the list is long or the project emits CommonJS, where the new option forbids import syntax altogether, it deletes the option instead and says why.
Because the bundler reads the same file, the agent checks the build as well as the type check. esbuild takes importsNotUsedAsValues, preserveValueImports and verbatimModuleSyntax from tsconfig.json to decide whether an unused import is dropped or kept for its side effects, so changing the setting can change which modules end up in the bundle. The agent runs pnpm build before and after and compares the emitted file list and sizes. It then runs pnpm build:types to the end. Once the configuration error is gone, tsc can reach the source, and any ordinary type errors it finds there are reported as a separate list, not mixed into this fix. Last, it searches the config for the other options that left in the same release, such as preserveValueImports and suppressImplicitAnyIndexErrors.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Running the TypeScript compiler in this project fails with \"error TS5102: Option 'importsNotUsedAsValues' has been removed. Please remove it from your configuration.\" (on TypeScript 5.0 to 5.4 the same option gives TS5101). Read every tsconfig file, including ones reached through extends, and report where the option is set and to which value. Read package.json and the lockfile and report the declared and installed TypeScript version. Find every script and CI step that invokes tsc, typedoc or a type-checking plugin, and say whether the normal build runs the compiler at all or uses a transpiler such as esbuild, swc or Babel that only strips types. Install dependencies with the project's package manager and reproduce the error with tsc --noEmit. Then fix the configuration. If the value was preserve or error, replace the option with verbatimModuleSyntax set to true, run tsc, and add the type modifier to each import or export the compiler reports; if that produces changes outside import and export lines, or the project emits CommonJS, delete the option instead and explain. If the value was remove, delete the line. Remove ignoreDeprecations if nothing else needs it. Check for the other options removed in TypeScript 5.5 and handle them the same way. Run the production build before and after your change and compare the list of emitted files and their sizes, because bundlers read these tsconfig fields too. Run every script that invokes tsc to completion; report type errors unrelated to this option as a separate list and do not fix them here. If no CI step runs the compiler, add a tsc --noEmit step. Open a pull request with the error before, the compiler output after, and the build comparison.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
A pull request that changes one line of tsconfig.json and, where verbatimModuleSyntax was adopted, the import lines the compiler flagged, each gaining a type modifier and nothing else. The description gives the TypeScript version, the scripts that call the compiler, the configuration error before the change, and the compiler output after it. It includes the before and after comparison of the production build and a separate list of unrelated type errors if the compiler found any once it could run.
A reviewer checks that the diff outside the config is confined to import and export statements. They read the build comparison: a new module in the bundle, or a size change, means an import that used to be dropped is now kept, and that deserves a look before merging. If the agent added a tsc --noEmit step to CI, they decide whether it should block merges yet, given the list of existing type errors. The agent does not claim the type package or the extension works in a browser; it reports which commands completed and what they printed.
Run it on every pull request labelled typescript-upgrade
The removal bites on a compiler bump, which usually arrives as a dependency pull request with failing checks, or with passing checks and a broken script nobody ran. Add an automation to the Project with a github trigger on pull_request.labeled and a label such as typescript-upgrade, and a prompt that checks out the pull request, runs every script that calls the compiler, and fixes configuration options the new version rejects. A team member applies the label. The trigger fires only for a pull request that an owner, member or collaborator opened, so one a dependency bot opened never fires it, whoever adds the label: open your own pull request from the bot's branch and label that one.
For a monorepo or a set of packages that share a base config, one run per package is cleaner than one large change. Send the request above for each from a script. Each run returns 202 with a session at once, and a webhook_url on the key delivers run.completed as each finishes.
The use case this job follows, with its automation and trigger: Fix a bug from an alert.
Why run it on Rush?
The risky part of this fix is not the line in the config. It is whether the replacement changes what gets bundled, and whether the compiler, once it can run again, turns up errors that were hidden behind the configuration failure. Answering both means installing the project's dependencies and running its real build twice plus the type build once. The agent does that in a sandbox with the package manager and lockfile the repository specifies, and the before and after outputs are kept in the session for the reviewer to compare.
It also checks something a quick local fix skips: where the compiler runs at all. In a project whose bundler strips types, a broken tsc configuration can go unseen for months because no required check invokes it. The run lists every script and workflow step that calls the compiler and adds the missing check, so the next removed option fails a pull request instead of a release script.
Frequently asked questions
Should I replace the option with verbatimModuleSyntax or just delete it?
It depends on the old value. remove was the default, so deleting the line changes nothing. preserve and error kept import statements in the output, and verbatimModuleSyntax is the option that still does that. The agent reads the value and chooses, and falls back to deleting when the stricter rules of the new option do not suit the project.
I already set ignoreDeprecations to "5.0". Why is it failing now?
That setting only postponed the removal. It silences TS5101 on TypeScript 5.0 to 5.4. From 5.5 the option is gone and TS5102 is reported whether or not ignoreDeprecations is present.
My tsconfig has the option but tsc does not complain. Why?
Look at the value. With "importsNotUsedAsValues": "remove" TypeScript 5 prints neither TS5101 nor TS5102, because that value is the default behaviour. The line is still dead configuration, and tools that are stricter about unknown options may reject it, so the agent removes it.
The option is not in my tsconfig.json. Where else can it be?
In a config yours extends. Shared bases such as a framework's recommended tsconfig used to set it, and an old version of that package in your lockfile still does. The agent follows the extends chain, and when the option lives in a dependency it upgrades that package instead of editing node_modules.
What does verbatimModuleSyntax ask of my code?
That type-only imports and exports say so. import { User } from './types' becomes import type { User } from './types', or import { type User, load } from './api' for a mixed line. The compiler reports each place as TS1484, and the change has no effect at run time.
More TypeScript jobs
More jobs like this: Fix a bug from an alert
- Fix "ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape" (NumPy)
- Fix "AttributeError: module 'inspect' has no attribute 'getargspec'" on Python 3.11 (inspect)
- Fix TypeError: Cannot Read Properties of Undefined (Reading 'FLAGS') in discord.js 14 (discord.js)