This package will be deprecated soon as it has been superseded by another package with a wider scope of usage.
You can check out the whitespace-fixer package for a more comprehensive solution.
A tool to fix excessive whitespace in class attributes of Vue files.
vue-class-whitespace-fixer
is a simple tool that helps clean up excessive whitespace in class attributes of Vue 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. vue-class-whitespace-fixer
fills this gap by ensuring your Vue files have clean, consistent class attributes without excessive whitespace.
To install vue-class-whitespace-fixer
, run:
npm install -g vue-class-whitespace-fixer
This will install the tool globally, allowing you to use it from anywhere on your system.
After installing the tool, you can run it from the command line. You need to provide the path to the directory containing your Vue files. If no directory is provided, the tool will default to the current directory.
To run the tool on a specific directory:
vue-class-whitespace-fixer /path/to/your/vue/project
To run the tool in the current directory:
vue-class-whitespace-fixer .
vue-class-whitespace-fixer /Users/yourname/projects/my-vue-app
This command will traverse through the specified directory, process all Vue files, and fix excessive whitespace in their class attributes.
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.
- 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.
This project is licensed under the ISC License.
Afflexux