Socket
Socket
Sign inDemoInstall

eslint-plugin-readable-tailwind

Package Overview
Dependencies
195
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-readable-tailwind

auto-wraps tailwind classes after a certain print width or class count into multiple lines to improve readability.


Version published
Weekly downloads
698
increased by6.4%
Maintainers
1
Install size
9.43 MB
Created
Weekly downloads
 

Changelog

Source

v1.3.2

compare changes

Fixes

  • Remove unnecessary newline after single sticky class (#23)
  • Prevent inserting new line if the first class is already too long (#24)

Tests

  • Simplify testing (#22)

Readme

Source
eslint-plugin-readable-tailwind logo

GitHub license npm version GitHub issues npm weekly downloads GitHub repo stars GitHub workflow status




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.



eslint-plugin-readable-tailwind example


eslint-plugin-readable-tailwind logo

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

Usage

Please read the documentation for the specific flavor you are using:



Rules

NameDescriptionerrorwarningautofix
multilineEnforce consistent line wrapping for tailwind classes.
no-unnecessary-whitespaceDisallow unnecessary whitespace in tailwind classes.
sort-classesEnforce a consistent order for tailwind classes.


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:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  }
}


🩷 Sponsored by the following awesome people and organizations

No awesome people or organizations have sponsored this project yet.

Keywords

FAQs

Last updated on 22 Apr 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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc