npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-tailwind-rtl

v1.2.1

Published

ESLint plugin for RTL-safe Tailwind CSS — catches physical direction classes and suggests logical alternatives

Downloads

940

Readme

ESlint Tailwind RTL plugin

ESLint plugin for RTL-safe CSS. Catches physical direction properties in Tailwind classes and CSS-in-JS objects, suggesting logical alternatives.

| Before | After | | -------------------------------------- | ----------------------------------------------------- | | Broken layout | Fixed layout using the plugin |

Demo of auto fixing violations

Install

You can install the companion SKILL for your AI coding agent.

npm install --save-dev eslint eslint-plugin-tailwind-rtl

Usage

Quick start (recommended config)

The recommended config registers the plugin and enables all rules at "warn" severity.

// eslint.config.js
import tailwindRtl from "eslint-plugin-tailwind-rtl";

export default [
  // ... other configs ...
  tailwindRtl.configs.recommended,
];

This enables both tailwind/no-physical-classes and css-in-js/no-physical-properties as warnings.

Tailwind-only projects

If you don't use CSS-in-JS:

export default [tailwindRtl.configs["recommended-tailwind"]];

Strict mode (warn → error)

To fail the build instead of warning:

export default [
  tailwindRtl.configs.recommended,
  {
    rules: {
      "tailwind-rtl/tailwind/no-physical-classes": "error",
    },
  },
];

Use Cases

  • Design systems / shared component libraries -- Build once, consume in both RTL and LTR projects without direction bugs. The plugin catches physical properties at the component source, so downstream consumers don't have to patch broken margins and padding.
  • OSS UI components -- Ship components that work out of the box for Arabic, Hebrew, Persian, and Urdu users. Avoid the "works in my project" problem when your users have different dir setups.
  • Multi-language apps -- When your app supports both RTL and LTR locales, the plugin prevents direction-specific classes from leaking into shared components.
  • Code review automation -- Catch RTL regressions before they hit production. ESLint runs in CI and editor extensions, so violations surface immediately.

Rules

tailwind/no-physical-classes

Disallows physical direction Tailwind classes in favor of logical properties. Severity: Warning by default. Auto-fixable.

// ❌ Incorrect
<div className="ml-4 mr-2 pl-3 pr-1 text-left" />

// ✅ Correct
<div className="ms-4 me-2 ps-3 pe-1 text-start" />

Supported categories:

| Category | Physical | Logical | | ------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | Margin | ml-*, mr-* | ms-*, me-* | | Padding | pl-*, pr-* | ps-*, pe-* | | Position | left-*, right-* | start-*, end-* | | Text align | text-left, text-right | text-start, text-end | | Border | border-l, border-r | border-s, border-e | | Border radius | rounded-l, rounded-r, rounded-tl, rounded-tr, rounded-bl, rounded-br | rounded-s, rounded-e, rounded-ts, rounded-te, rounded-bs, rounded-be |

css-in-js/no-physical-properties

Disallows physical direction CSS-in-JS properties in favor of logical properties. Severity: Warning by default. Auto-fixable.

// ❌ Incorrect
const styles = { marginLeft: "1rem", paddingRight: "2rem" };

// ✅ Correct
const styles = { marginInlineStart: "1rem", paddingInlineEnd: "2rem" };

Supported properties:

| Category | Physical | Logical | | ------------ | ------------------------------------------------ | ---------------------------------------------------------------- | | Margin | marginLeft, marginRight | marginInlineStart, marginInlineEnd | | Padding | paddingLeft, paddingRight | paddingInlineStart, paddingInlineEnd | | Border | borderLeft, borderRight | borderInlineStart, borderInlineEnd | | Border color | borderLeftColor, borderRightColor | borderInlineStartColor, borderInlineEndColor | | Border width | borderLeftWidth, borderRightWidth | borderInlineStartWidth, borderInlineEndWidth | | Border style | borderLeftStyle, borderRightStyle | borderInlineStartStyle, borderInlineEndStyle | | Position | left, right | insetInlineStart, insetInlineEnd | | Size | width, height | inlineSize, blockSize | | Min/max size | minWidth, maxWidth, minHeight, maxHeight | minInlineSize, maxInlineSize, minBlockSize, maxBlockSize |

css-in-js/no-physical-values

Disallows physical direction values ("left", "right") in CSS-in-JS properties that accept directional keywords. Severity: Warning by default. Auto-fixable.

// ❌ Incorrect
const styles = { textAlign: "left", float: "right", clear: "left" };

// ✅ Correct
const styles = {
  textAlign: "start",
  float: "inline-end",
  clear: "inline-start",
};

Supported properties and values:

| Property | Physical Value | Logical Value | | ----------- | -------------- | ---------------- | | textAlign | "left" | "start" | | textAlign | "right" | "end" | | float | "left" | "inline-start" | | float | "right" | "inline-end" | | clear | "left" | "inline-start" | | clear | "right" | "inline-end" |

Configs

| Config | Rules enabled | | ---------------------- | -------------------------------------------------- | | recommended | Tailwind + CSS-in-JS properties + CSS-in-JS values | | recommended-tailwind | Tailwind only |

AI Agent Skill

For the full RTL development picture -- Arabic typography, bidirectional text handling, component patterns, dir attribute, flexbox auto-flip, icon handling, and more -- install the RTL Web Development skill to catch issue before it's written:

npx skills add AmmarCodes/rtl-web-development-skill

Defense in Depth

| Tool | When it helps | What it does | | ---------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------- | | RTL Web Development Skill (companion) | Code generation | Full RTL guidance: bidi text, Arabic typography, component patterns | | ESLint Plugin (this package) | Code review / CI | Catches RTL regressions in existing code |

Contributing

# Run tests
npm test

# Run linter
npm run lint

Tests use Node.js built-in test runner (no extra test framework required).

License

MIT