npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@softonus/prettier-plugin-whitespace-remover

v1.3.1

Published

Prettier plugin that removes whitespaces of className, class

Downloads

4,698

Readme

🚀 Prettier Plugin: Whitespace Remover

A powerful Prettier plugin designed to remove unnecessary whitespaces from class attributes (class and className) across Vue.js, Angular, React, Next, Nuxt and HTML projects.

This plugin ensures that class names are clean and consistently formatted by trimming excess spaces and standardizing them, improving the overall code quality.


🗂 Installation

Install the plugin for your project using one of the following package managers:

Bun:

bun add -D @softonus/prettier-plugin-whitespace-remover

Yarn:

yarn add -D @softonus/prettier-plugin-whitespace-remover

npm:

npm install --save-dev @softonus/prettier-plugin-whitespace-remover

🔨 Usage

  1. Create a .prettierrc file (if you don’t already have one) in your project’s root directory.

  2. Add the plugin to your Prettier configuration:

{
  "plugins": ["@softonus/prettier-plugin-whitespace-remover"]
}

This will automatically apply the plugin to clean up whitespace in your React, Vue.js, Angular, Next, Nuxt and HTML projects.


🌐 Supported Frameworks

  • React & Next.js: Cleans up className attributes.
  • Vue.js: Cleans up class attributes within .vue files.
  • Angular: Cleans up class attributes in HTML and Angular templates.
  • Plain HTML: Cleans up class attributes in regular HTML files.

⚡ Features

  • Cleans up class names: Removes unnecessary spaces and trims multiple spaces into a single space.
  • Works across all major frameworks: Supports React, Vue, Angular, Next.js, and plain HTML.
  • Zero configuration: Simply add the plugin and start formatting.

📝 Example

Before Prettier:

<div class="    btn  btn-primary  ">
  Hello World
</div>

After Prettier:

<div class="btn btn-primary">
  Hello World
</div>

📨 Contact

For inquiries or suggestions, reach out to me at [email protected].


🤝 Contributions

Contributions are welcome! If you have any improvements or fixes, feel free to open an issue or create a pull request.


🏷️ License

Distributed under the MIT License. See LICENSE for more information.