Reputation: 21
I have this problem - I cannot use Tailwind in my project or optional chaining operator (?.) because VSCode adds an extra whitespace after a colon or after a dot. In case of taiwind, it adds a whitespace after a colon and it creates an error. For instance, it should be like this:
<p>button class="bg-sky-500 hover:bg-sky-700 ..."</p>
But it formats it to this:
<p>button class="bg-sky-500 hover: bg-sky-700 ..."</p>
When i remove it, it automatically adds a whitespace again. I actually use Cursor and it is the same there.
I have a workaround - I used WebStorm and it doesn't do it there, but I don't like to use it.
What i did was add a "prettier-ignore" comment to the beginning of each file, but the problem persisted. I also created a file ".prettierignore" but it didn't help either. I also marked "false" on "format on autosave" in VSCode settings.
Upvotes: 1
Views: 33