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

whitespace-fixer

v1.0.2

Published

A tool to fix excessive whitespace in class and className attributes of Vue, React, Angular, and Svelte files.

Downloads

4

Readme

npm license downloads downloads downloads GitHub last commit

whitespace-fixer

A tool to fix excessive whitespace in class and className attributes of Vue, React, Angular, and Svelte files, particularly handy for TailwindCSS classes.

Description

whitespace-fixer is a simple tool that helps clean up excessive whitespace in class attributes of Vue and className attributes of React files. This is especially useful for projects using TailwindCSS, where class names can get quite long and whitespace management is important for readability and maintenance.

While the TailwindCSS Prettier plugin now removes excessive whitespace, the ESLint TailwindCSS plugin does not yet offer this functionality. whitespace-fixer fills this gap by ensuring your Vue, React, Angular, and Svelte files have clean, consistent class attributes without excessive whitespace.

Additionally, this tool can be used with other JavaScript frameworks and libraries that use class or className attributes, such as Preact, Inferno, Riot.js, Hyperapp, Mithril, and vanilla JavaScript.

Installation

To install whitespace-fixer, run:

npm install -g whitespace-fixer

This will install the tool globally, allowing you to use it from anywhere on your system.

Usage

After installing the tool, you can run it from the command line. You need to provide the path to the directory containing your Vue, React, Angular, and Svelte files. If no directory is provided, the tool will default to the current directory.

Running the Tool

To run the tool on a specific directory:

whitespace-fixer /path/to/your/project

To run the tool in the current directory:

whitespace-fixer .

The tool will skip processing for :class bindings in Vue files and dynamic className bindings in React files as they often include dynamic expressions where whitespace could be intentional or necessary.

Output

The tool will output the following information to the terminal:

  • The paths of the files that have been changed.
  • The total number of Vue files processed.
  • The number of files that have been changed.

Notes

  • The tool will skip processing for :class bindings as they often include dynamic expressions where whitespace could be intentional or necessary.
  • The node_modules directory is automatically excluded from processing.

License

This project is licensed under the ISC License.

Author

Afflexux