Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Requesting ‘Typescript: Remove Unused Imports’ from the Command Palette does not remove unused imports, despite the typescript server correctly reporting them as reportsUnnecessary.
This is a regression in Cursor. This used to work, and it still works for the same repository in VS Code.
The typescript server (6.0.3) correctly identifies the import as unnecessary when you inspect the tsserver.log. See below for suggestion","reportsUnnecessary":true
Info 96 [21:27:06.277] event:
{"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/workspaces/imports-broken/src/main.ts","diagnostics":[]}}
Info 97 [21:27:06.277] event:
{"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/workspaces/imports-broken/src/main.ts","diagnostics":[]}}
Info 98 [21:27:06.277] event:
{"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/workspaces/imports-broken/src/main.ts","diagnostics":[{"start":{"line":1,"offset":1},"end":{"line":1,"offset":42},"text":"'createHash' is declared but its value is never read.","code":6133,"category":"suggestion","reportsUnnecessary":true}]}}
Info 99 [21:27:06.277] event:
{"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":6,"performanceData":{"diagnosticsDuration":[{"syntaxDiag":0.011620000004768372,"semanticDiag":0.012939000000187661,"suggestionDiag":0.1231060000063735,"file":"/workspaces/imports-broken/src/main.ts"}]}}}
I’ve included my own full tsserver.log and version info in the reproduction github repository I’ve created below.
Steps to Reproduce
-
Create a typescript file with an unused import, such as:
import { createHash } from "node:crypto"; // no other code, just the import above -
Ctrl+Shift+P (windows/linux) or the mac equivalent to open the command palette
-
Select:
> Typescript: Remove Unused Imports
For a hermetic environment reproducing this bug minimally using a devcontainer, please clone:
^— My tsserver.log is duplicated in there for reference. The relevant log activity when requesting Remove Unused Imports occurs starting at Info 88 within the log.
Expected Behavior
Unused typescript imports should be removed.
Operating System
Linux
Version Information
Note that I am using Remote over SSH + devcontainers. The host running typescript is Linux x86_64. The version below is for the Windows environment that is driving the remote SSH+devcontainer.
Version: 3.15.6 (user setup)
VS Code Extension API: 1.128.0
Commit: a1f686545fd0ce8917bbd2449f733551a9bce420
Date: 2026-08-06T01:41:03.876Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.291
OS: Windows_NT x64 10.0.26200
Additional Information
This bug occurs regardless of whether a devcontainer is used. This occurs regardless of whether the typescript is the 6.0.3 embedded within Cursor, or whether I use the same 6.0.3 from my own node_modules.
Another user reported a more generic bug recently, but I’m creating this one with a clear, concise description for reproduction and logs. Another user reports that the bug did /not/ exist in Cursor v3.14.7 - but that they later saw the bug starting in v3.14.27. Source comment: forum. cursor. com/t/javascript-remove-unused-imports-organize-imports-no-op/167696/10
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor