After a recent update, if I edit a file outside Cursor while it’s open e.g. by switching git branches then the linter I’m using (biome) gets confused and shows a ton of lint errors because it’s reading a stale version of the file or getting line numbers mixed up. I’m unsure if it’s a bug with the linter or Cursor but there have been no changes to the linter recently.
Steps to Reproduce
Install biome extension
Open a .ts file and edit it, confirm no lint errors and commit
Create a new git branch and edit the file, confirm no lint errors, commit
Switch back to the old branch and see a bunch of lint errors
Expected Behavior
Linter should get fresh version of the file when it changes in background
Hey, thanks for the report. This is a known issue with file watchers after git operations. I’ve seen similar cases here.
Try these steps to debug it:
Quick workaround:
CMD+Shift+P > “Developer: Reload Window” after switching branches
Or just close and reopen the file
To diagnose the root cause:
Launch Cursor with extensions disabled: run cursor --disable-extensions in a terminal, then try to reproduce the issue. If it goes away, it’s likely a conflict with an extension.
Open the Console (Help > Toggle Developer Tools > Console tab), switch branches, and check if there are any errors.
Try switching branches using Cursor’s built-in Source Control panel instead of the terminal. Does it still happen?
Can you share what you find? I’m especially interested in the first one, does this still happen with extensions disabled.
Thanks for the reply. But just to be clear – the file appears updated to me visually but the extension (Biome) appears to be reading an old or corrupted version of the file. So step 1 doesn’t really make sense as the problem manifests through the Biome extension so it’s necessary to have at least that extension running. Restarting Biome/reloading the developer window does fix the problem but it’s very disruptive to work and also makes terminal AI agents get confused because they see lint errors in Cursor when they make a change.