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.
It also sorts the classes logically, removes unnecessary whitespaces and groups the classes by their modifiers. It works in jsx, svelte, vue, and html files and is designed to work well with and without prettier.
This project is financed by the community.
If you or your company benefit from this project, please consider becoming a sponsor.
Your contribution will help me maintain and develop the project.
Installation
npm i -D eslint-plugin-readable-tailwind
Quick start
Check out the Parsers section below to see how to configure the plugin for your specific flavor.
Read the Rules section to learn about the available rules and how to configure them.
Read the Utilities section to see which tailwind utilities are supported out of the box and how to extend the default configuration.
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.
Editor configuration
VSCode
Auto-fix on save
These 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:
auto-wraps tailwind classes after a certain print width or class count into multiple lines to improve readability.
The npm package eslint-plugin-readable-tailwind receives a total of 17,914 weekly downloads. As such, eslint-plugin-readable-tailwind popularity was classified as popular.
We found that eslint-plugin-readable-tailwind demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 20 May 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.
More than half of CISOs now manage 10+ security areas, often with few legal safeguards and short tenures, yet continue to secure budgets and higher pay.