VS Code auto-completes JavaScript import {A...} as following:
import { Action } from './action.js';
I would like to change it to:
(remove spaces in the braces for import only)
import {Action} from './action.js';
Where can that be edited?
it's easy first of all open VS-Code then in the settings from the menu, search for javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces in the search bar and uncheck the box to disable it!
then save it and restart VS-Code for the changes to take effect.
Update
open settings, then in the search bar, type editor.formatOnType and and check the box next to it.
Now, click on "Edit in settings.json" and add these lines:
"[javascript]": {
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.insertSpaces": false
},
as you can see editor.insertSpaces setting is set to false, which will prevent spaces from being inserted between the braces and the import statement!
at the end save the changes and close it.
good luck !
import auto-complete.javascript.preferences.importModuleSpecifier refers to the path and nothing to do with the format of the braces. See also: stackoverflow.com/a/51074467/3529456insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces and after unchecking, and even restarting, it didn't make any difference for the import in my example.
import {, it adds the closing braces and then after entering A it provides a selection, and after choosing Action, it changes{Action}to{ Action }and automatically addsfrom './action.js';