Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

tailwind-lint

Latest version: v0.17.2

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: ph1p
38 Stars
4 Forks
10 Versions
13.3K Downloads
TypeScript Repo language

Scan summary

tailwind-lint was last scanned on 23 Nov 2026 at version 0.17.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 10 versions; the latest 2 were published within 7 days (17–23 Nov 2026).
  • Findings: No rules fired in version 0.17.2.
  • Downloads: 13,309 downloads.

Versions

10 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.17.2 LATEST 23 Nov 2026 No rules fired
0.17.1 17 Nov 2026 No rules fired
0.17.0 7 Nov 2026 No rules fired
0.16.2 7 Nov 2026 Not shown
0.16.1 3 Nov 2026 Not shown

No rules fired in 0.17.2

Findings

Findings for v0.17.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.17.2; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

Tailwind CSS Linter (CLI)

It just lints your Tailwind project as the IDE will do, just on the command line. Supports Tailwind CSS v4 (CSS config files and Vite projects using @tailwindcss/vite) and v3 (JavaScript config, legacy).

Installation

# npm
npm install -g tailwind-lint

# pnpm
pnpm add -g tailwind-lint

# npx (no installation)
npx tailwind-lint "src/**/*.html"

# pnpm dlx (no installation)
pnpm dlx tailwind-lint "src/**/*.html"

Usage

# fastest way to lint and fix issues
npx tailwind-lint --auto --fix

tailwind-lint [options] [files...]
Quick Start

Simply run tailwind-lint in your project directory - it automatically discovers your Tailwind config and files:

# Auto-discover config and lint files
tailwind-lint

# Fix issues automatically
tailwind-lint --fix

# Verbose mode for debugging
tailwind-lint --verbose
How Auto-Discovery Works

Tailwind CSS v4:

  • Finds CSS config files in common locations: app.css, index.css, tailwind.css, global.css, etc.
  • Searches in project root and subdirectories: ./, ./src/, ./src/styles/, ./app/, etc.
  • Detects vite.config.* files that use @tailwindcss/vite
  • Prefers real CSS configs when present, so custom @theme tokens and @source directives are available to diagnostics
  • Uses file patterns from @source directives if present
  • Falls back to default pattern: ./**/*.{js,jsx,ts,tsx,html,vue,svelte,astro,mdx}
  • Note: When CSS config is in a subdirectory (e.g., src/styles/global.css), files are discovered from the project root

Tailwind CSS v3:

  • Finds JavaScript config files: tailwind.config.js, tailwind.config.cjs, tailwind.config.mjs, tailwind.config.ts
  • Uses file patterns from the content array in your config, resolved from the package root (or from the config file with content.relative: true)

Monorepos:

  • Workspace packages from package.json workspaces or pnpm-workspace.yaml are detected; without a workspace definition every directory with a package.json is treated as a package
  • Each package gets its own config detected; packages without one fall back to the closest parent config
  • Each file is linted with the config of the closest package that contains it, so apps with different themes or Tailwind versions (v3 and v4 side by side) are linted correctly
  • tailwindcss is resolved from the config's package first, falling back to the working directory
  • Use --verbose to see which config each package uses
Options
  • -c, --config <path> - Path to Tailwind config file (default: auto-discover)
  • -a, --auto - Auto-discover files from the resolved Tailwind config or CSS @source directives
  • --fix - Automatically fix problems that can be fixed
  • --dry-run - Show the fixes --fix would apply (with a line diff) without writing any files
  • --concurrency <number|auto> - Worker threads for linting and fixing (default: 1)
  • --format <text|json> - Output format (text default, json for machine-readable output)
  • -v, --verbose - Enable verbose logging for debugging
  • -h, --help - Show help message
  • --version - Show version number
Advanced Examples
# Lint specific files only
tailwind-lint "src/**/*.{js,jsx,ts,tsx}"

# Specify a custom config location
tailwind-lint --config ./config/tailwind.config.js

# Scan files based on an explicit config
tailwind-lint --config ./src/app.css

# Lint and fix specific file types
tailwind-lint "**/*.vue" --fix

# Preview fixes without changing files
tailwind-lint --dry-run

# Lint with a specific CSS config (v4)
tailwind-lint --config ./styles/app.css

# Lint a Vite-based Tailwind v4 project
tailwind-lint --auto

# Machine-readable output for LLMs/agents
tailwind-lint --auto --format json

LLM / Agent Integration

Use JSON output to avoid brittle text parsing:

tailwind-lint --auto --format json

The JSON payload includes:

  • ok - true when no errors are found
  • summary - counts for errors, warnings, fixable, fixed, filesWithIssues, totalFilesProcessed
  • config - resolved runtime values (cwd, configPath, autoDiscover, fix, dryRun, patterns)
  • files[] - per-file diagnostics with 1-based line/column ranges

On JSON errors, the CLI keeps the same top-level shape and adds error so agent integrations do not need a separate parser for failure cases.

Typical agent flow:

  1. Run tailwind-lint --auto --format json.
  2. If summary.errors > 0, fail the check and surface diagnostics.
  3. If only warnings exist, optionally continue and open a cleanup task.
  4. Re-run with --fix when autofix is allowed.

Configuration

Tailwind CSS v4

Create a CSS config file (app.css, index.css, or tailwind.css):

@import "tailwindcss";

@theme {
    --color-primary: #3b82f6;
}

@source "./src/**/*.{js,jsx,ts,tsx,html}";

The CLI auto-detects configs at: app.css, src/app.css, index.css, src/index.css, tailwind.css, src/tailwind.css

You can also use a Vite-based Tailwind v4 project with @tailwindcss/vite and no standalone Tailwind CSS config file:

import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";

export default defineConfig({
    plugins: [tailwindcss()],
});

If a real CSS config is also present, the CLI uses that file so custom @theme tokens and @source directives are available to diagnostics.

Workspace Settings

The CLI also reads Tailwind workspace settings from common editor config files so extraction behavior can match your editor more closely.

Class extraction matches the Tailwind language server defaults: class attributes such as class and className are linted, but plain JS/TS string literals are not. To lint class strings outside attributes, configure classFunctions (e.g. cva, cx) or experimental.classRegex.

Supported locations:

  • .zed/settings.json
  • .vscode/settings.json

Other editors' settings (e.g. JetBrains .idea) are not read. Whatever editor you use, put shared Tailwind settings in one of the files above so the CLI and CI pick them up.

Supported settings:

  • classFunctions
  • experimental.classRegex
  • classAttributes
  • includeLanguages
  • files.exclude
  • lint
  • rootFontSize

Zed format:

{
    "lsp": {
        "tailwindcss-language-server": {
            "settings": {
                "classFunctions": ["cva", "cx"],
                "experimental": {
                    "classRegex": ["tw=\"([^\"]*)\""]
                }
            }
        }
    }
}

VS Code format:

{
    "tailwindCSS.classFunctions": ["cva", "cx"],
    "tailwindCSS.experimental": {
        "classRegex": ["tw=\"([^\"]*)\""]
    }
}
Tailwind CSS v3 (Legacy)

Create a JavaScript config file (tailwind.config.js):

/** @type {import('tailwindcss').Config} */
module.exports = {
    content: ["./src/**/*.{js,jsx,ts,tsx}"],
    theme: {
        extend: {},
    },
    plugins: [],
};

CPU parallelism

Opt in to multiple CPU cores with --concurrency. It works for both linting and autofix:

tailwind-lint --auto --concurrency 4
tailwind-lint --auto --concurrency 4 --fix
tailwind-lint --auto --concurrency auto --fix

Use a positive integer to choose the number of worker threads, or auto to use Node.js's available CPU parallelism. The number of workers is capped by the number of discovered files. The default, 1, runs in the main thread without starting workers.

Files are discovered and assigned to their Tailwind config before workers start. Each file is processed once, with the complete fix loop handled by one worker. Workers load independent Tailwind states before any fixes begin, and results remain sorted by file path, including in JSON output.

For v4 canonical class suggestions, workers collect candidates through the same language-service extraction and workspace settings used by validation. Suggestions are prepared once per config and font-size setting, then shared as plain strings. Classes introduced during fixing that are absent from that lookup use Tailwind's normal implementation.

Workers add startup time and memory usage for their Tailwind states. Small projects may be faster with --concurrency 1; compare values on your own project before choosing a default for CI. In the JavaScript API, pass concurrency: 4 or concurrency: "auto" to lint() from the built package.

To compare cold CLI runs on generated fixtures after building the project:

node scripts/benchmark-concurrency.mjs --files 80 --runs 3
node scripts/benchmark-concurrency.mjs --files 320 --fix-lines 10 --runs 3

The benchmark rotates the order of 1, 2, and 4 workers, includes startup in its timing, and checks identical diagnostics and fixed file contents. --output report.json saves individual measurements and medians. These synthetic workloads do not predict the speedup for every project.

Autofix

Use --fix to automatically resolve issues:

  • Canonical class suggestions (v4) - Replaces arbitrary values with standard classes
  • Recommended variant order (v3 & v4) - Reorders variants correctly

Use --dry-run to preview the changes without writing them.

Fixes that do not overlap are applied together, and files are revalidated until no fixable issues remain. The autofix process has a safety limit of 100 iterations per file to prevent infinite loops.

Features

Core (v3 & v4):

  • CSS Conflicts - Detects when multiple classes apply the same CSS properties (e.g., block flex, text-left text-center) - Note: Works reliably in v4, limited support in v3 - no autofix
  • Invalid @apply Usage - Validates if a class can be used with @apply
  • Invalid @screen References - Detects references to non-existent breakpoints
  • Invalid Config Paths - Validates references in config() and theme() functions
  • Invalid @tailwind Directives - Validates @tailwind layer values
  • Recommended Variant Order - Suggests preferred ordering of variants
  • Blocklisted Classes - Detects usage of blocklisted classes
  • Autofix - Automatically fix issues with --fix flag
  • Quoted class string extraction - Lints class-like strings in common helper patterns, not only direct class and className attributes

v4-Specific:

  • Canonical Class Suggestions - Suggests shorthand equivalents for arbitrary values (e.g., top-[60px] → top-15)
  • Invalid @source Directives - Validates @source directive paths
  • Full theme loading - Automatically loads Tailwind's default theme

Development

# Install dependencies
pnpm install

# Build for production
pnpm build

# Development mode (watch)
pnpm dev

# Run tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run tests with coverage
pnpm test:coverage

# Format and lint code
pnpm format

# Check code without fixing
pnpm lint

# Preview next version locally (no publish)
pnpm release:dry

Releases

Releases are automated with Semantic Release on pushes to main.

  • Version bump is derived from Conventional Commits.
  • npm release and GitHub release are generated automatically.
  • npm publish uses npm Trusted Publishing (OIDC), no NPM_TOKEN required.

Commit examples:

  • feat: add json output mode -> minor release
  • fix: resolve v4 config discovery in monorepos -> patch release
  • feat: drop Node 20 support + commit body BREAKING CHANGE: Node 20 is no longer supported -> major release
  • perf: speed up config discovery -> patch release
  • docs: update readme -> no release

pnpm release:dry runs against the local repo metadata (--repository-url .) so it does not require GitHub remote access.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm tailwind-lint

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229