When auto-formatting React codes in VSCode it makes errors. I am using the Prettier extension. So what is the best code formatted for this?
Finally, I have found a way to do it. In the vscode settings, I have to change to default format to prettier.
As well as on the project it is needed to create a .prettierrc file with suitable configurations for the project.
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
And if you do not need it, you can always enable to format the code without the .prettierrc file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With