Home > Net >  Vscode: How to change javascript path style for auto imports in settings (importModuleSpecifier)?
Vscode: How to change javascript path style for auto imports in settings (importModuleSpecifier)?

Time:09-26

I am trying to add the setting for javascript , regarding "Preferred path style for auto imports.", available on the default settings on this page: default settings

There is the setting: "javascript.preferences.importModuleSpecifier": "shortest",

So I wanted to add that and change the value to "non-relative".

I couldn't find anything when searching in the settings in vscode, and if I go into settings.json and add it manually like:

"javascript.preferences.importModuleSpecifier": "non-relative"

, it becomes greyed out and it says:

Unknown Configuration Setting

So where/how to change it?

Update: if I open the command palette (ctrl shift p) and search for defaultSettings.json, I can open that file. I see that there are no settings beginning with "javascript" nor "typescript" but there are such settings in the documentation. But php is available, for example "php.validate.enable", so what happened with javascript/typescript, do I have to enable it in some way?

CodePudding user response:

The reason why the settings wasn't available in defaultSettings.json was that I'm using Volar with "take over mode". It is enabled by disabling "TypeScript and JavaScript Language Features" which provide those settings.

So it's more Volar related, I guess it is up to that plugin or whatever plugin is used in take over mode.

  • Related