maharshi365/oxlint-plugin-tailwind-canonical

Oxlint plugin enforcing canonical Tailwind CSS class spellings

1

stars

2

commits

JavaScript

primary language

Sep 11, 2026

updated

README

oxlint-plugin-tailwind-canonical

Enforces canonical Tailwind CSS class spellings with --fix support. Same suggestions as the Tailwind language server, applied repo-wide via oxlint --fix.

BeforeAfter
mt-[16px]mt-4
[color:red]/50text-[red]/50
[@media_print]:flexprint:flex

Only rewrites the spelling of individual classes. Does not reorder, dedupe, or collapse utilities (use oxfmt sortTailwindcss for that).

Install

npm install --save-dev oxlint oxlint-plugin-tailwind-canonical tailwindcss

Requires Tailwind CSS v4 and Node 22+.

Usage

In oxlint.config.ts:

import { defineConfig } from 'oxlint';

export default defineConfig({
  jsPlugins: [
    {
      name: 'tailwind-canonical',
      specifier: 'oxlint-plugin-tailwind-canonical',
    },
  ],
  rules: {
    'tailwind-canonical/canonical-class-names': [
      'warn',
      { cssPath: './src/styles.css' },
    ],
  },
});

Then run oxlint --fix.

Options:

  • cssPath (required) — Tailwind v4 entry CSS, absolute or relative to cwd.
  • rootFontSize — px value for rem normalization. Default 16.
  • attributes — JSX attributes treated as class lists. Default ["class", "className"].
  • calleeFunctions — helpers whose string args are treated as class lists. Default ["cn", "clsx", "cva", "twMerge", "tw", "classNames", "cx"].

Strings with ${} interpolations are skipped.

License

MIT

Contributors

maharshi365

2 commits

maharshi365/oxlint-plugin-tailwind-canonical

Oxlint plugin enforcing canonical Tailwind CSS class spellings

1

stars

2

commits

JavaScript

primary language

Sep 11, 2026

updated

README

oxlint-plugin-tailwind-canonical

Enforces canonical Tailwind CSS class spellings with --fix support. Same suggestions as the Tailwind language server, applied repo-wide via oxlint --fix.

BeforeAfter
mt-[16px]mt-4
[color:red]/50text-[red]/50
[@media_print]:flexprint:flex

Only rewrites the spelling of individual classes. Does not reorder, dedupe, or collapse utilities (use oxfmt sortTailwindcss for that).

Install

npm install --save-dev oxlint oxlint-plugin-tailwind-canonical tailwindcss

Requires Tailwind CSS v4 and Node 22+.

Usage

In oxlint.config.ts:

import { defineConfig } from 'oxlint';

export default defineConfig({
  jsPlugins: [
    {
      name: 'tailwind-canonical',
      specifier: 'oxlint-plugin-tailwind-canonical',
    },
  ],
  rules: {
    'tailwind-canonical/canonical-class-names': [
      'warn',
      { cssPath: './src/styles.css' },
    ],
  },
});

Then run oxlint --fix.

Options:

  • cssPath (required) — Tailwind v4 entry CSS, absolute or relative to cwd.
  • rootFontSize — px value for rem normalization. Default 16.
  • attributes — JSX attributes treated as class lists. Default ["class", "className"].
  • calleeFunctions — helpers whose string args are treated as class lists. Default ["cn", "clsx", "cva", "twMerge", "tw", "classNames", "cx"].

Strings with ${} interpolations are skipped.

License

MIT

Contributors

maharshi365

2 commits

Languages

JavaScript

100.0%