I am using Vim (neovim) for the past couple of weeks now. I am facing one problem with the way vim formats the code. My other team members uses vscode which formats JS file on Save something like this:
function test(test,test){
const {getter,setter} = dummyObj;
}
The above code gets formated into:
function test(test, test) { // Notice the space between params
const { getter, setter } = dummyObj; // Notice the space between destructed variables
}
And Vim does exactly the opposite, which is on save file it removes any spaces between params and etc.
So when I save a file in nvim if that was saved in Vscode earlier it will now format by my nvim. And these changes will be counted as modification in GIT
Does anybody notice or encounter this issue? How you are tacking it?
The plugin I am using is: coc-vim
and I have added auto-format on save the file in coc-vim configuration file:
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"json"
]
}