AncientSwordRage
AncientSwordRage

Reputation: 7635

Stop VSCode converting javascript imports to typescript cache on file rename

Whenever I rename a local file in VSCode, it re-writes the javascript import of external libraries to be typescript imports for a load of files.

I go from

import localFn from './localFile';
import angular from 'angular';
import { fooBar } from 'misc-package';

to

import localfn from './myLovelyLocalFile';
import angular from '../../../../../.cache/typescript/2.9/node_modules/angular';
import { fooBar } from '../../../../../.cache/typescript/2.9/node_modules/misc-package';

And this is across all package that contain angular, misc-package and anything else it thinks it has in typescript.

Is there a way to prevent this?

It looks like this is an issue 1, 2 on the VSCode github repo.

Upvotes: 0

Views: 319

Answers (1)

Ivan Milosevic
Ivan Milosevic

Reputation: 77

Add this to your settings in Vs code :

"javascript.updateImportsOnFileMove.enabled": "never",

Upvotes: 1

Related Questions