eslint-plugin-tailwindcss

ESLint rules that keep Tailwind CSS classnames consistent, valid, and free of contradictions.

Tool
npm
v4.4.0
2,074stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
87/100Excellent
Development Activity92
Maintenance100
Community56
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
86/100Excellent
Architecture85
Code Quality88
Innovation80
Learning Curve90

eslint-plugin-tailwindcss is a set of ESLint rules purpose-built for projects using Tailwind CSS v4. Rather than leaving classname hygiene to code review, it plugs directly into the ESLint flat config pipeline and calls the real Tailwind CSS compiler (via a synchronous worker built on synckit) to check whether classnames are valid, canonical, contradictory, or could be written more concisely.

The plugin ships nine rules covering classname ordering, canonical spelling, shorthand enforcement, arbitrary-value usage, and contradiction detection, with several auto-fixable via --fix. Because it parses classnames out of JSX/TSX attributes, template literals, and utility functions like clsx, cva, and tw, it works across React, Vue, Svelte, and Angular templates rather than being tied to one framework.

What You Get

  • Nine rules covering classname ordering, canonical spelling, shorthand enforcement, negative-value formatting, and contradiction detection
  • Auto-fix support (--fix) for the rules that can be mechanically corrected, plus editor-suggestion fixes for the rest
  • A recommended flat-config preset that enables sensible defaults out of the box
  • Real Tailwind CSS v4 compiler integration via a synchronous worker, so validity checks reflect the actual resolved theme rather than a hardcoded utility list
  • Configurable attribute and function scanning (class, className, clsx, cva, tw, twMerge, and more) so classnames are found wherever they’re written, not just in a class attribute
  • Framework-agnostic parsing across React/JSX, Vue, Svelte, and Angular templates

Common Use Cases

  • Enforcing a consistent, deterministic classname order across a team so diffs stay clean and reviewable
  • Catching contradicting utility classes (e.g. flex and hidden fighting for the same property) before they ship
  • Flagging custom, non-Tailwind classnames that snuck into a className prop by mistake
  • Running as a CI/pre-merge check so Tailwind class hygiene doesn’t rely on manual review
  • Simplifying verbose multi-class combinations into Tailwind’s built-in shorthand utilities automatically

Under The Hood

Architecture The plugin is organized as a standard ESLint flat-config plugin object (src/index.ts) that registers nine independent rule modules under src/rules/, each exporting a rule name and an ESLint rule object built on @typescript-eslint/utils. Classname extraction is centralized in src/utils/parser/ (classname, groups, node, and visitor modules) so every rule shares the same logic for locating classnames inside JSX attributes, template literals, and utility-function calls rather than re-implementing extraction per rule. The most consequential architectural choice is src/utils/tailwindcss-api/index.ts, which offloads calls into the real Tailwind CSS v4 compiler to a worker thread via synckit’s createSyncFn, exposing it to ESLint’s synchronous rule API through a small in-memory cache (theme, sorted classnames, validity, class properties) with size- and age-based eviction — this is what lets rules make compiler-accurate decisions without ESLint having to go async.

Tech Stack Written in TypeScript and built with unbuild, targeting Node 20.19+ and ESLint 9/10 via @typescript-eslint/utils’s flat-config types. It depends on postcss and postcss-nested for CSS parsing, tailwind-api-utils and a bundled worker script for talking to the real Tailwind compiler, and synckit to bridge that async compiler API into ESLint’s synchronous rule execution model. Framework-specific parsing is handled through peer parsers pulled in as dev/test dependencies only when needed (vue-eslint-parser, svelte-eslint-parser, @angular-eslint/template-parser).

Code Quality Test coverage is extensive and co-located: nearly every rule and utility file under src/ has a matching .spec.ts file, and several performance-sensitive utilities (enforces-shorthand, get-theme-key-prefixes-from-classname) also have .bench.ts benchmark files, run via Vitest. CI (.github/workflows) runs pnpm run lint and pnpm run test on every push. The project dogfoods eslint-plugin-eslint-plugin and eslint-plugin-unicorn on its own source, and rules are fully typed against ESLint’s flat-config Rule types rather than using loosely-typed rule objects.

API Design The public surface is intentionally small: install the plugin, spread the recommended config, and set one required setting (cssConfigPath) pointing at the project’s Tailwind CSS file. A typed PluginSettings export gives editors autocomplete and validation on the settings object via JSDoc @type annotations, and sensible defaults exist for every other setting (which attributes/functions to scan, cache size/age) so most projects only ever touch the one mandatory field.

Used by 10 apps in this directory

TypeScript
99%
Other

Activepieces

Automation · AI Assistants

24,298

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript99%
Updated today
Rust
53%
Other

Cap

Team Chat · Video Conferencing

21,859

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
64
Dependency
Built with
Rust53%
TypeScript43%
Updated yesterday
JavaScript
47%
MIT

Ghost

CMS · Blogging

55,191

Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.

View details
96
Repo Health
85
Technical
67
Dependency
Built with
JavaScript47%
TypeScript47%
Updated yesterday
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,372

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
65
Dependency
Built with
TypeScript71%
Go16%
Updated 2 weeks ago
TypeScript
98%
Other

Langfuse

AI Development · Monitoring

34,264

Open source AI engineering platform for LLM observability, prompt management, evaluation, and debugging — self-host in minutes or use Langfuse Cloud.

View details
92
Repo Health
81
Technical
66
Dependency
Built with
TypeScript98%
Updated yesterday
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

27,743

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
88
Repo Health
73
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
90%
Apache 2.0

Nanobrowser

Productivity · Automation · AI Assistants

13,750

Open-source Chrome extension for AI-powered web automation — run multi-agent browser workflows locally using your own LLM API keys, free from cloud subscriptions.

View details
61
Repo Health
66
Technical
73
Dependency
Built with
TypeScript90%
Updated 2 weeks ago
Ruby
60%
MIT

OnetimeSecret

Security

2,920

Generate self-destructing single-use links to share passwords and sensitive data without leaving traces in inboxes or chat logs.

View details
92
Repo Health
81
Technical
73
Dependency
Built with
Ruby60%
TypeScript26%
Vue10%
Updated today
Rust
93%
Other

Tabby

AI Code Assistants

33,868

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
60
Repo Health
78
Technical
61
Dependency
Built with
Rust93%
Updated 2 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search