Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent insert spaces in JSX code

I have just started learning React Native. I am using Visual Studio Code for editing. Whenever I save my file it is inserting spaces in my JSX code. This reduces the readability of the code. This is code before I save the file

Before Saving the File:
Before Saving the File

This is File after saving:
This is File after saving

I have tried editing VS Code settings

"javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false

But it did not help.

Is there any solution to this problem?

like image 922
sandeep Avatar asked Jul 15 '17 06:07

sandeep


1 Answers

I managed to resolve this by manually changing the language of the file to javascriptreact instead of javascript.

Screenshot:
enter image description here

like image 86
Suraj Rao Avatar answered Sep 23 '22 15:09

Suraj Rao