'Why does my prettier show red color upon saving
Solution 1:[1]
This just means you have an indentation problem with the prettier config. I think by default prettier expects 2 space indentation. You may want to get into your settings: with command ,
on MacOS ( not sure the command on other OSs). then search for prettier space
and you should see something like this. You can play with the value under the 1 TabWith
.
Solution 2:[2]
This problem can be solved by simply re-adjusting the default vscode Tab size configuration. Pressing cmd ,
(opens User Setting) and then type Tab Size. Set that Tab Size to 2.
This is happening because your default setting is set to 1 Tab = 4 spaces and your prettier is formatting it with 2 spaces.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Claeusdev |
Solution 2 | Abhijit Misra |