Gathering detailed insights and metrics for eslint-plugin-readable-tailwind
Gathering detailed insights and metrics for eslint-plugin-readable-tailwind
ESLint plugin to automatically break up long tailwind class strings into multiple lines for better readability.
npm install eslint-plugin-readable-tailwind
Typescript
Module System
Min. Node Version
Node Version
NPM Version
81.6
Supply Chain
94.4
Quality
91.7
Maintenance
100
Vulnerability
98.9
License
TypeScript (99.78%)
JavaScript (0.22%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
173,178
Last Day
872
Last Week
5,483
Last Month
23,085
Last Year
170,325
MIT License
132 Stars
328 Commits
2 Forks
1 Watchers
2 Branches
2 Contributors
Updated on Feb 15, 2025
Minified
Minified + Gzipped
Latest Version
1.9.0
Package Id
eslint-plugin-readable-tailwind@1.9.0
Unpacked Size
574.45 kB
Size
59.07 kB
File Count
285
NPM Version
10.8.2
Node Version
22.5.1
Published on
Jan 19, 2025
Cumulative downloads
Total Downloads
Last Day
267.9%
872
Compared to previous day
Last Week
-14.4%
5,483
Compared to previous week
Last Month
46.2%
23,085
Compared to previous month
Last Year
5,870%
170,325
Compared to previous year
2
ESLint plugin to automatically break up long tailwind class strings into multiple lines based on a specified print width or class count. This improves readability and eliminates horizontal scrolling.
In addition it sorts the classes logically, removes unnecessary whitespaces and duplicate classes and groups the classes by their variants. It works in jsx, svelte, vue, and html files.
Buy me a coffee | GitHub Sponsors
This project is financed by the community.
If you or your company benefit from this project, please consider becoming a sponsor or making a one-time donation.
Your contribution will help me to maintain and develop the project.
1npm i -D eslint-plugin-readable-tailwind
Depending on the flavor you are using, you may need to install and configure the corresponding parser:
Two predefined configurations are available that contain the recommended rules:
error
- will throw an error if the rule is violatedwarning
- will throw a warning if the rule is violatedThe following table shows the available rules and if they are enabled by default in the different configurations:
Name | Description | error | warning | autofix |
---|---|---|---|---|
multiline | Enforce consistent line wrapping for tailwind classes. | ✔ | ✔ | ✔ |
no-unnecessary-whitespace | Disallow unnecessary whitespace in tailwind classes. | ✔ | ✔ | ✔ |
sort-classes | Enforce a consistent order for tailwind classes. | ✔ | ✔ | ✔ |
no-duplicate-classes | Remove duplicate classes. | ✔ |
This plugin works out of the box with most popular tailwind utilities:
In case an utility is not supported or you have built your own, you can change which literals will get linted for each rule. Read the API documentation to learn how to override or extend the default config.
All rules are intended to automatically fix the tailwind classes. If you have installed the VSCode ESLint plugin, you can configure it to automatically fix the classes on save by adding the following options to your .vscode/settings.json
:
1{ 2 // enable ESLint to fix tailwind classes on save 3 "editor.codeActionsOnSave": { 4 "source.fixAll.eslint": "explicit" 5 } 6}
No vulnerabilities found.
No security vulnerabilities found.