Cleanup Whitespace and duplicate classnames in Tailwind using Prettier
NIDHIN KUMAR
? ???? Lead | 9+ Years of Crafting Digital Journey | User-focused web applications by combining the structured power of Angular | React | Next.js with cutting edge innovations. Driven to build what’s next! ??
Tailwind has released a new version of prettier-plugin-tailwindcss which adds support for removing unecessary whitespaces and duplicate classnames.
Cleaningup unecessary whitespace
When you are copying a classname or deleting a class name from the middle of a list, it's easy to endup with some extraspace that needs to be cleanedup.
Now prettier plugin will handle it automatically.
Removing Duplicate Classes
VS Code will warn us if we use the duplicate classnames using the yellow lines, but now Prettier plugin can remove those duplicate classes automatically.
To start playing with these improvements in your project using the following command
npm i prettier-plugin-tailwindcss@latest