oxlint-tailwindcss 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/index.cjs +433 -256
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +435 -260
- package/package.json +7 -7
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/utils/extractors.ts","../src/utils/class-splitter.ts","../src/rules/no-duplicate-classes.ts","../src/rules/no-unnecessary-whitespace.ts","../src/utils/levenshtein.ts","../src/utils/class-parser.ts","../src/utils/floating-point.ts","../src/design-system/cache.ts","../src/utils/fatal.ts","../src/design-system/tailwind-node.ts","../src/design-system/sync-loader.ts","../src/design-system/debug.ts","../src/utils/context.ts","../src/design-system/loader.ts","../src/utils/report.ts","../src/rules/no-deprecated-classes.ts","../src/rules/no-unknown-classes.ts","../src/rules/no-conflicting-classes/spec.ts","../src/rules/no-conflicting-classes.ts","../src/design-system/ds-worker.ts","../src/design-system/canonicalize-service.ts","../src/rules/enforce-canonical.ts","../src/design-system/sort-service.ts","../src/rules/enforce-sort-order.ts","../src/rules/enforce-shorthand.ts","../src/utils/allowlist.ts","../src/rules/enforce-logical.ts","../src/rules/enforce-physical.ts","../src/rules/max-class-count.ts","../src/rules/no-restricted-classes.ts","../src/rules/no-arbitrary-value.ts","../src/rules/enforce-consistent-important-position.ts","../src/rules/enforce-negative-arbitrary-values.ts","../src/rules/enforce-consistent-variable-syntax.ts","../src/rules/no-dark-without-light.ts","../src/rules/no-hardcoded-colors.ts","../src/rules/no-contradicting-variants.ts","../src/rules/consistent-variant-order.ts","../src/rules/enforce-consistent-line-wrapping.ts","../src/rules/no-unnecessary-arbitrary-value.ts","../src/rules/prefer-theme-tokens.ts","../src/index.ts"],"sourcesContent":["import type { ESTree } from '@oxlint/plugins'\nimport type { PluginSettings } from '../types'\n\nexport interface ClassLocation {\n value: string\n node: ESTree.Node\n range: [number, number]\n /** Preserve a leading space (quasi preceded by template expression) */\n preserveLeadingSpace?: boolean\n /** Preserve a trailing space (quasi followed by template expression) */\n preserveTrailingSpace?: boolean\n}\n\n/**\n * Preserves leading/trailing spaces in fixed class strings for template literals.\n * Without this, `h-3 w-3 ${x}` fixed to `size-3${x}` would break classes.\n */\nexport function preserveSpaces(loc: ClassLocation, fixed: string): string {\n if (loc.preserveLeadingSpace && !fixed.startsWith(' ')) fixed = ` ${fixed}`\n if (loc.preserveTrailingSpace && !fixed.endsWith(' ')) fixed = `${fixed} `\n return fixed\n}\n\nexport interface ExtractorConfig {\n attributes: string[]\n callees: string[]\n tags: string[]\n variablePatterns: RegExp[]\n}\n\nconst DEFAULT_VARIABLE_PATTERNS = [/^classNames?$/, /^classes$/, /^styles?$/]\n\nexport const DEFAULT_EXTRACTOR_CONFIG: ExtractorConfig = {\n attributes: ['className', 'class'],\n callees: [\n 'cn',\n 'clsx',\n 'cva',\n 'twMerge',\n 'tv',\n 'cx',\n 'classnames',\n 'ctl',\n 'twJoin',\n 'cc',\n 'clb',\n 'cnb',\n 'objstr',\n 'classed',\n ],\n tags: ['tw'],\n variablePatterns: DEFAULT_VARIABLE_PATTERNS,\n}\n\n// --- Custom config resolution via settings.tailwindcss ---\n\n/**\n * v1: per-context extractor config cache. Each oxlint rule context gets its\n * own cached config, keyed by reference identity in a WeakMap. This prevents\n * the cross-contamination bug where two test suites (or parallel rule\n * contexts) would race on a module-level global and the first one to read\n * settings would freeze the config for everyone else.\n *\n * WeakMap also lets us drop entries automatically when a context goes out of\n * scope — no manual cache eviction needed.\n */\ntype ContextKey = object\nconst configCache = new WeakMap<ContextKey, ExtractorConfig>()\n\nfunction mergeUnique(defaults: string[], extras?: string[], exclusions?: string[]): string[] {\n let base = defaults\n if (exclusions && exclusions.length > 0) {\n const excludeSet = new Set(exclusions)\n base = base.filter((d) => !excludeSet.has(d))\n }\n if (!extras || extras.length === 0) return base\n const set = new Set(base)\n for (const e of extras) set.add(e)\n return [...set]\n}\n\n/**\n * Returns the extractor config for this rule context, merging defaults with\n * user settings from `settings.tailwindcss`. The result is cached per\n * context (WeakMap-keyed) so settings are read once per rule lifetime.\n *\n * In `createOnce` the settings getter throws — we fall back to the defaults\n * without caching so the next visitor call (where settings ARE available)\n * still resolves the user's overrides.\n */\nexport function getExtractorConfig(context: {\n settings?: Readonly<Record<string, unknown>>\n}): ExtractorConfig {\n const cached = configCache.get(context as ContextKey)\n if (cached) return cached\n\n let tw: PluginSettings | undefined\n try {\n const raw = context.settings?.tailwindcss\n if (raw && typeof raw === 'object') {\n tw = raw as PluginSettings\n }\n } catch {\n // createOnce — settings not available yet. Return defaults without\n // caching so a later call from a visitor still gets a chance to read\n // the real settings.\n return DEFAULT_EXTRACTOR_CONFIG\n }\n\n if (!tw) {\n configCache.set(context as ContextKey, DEFAULT_EXTRACTOR_CONFIG)\n return DEFAULT_EXTRACTOR_CONFIG\n }\n\n const exclude = tw.exclude\n\n // Variable patterns: exclude by regex source, then add new patterns\n const excludedPatternSources = new Set(exclude?.variablePatterns ?? [])\n const filteredPatterns =\n excludedPatternSources.size > 0\n ? DEFAULT_EXTRACTOR_CONFIG.variablePatterns.filter(\n (re) => !excludedPatternSources.has(re.source),\n )\n : DEFAULT_EXTRACTOR_CONFIG.variablePatterns\n\n const resolved: ExtractorConfig = {\n attributes: mergeUnique(\n DEFAULT_EXTRACTOR_CONFIG.attributes,\n tw.attributes,\n exclude?.attributes,\n ),\n callees: mergeUnique(DEFAULT_EXTRACTOR_CONFIG.callees, tw.callees, exclude?.callees),\n tags: mergeUnique(DEFAULT_EXTRACTOR_CONFIG.tags, tw.tags, exclude?.tags),\n variablePatterns: [\n ...filteredPatterns,\n ...(tw.variablePatterns ?? []).map((p) => new RegExp(p)),\n ],\n }\n configCache.set(context as ContextKey, resolved)\n return resolved\n}\n\n/**\n * Reset cached config for a specific context, or globally for tests that\n * don't track contexts.\n *\n * Kept for backward compat with existing tests that call it from `beforeEach`.\n * With WeakMap-keyed caching, fresh contexts get fresh caches automatically;\n * this helper now only needs to drop a specific entry when callers pass one.\n */\nexport function resetExtractorConfig(context?: { settings?: unknown }): void {\n if (context) {\n configCache.delete(context as ContextKey)\n }\n // No-op when called without a context: the WeakMap already handles\n // lifecycle. Module-level global state was removed in v1.\n}\n\n/**\n * Creates the 4 standard AST visitor callbacks that all rules use.\n * Resolves extractor config lazily from context.settings on first visitor call.\n */\nexport function createExtractorVisitors(\n context: { settings?: Readonly<Record<string, unknown>> },\n check: (locations: ClassLocation[]) => void,\n): {\n JSXAttribute: (node: ESTree.JSXAttribute) => void\n CallExpression: (node: ESTree.CallExpression) => void\n TaggedTemplateExpression: (node: ESTree.TaggedTemplateExpression) => void\n VariableDeclarator: (node: ESTree.VariableDeclarator) => void\n} {\n return {\n JSXAttribute(node) {\n check(extractFromJSXAttribute(node, getExtractorConfig(context)))\n },\n CallExpression(node) {\n check(extractFromCallExpression(node, getExtractorConfig(context)))\n },\n TaggedTemplateExpression(node) {\n check(extractFromTaggedTemplate(node, getExtractorConfig(context)))\n },\n VariableDeclarator(node) {\n check(extractFromVariableDeclarator(node, getExtractorConfig(context)))\n },\n }\n}\n\n/**\n * Extracts class locations from a JSXAttribute node.\n * Handles: className=\"...\", className={`...`}, className={cond ? \"...\" : \"...\"}\n */\nexport function extractFromJSXAttribute(\n node: ESTree.JSXAttribute,\n config: ExtractorConfig = DEFAULT_EXTRACTOR_CONFIG,\n): ClassLocation[] {\n const name = node.name.type === 'JSXIdentifier' ? node.name.name : undefined\n if (!name || !config.attributes.includes(name)) return []\n\n if (!node.value) return []\n\n // className=\"literal string\"\n if (node.value.type === 'Literal' && typeof node.value.value === 'string') {\n return [\n {\n value: node.value.value,\n node: node.value,\n range: [node.value.range[0] + 1, node.value.range[1] - 1],\n },\n ]\n }\n\n // className={expression} or classNames={{ root: \"flex\" }}\n if (node.value.type === 'JSXExpressionContainer') {\n const expr = node.value.expression\n // classNames={{ root: \"flex flex-col\", label: \"text-sm\" }} — extract string values\n if (expr.type === 'ObjectExpression') {\n return extractObjectValues(expr as ESTree.ObjectExpression)\n }\n return extractFromExpression(expr)\n }\n\n return []\n}\n\n/**\n * Extracts class locations from a CallExpression (cn, clsx, cva, tv, etc).\n * For cva() and tv(), uses dedicated extractors that understand their config structure.\n */\nexport function extractFromCallExpression(\n node: ESTree.CallExpression,\n config: ExtractorConfig = DEFAULT_EXTRACTOR_CONFIG,\n): ClassLocation[] {\n const calleeName = getCalleeName(node.callee)\n if (!calleeName || !config.callees.includes(calleeName)) return []\n\n if (calleeName === 'cva') return extractFromCvaCall(node)\n if (calleeName === 'tv') return extractFromTvCall(node)\n if (calleeName === 'classed') return extractFromClassedCall(node)\n\n const results: ClassLocation[] = []\n for (const arg of node.arguments) {\n extractFromExpression(arg, results)\n }\n return results\n}\n\n/**\n * Extracts class locations from a TaggedTemplateExpression (tw`...`).\n */\nexport function extractFromTaggedTemplate(\n node: ESTree.TaggedTemplateExpression,\n config: ExtractorConfig = DEFAULT_EXTRACTOR_CONFIG,\n): ClassLocation[] {\n const tagName = getCalleeName(node.tag)\n if (!tagName || !config.tags.includes(tagName)) return []\n\n return extractFromTemplateLiteral(node.quasi)\n}\n\n/**\n * Extracts class string values from an ObjectExpression in a JSX attribute.\n * For: classNames={{ root: \"flex flex-col\", label: \"text-sm\" }}\n * Recurses into each property value via extractFromExpression.\n */\nfunction extractObjectValues(node: ESTree.ObjectExpression): ClassLocation[] {\n const results: ClassLocation[] = []\n for (const prop of node.properties) {\n if (prop.type === 'Property') {\n extractFromExpression(prop.value, results)\n }\n }\n return results\n}\n\n/**\n * Extracts class locations from a classed() call (tw-classed).\n * First string argument is the element type (skipped), rest are class strings\n * or cva-like config objects.\n * classed(\"button\", \"flex items-center\", { variants: { ... } })\n */\nfunction extractFromClassedCall(node: ESTree.CallExpression): ClassLocation[] {\n const results: ClassLocation[] = []\n let skippedFirst = false\n\n for (const arg of node.arguments) {\n // Skip the first string argument (element type like \"button\", \"div\")\n if (!skippedFirst && arg.type === 'Literal' && typeof arg.value === 'string') {\n skippedFirst = true\n continue\n }\n // If first arg is a component reference (Identifier), also skip it\n if (!skippedFirst && arg.type === 'Identifier') {\n skippedFirst = true\n continue\n }\n // If first arg is a template literal (e.g. classed(`div`, ...)), also skip it\n if (!skippedFirst && arg.type === 'TemplateLiteral') {\n skippedFirst = true\n continue\n }\n skippedFirst = true\n\n if (arg.type === 'ObjectExpression') {\n results.push(...extractFromCvaConfig(arg as ESTree.ObjectExpression))\n } else {\n extractFromExpression(arg, results)\n }\n }\n return results\n}\n\n/**\n * Extracts class locations from a cva() call.\n * Handles: base string, variants config, compoundVariants.\n */\nfunction extractFromCvaCall(node: ESTree.CallExpression): ClassLocation[] {\n const results: ClassLocation[] = []\n for (const arg of node.arguments) {\n if (arg.type === 'ObjectExpression') {\n results.push(...extractFromCvaConfig(arg as ESTree.ObjectExpression))\n } else {\n extractFromExpression(arg, results)\n }\n }\n return results\n}\n\n/**\n * Extracts class locations from a cva config object.\n * Properties: variants (nested category→value objects), compoundVariants (array with class/className).\n * Ignores: defaultVariants.\n */\nfunction extractFromCvaConfig(node: ESTree.ObjectExpression): ClassLocation[] {\n const results: ClassLocation[] = []\n for (const prop of node.properties) {\n if (prop.type !== 'Property') continue\n const name = getPropertyName(prop.key)\n\n if (name === 'variants' && prop.value.type === 'ObjectExpression') {\n // variants: { size: { sm: \"p-2\", lg: \"p-4\" } }\n for (const category of (prop.value as ESTree.ObjectExpression).properties) {\n if (category.type !== 'Property' || category.value.type !== 'ObjectExpression') continue\n for (const variant of (category.value as ESTree.ObjectExpression).properties) {\n if (variant.type === 'Property') {\n extractFromExpression(variant.value, results)\n }\n }\n }\n } else if (name === 'compoundVariants' && prop.value.type === 'ArrayExpression') {\n // compoundVariants: [{ size: \"sm\", class: \"p-2\" }]\n results.push(...extractClassFromCompoundEntries(prop.value as ESTree.ArrayExpression))\n } else if (name === 'defaultVariants') {\n // Ignore — these are variant names, not class strings\n } else {\n // Other properties (e.g. unknown) — try extracting\n extractFromExpression(prop.value, results)\n }\n }\n return results\n}\n\n/**\n * Extracts class locations from a tv() call.\n * Handles: base, slots, variants (with slot objects), compoundVariants, compoundSlots.\n */\nfunction extractFromTvCall(node: ESTree.CallExpression): ClassLocation[] {\n const results: ClassLocation[] = []\n for (const arg of node.arguments) {\n if (arg.type === 'ObjectExpression') {\n results.push(...extractFromTvConfig(arg as ESTree.ObjectExpression))\n } else {\n extractFromExpression(arg, results)\n }\n }\n return results\n}\n\n/**\n * Extracts class locations from a tv config object.\n * Properties: base, slots, variants (may have slot sub-objects), compoundVariants, compoundSlots.\n * Ignores: defaultVariants.\n */\nfunction extractFromTvConfig(node: ESTree.ObjectExpression): ClassLocation[] {\n const results: ClassLocation[] = []\n for (const prop of node.properties) {\n if (prop.type !== 'Property') continue\n const name = getPropertyName(prop.key)\n\n if (name === 'base') {\n extractFromExpression(prop.value, results)\n } else if (name === 'slots' && prop.value.type === 'ObjectExpression') {\n // slots: { header: \"p-2\", body: \"p-4\" }\n for (const slot of (prop.value as ESTree.ObjectExpression).properties) {\n if (slot.type === 'Property') {\n extractFromExpression(slot.value, results)\n }\n }\n } else if (name === 'variants' && prop.value.type === 'ObjectExpression') {\n // variants: { size: { sm: \"p-2\" } } OR { size: { sm: { header: \"p-2\" } } }\n for (const category of (prop.value as ESTree.ObjectExpression).properties) {\n if (category.type !== 'Property' || category.value.type !== 'ObjectExpression') continue\n for (const variant of (category.value as ESTree.ObjectExpression).properties) {\n if (variant.type !== 'Property') continue\n if (variant.value.type === 'ObjectExpression') {\n // Slot-level: { header: \"p-2\", body: \"p-4\" }\n for (const slotProp of (variant.value as ESTree.ObjectExpression).properties) {\n if (slotProp.type === 'Property') {\n extractFromExpression(slotProp.value, results)\n }\n }\n } else {\n extractFromExpression(variant.value, results)\n }\n }\n }\n } else if (\n (name === 'compoundVariants' || name === 'compoundSlots') &&\n prop.value.type === 'ArrayExpression'\n ) {\n results.push(...extractClassFromCompoundEntries(prop.value as ESTree.ArrayExpression))\n } else if (name === 'defaultVariants') {\n // Ignore\n } else {\n extractFromExpression(prop.value, results)\n }\n }\n return results\n}\n\n/**\n * Extracts class/className values from an array of compound variant/slot entries.\n * Each entry is an ObjectExpression; we look for \"class\" or \"className\" properties.\n */\nfunction extractClassFromCompoundEntries(node: ESTree.ArrayExpression): ClassLocation[] {\n const results: ClassLocation[] = []\n for (const element of node.elements) {\n if (!element || element.type !== 'ObjectExpression') continue\n for (const prop of (element as ESTree.ObjectExpression).properties) {\n if (prop.type !== 'Property') continue\n const name = getPropertyName(prop.key)\n if (name === 'class' || name === 'className') {\n extractFromExpression(prop.value, results)\n }\n }\n }\n return results\n}\n\n/**\n * Gets the property name from an object key node.\n */\nfunction getPropertyName(key: ESTree.Node): string | undefined {\n if (key.type === 'Identifier') return (key as ESTree.IdentifierName).name\n if (key.type === 'Literal' && typeof (key as ESTree.StringLiteral).value === 'string')\n return (key as ESTree.StringLiteral).value as string\n return undefined\n}\n\n/**\n * Extracts class locations from a VariableDeclarator whose name matches variablePatterns.\n * e.g. const className = \"flex items-center\"\n */\nexport function extractFromVariableDeclarator(\n node: ESTree.VariableDeclarator,\n config: ExtractorConfig = DEFAULT_EXTRACTOR_CONFIG,\n): ClassLocation[] {\n if (node.id.type !== 'Identifier') return []\n if (!config.variablePatterns.some((p) => p.test((node.id as ESTree.BindingIdentifier).name)))\n return []\n if (!node.init) return []\n return extractFromExpression(node.init)\n}\n\n/**\n * Walk an expression and append every class-bearing location to `out`.\n *\n * Internal helpers pass their accumulator down to avoid the\n * `extractFromExpression(x, results)` pattern, which allocates an\n * intermediate array per recursive call. Public callers may omit `out` to\n * receive a fresh array.\n */\nfunction extractFromExpression(node: ESTree.Node, out: ClassLocation[] = []): ClassLocation[] {\n if (node.type === 'Literal' && typeof node.value === 'string') {\n out.push({\n value: node.value,\n node,\n range: [node.range[0] + 1, node.range[1] - 1],\n })\n return out\n }\n\n if (node.type === 'TemplateLiteral') {\n return appendFromTemplateLiteral(node as ESTree.TemplateLiteral, out)\n }\n\n if (node.type === 'ConditionalExpression') {\n extractFromExpression((node as ESTree.ConditionalExpression).consequent, out)\n extractFromExpression((node as ESTree.ConditionalExpression).alternate, out)\n return out\n }\n\n if (node.type === 'LogicalExpression') {\n return extractFromExpression((node as ESTree.LogicalExpression).right, out)\n }\n\n // Arrays: cn(['flex', 'p-2']) and the idiomatic tv()/cva() multi-line form\n // `base: ['flex', cond && 'p-2']`. Recurse into each element so strings,\n // ternaries, and nested arrays are all reached. SpreadElement and holes\n // (`[, x]`) have nothing statically extractable, so they're skipped.\n if (node.type === 'ArrayExpression') {\n for (const element of (node as ESTree.ArrayExpression).elements) {\n if (element && element.type !== 'SpreadElement') {\n extractFromExpression(element, out)\n }\n }\n return out\n }\n\n // Objects: cn({ \"bg-red-500\": isError }) — extract the keys\n if (node.type === 'ObjectExpression') {\n for (const prop of (node as ESTree.ObjectExpression).properties) {\n if (\n prop.type === 'Property' &&\n prop.key.type === 'Literal' &&\n typeof prop.key.value === 'string'\n ) {\n out.push({\n value: prop.key.value,\n node: prop.key,\n range: [prop.key.range[0] + 1, prop.key.range[1] - 1],\n })\n }\n }\n return out\n }\n\n return out\n}\n\nfunction appendFromTemplateLiteral(\n node: ESTree.TemplateLiteral,\n out: ClassLocation[],\n): ClassLocation[] {\n for (let i = 0; i < node.quasis.length; i++) {\n const quasi = node.quasis[i]\n const value = quasi.value.raw\n if (value.trim().length > 0) {\n // +1 skips the opening delimiter (` or })\n // Use value length to compute end — avoids issues with non-tail quasis\n // whose range includes the closing `${` (2 chars, not 1)\n const start = quasi.range[0] + 1\n out.push({\n value,\n node: quasi,\n range: [start, start + value.length],\n preserveLeadingSpace: i > 0,\n preserveTrailingSpace: i < node.quasis.length - 1,\n })\n }\n }\n return out\n}\n\nfunction extractFromTemplateLiteral(node: ESTree.TemplateLiteral): ClassLocation[] {\n return appendFromTemplateLiteral(node, [])\n}\n\nfunction getCalleeName(node: ESTree.Node): string | undefined {\n if (node.type === 'Identifier') return (node as ESTree.IdentifierReference).name\n if (node.type === 'MemberExpression') {\n const prop = (node as ESTree.StaticMemberExpression).property\n if (prop.type === 'Identifier') return prop.name\n }\n return undefined\n}\n","/**\n * Splits a Tailwind class string respecting:\n * - Nested brackets: bg-[url('...')], h-[calc(100%+2rem)]\n * - Arbitrary variants: [&>svg]:w-4\n * - Negative values: -translate-x-1\n * - Important modifier: !font-bold\n */\nexport function splitClasses(classString: string): string[] {\n const classes: string[] = []\n let current = ''\n let bracketDepth = 0\n let inSingleQuote = false\n let inDoubleQuote = false\n\n for (let i = 0; i < classString.length; i++) {\n const char = classString[i]\n const prev = classString[i - 1]\n\n if (bracketDepth > 0 && prev !== '\\\\') {\n if (char === \"'\" && !inDoubleQuote) inSingleQuote = !inSingleQuote\n if (char === '\"' && !inSingleQuote) inDoubleQuote = !inDoubleQuote\n }\n\n if (!inSingleQuote && !inDoubleQuote) {\n if (char === '[') bracketDepth++\n if (char === ']') bracketDepth--\n }\n\n if (/\\s/.test(char) && bracketDepth === 0) {\n if (current.length > 0) {\n classes.push(current)\n current = ''\n }\n } else {\n current += char\n }\n }\n\n if (current.length > 0) {\n classes.push(current)\n }\n\n return classes\n}\n\n/**\n * Split a class string into classes AND the whitespace separators between them.\n *\n * `separators[0]` is the leading whitespace (before the first class).\n * `separators[i]` for i >= 1 is the whitespace between classes[i-1] and classes[i].\n * `separators[classes.length]` is the trailing whitespace.\n * Total length: `classes.length + 1`.\n *\n * Used together with `rebuildClassString` to preserve multiline formatting\n * (e.g. `\\n` + indent introduced by `enforce-consistent-line-wrapping`'s\n * `classesPerLine`) when other rules autofix the same string.\n */\nexport interface ClassSplit {\n classes: string[]\n separators: string[]\n}\n\nexport function splitClassesWithSeparators(classString: string): ClassSplit {\n const classes: string[] = []\n const separators: string[] = []\n let current = ''\n let currentSep = ''\n let bracketDepth = 0\n let inSingleQuote = false\n let inDoubleQuote = false\n\n for (let i = 0; i < classString.length; i++) {\n const char = classString[i]\n const prev = classString[i - 1]\n\n if (bracketDepth > 0 && prev !== '\\\\') {\n if (char === \"'\" && !inDoubleQuote) inSingleQuote = !inSingleQuote\n if (char === '\"' && !inSingleQuote) inDoubleQuote = !inDoubleQuote\n }\n\n if (!inSingleQuote && !inDoubleQuote) {\n if (char === '[') bracketDepth++\n if (char === ']') bracketDepth--\n }\n\n if (/\\s/.test(char) && bracketDepth === 0) {\n if (current.length > 0) {\n classes.push(current)\n separators.push(currentSep)\n current = ''\n currentSep = ''\n }\n currentSep += char\n } else {\n current += char\n }\n }\n\n if (current.length > 0) {\n classes.push(current)\n separators.push(currentSep)\n currentSep = ''\n }\n // Trailing separator (always present, may be empty)\n separators.push(currentSep)\n\n return { classes, separators }\n}\n\n/**\n * Reconstruct a class string from a `ClassSplit` and a (possibly transformed)\n * array of classes.\n *\n * - If `newClasses.length === split.classes.length` (1-to-1 transformation:\n * canonicalize, sort, variant-order, etc.) every separator is preserved\n * verbatim. This keeps multiline indentation intact.\n * - If lengths differ (shorthand collapses pairs, no-duplicate removes dupes)\n * the helper degrades gracefully: leading and trailing whitespace are\n * preserved; classes are joined by the first internal separator that\n * contains a newline, or a single space if none does.\n */\nexport function rebuildClassString(split: ClassSplit, newClasses: string[]): string {\n const { classes, separators } = split\n if (newClasses.length === classes.length) {\n let result = separators[0]\n for (let i = 0; i < newClasses.length; i++) {\n result += newClasses[i] + separators[i + 1]\n }\n return result\n }\n const internal = separators.slice(1, -1)\n const join = internal.find((s) => s.includes('\\n')) ?? ' '\n return separators[0] + newClasses.join(join) + separators[separators.length - 1]\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\n\nexport const noDuplicateClasses = defineRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow duplicate Tailwind CSS classes',\n },\n fixable: 'code',\n schema: [],\n messages: {\n duplicate: 'Duplicate class: \"{{className}}\". Removing the second occurrence.',\n },\n },\n createOnce(context) {\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const classes = split.classes\n const seen = new Set<string>()\n const duplicates: string[] = []\n\n for (const cls of classes) {\n if (seen.has(cls)) {\n duplicates.push(cls)\n } else {\n seen.add(cls)\n }\n }\n\n if (duplicates.length > 0) {\n const unique = [...new Set(classes)]\n const fixed = rebuildClassString(split, unique)\n\n for (const dup of duplicates) {\n context.report({\n node: loc.node,\n messageId: 'duplicate',\n data: { className: dup },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixed))\n },\n })\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\n\nexport const noUnnecessaryWhitespace = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow unnecessary whitespace in Tailwind CSS class strings',\n },\n fixable: 'code',\n schema: [],\n messages: {\n unnecessaryWhitespace: 'Unnecessary whitespace in Tailwind classes. Can be normalized.',\n },\n },\n createOnce(context) {\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n // Multiline-aware normalization:\n // - within each line, collapse runs of horizontal whitespace (spaces\n // and tabs) to a single space.\n // - preserve newlines and the indentation that immediately follows\n // each newline — that's intentional formatting (e.g. produced by\n // enforce-consistent-line-wrapping `classesPerLine`).\n //\n // Without preserving the post-newline indent, this rule and\n // `enforce-consistent-line-wrapping` form an unfixable cycle (see #14).\n const lines = loc.value.split('\\n')\n const normalizedLines = lines.map((line, i) => {\n if (i === 0) {\n return line.replace(/[ \\t]+/g, ' ')\n }\n // For non-first lines, peel off leading horizontal whitespace\n // (the indent) and normalize only the rest.\n const m = /^([ \\t]*)([\\s\\S]*)$/.exec(line)\n if (!m) return line.replace(/[ \\t]+/g, ' ')\n return m[1] + m[2].replace(/[ \\t]+/g, ' ')\n })\n let normalized = normalizedLines.join('\\n')\n\n // Trim edges, but preserve a single space at template expression boundaries.\n // Newlines at edges are preserved verbatim — intentional formatting.\n if (normalized.startsWith(' ') && !loc.preserveLeadingSpace) {\n normalized = normalized.slice(1)\n }\n if (normalized.endsWith(' ') && !loc.preserveTrailingSpace) {\n normalized = normalized.slice(0, -1)\n }\n\n if (normalized !== loc.value) {\n context.report({\n node: loc.node,\n messageId: 'unnecessaryWhitespace',\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, normalized)\n },\n })\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","/**\n * Calculates the Levenshtein distance between two strings.\n */\nexport function levenshtein(a: string, b: string): number {\n if (a.length === 0) return b.length\n if (b.length === 0) return a.length\n\n // Use a single row to optimize memory\n const row = Array.from({ length: b.length + 1 }, (_, i) => i)\n\n for (let i = 1; i <= a.length; i++) {\n let prev = i\n for (let j = 1; j <= b.length; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1\n const current = Math.min(\n row[j] + 1, // deletion\n prev + 1, // insertion\n row[j - 1] + cost, // substitution\n )\n row[j - 1] = prev\n prev = current\n }\n row[b.length] = prev\n }\n\n return row[b.length]\n}\n\n/**\n * Finds the best suggestion for a given string within a list of candidates.\n * Returns null if no suggestion is close enough.\n */\nexport function findBestSuggestion(\n input: string,\n candidates: string[],\n maxDistance = 3,\n): string | null {\n let best: string | null = null\n let bestDistance = maxDistance + 1\n\n for (const candidate of candidates) {\n // Optimization: if the length difference already exceeds maxDistance, skip\n if (Math.abs(input.length - candidate.length) > maxDistance) continue\n\n const dist = levenshtein(input, candidate)\n if (dist < bestDistance) {\n bestDistance = dist\n best = candidate\n }\n }\n\n return best\n}\n","/**\n * Parses a Tailwind class into its constituent parts:\n * variants, important modifier, negative prefix, utility name, and arbitrary value.\n *\n * Handles bracket-aware variant extraction (e.g., `[&>svg]:hover:w-4`).\n */\n\nexport interface ParsedClass {\n /** Individual variant segments, e.g. ['hover', 'sm'] */\n variants: string[]\n /** Full variant prefix including colons, e.g. 'hover:sm:' */\n variantPrefix: string\n /** Whether the class has an important modifier (! prefix or suffix) */\n important: boolean\n /** Position of important modifier, if present */\n importantPosition: 'prefix' | 'suffix' | null\n /** Whether the class has a negative prefix */\n negative: boolean\n /** The utility name without variants, important, or negative */\n utility: string\n /** The arbitrary value inside brackets, if present */\n arbitraryValue: string | null\n}\n\n/**\n * Extracts variants from a class string, respecting bracket depth.\n * e.g. \"[&>svg]:hover:w-4\" → [\"[&>svg]\", \"hover\"]\n * \"dark:hover:flex\" → [\"dark\", \"hover\"]\n * \"w-4\" → []\n */\nexport function extractVariants(cls: string): string[] {\n const variants: string[] = []\n let depth = 0\n let segmentStart = 0\n\n for (let i = 0; i < cls.length; i++) {\n if (cls[i] === '[') depth++\n else if (cls[i] === ']') depth--\n else if (cls[i] === ':' && depth === 0) {\n variants.push(cls.slice(segmentStart, i))\n segmentStart = i + 1\n }\n }\n\n // The last segment is the utility, not a variant\n if (variants.length === 0) return []\n return variants\n}\n\n/**\n * Extracts the utility part from a potentially variant-prefixed class.\n * Bracket-aware: respects arbitrary variants like [&>svg]:w-4.\n *\n * e.g. \"hover:bg-blue-500\" → \"bg-blue-500\"\n * \"dark:hover:flex\" → \"flex\"\n * \"[&>svg]:w-4\" → \"w-4\"\n * \"w-4\" → \"w-4\"\n */\nexport function extractUtility(cls: string): string {\n let depth = 0\n let lastColon = -1\n for (let i = 0; i < cls.length; i++) {\n if (cls[i] === '[') depth++\n else if (cls[i] === ']') depth--\n else if (cls[i] === ':' && depth === 0) lastColon = i\n }\n return lastColon >= 0 ? cls.slice(lastColon + 1) : cls\n}\n\n/**\n * Gets the variant prefix (everything before the utility).\n * e.g. \"hover:sm:flex\" → \"hover:sm:\"\n * \"flex\" → \"\"\n */\nexport function getVariantPrefix(cls: string): string {\n let depth = 0\n let lastColon = -1\n for (let i = 0; i < cls.length; i++) {\n if (cls[i] === '[') depth++\n else if (cls[i] === ']') depth--\n else if (cls[i] === ':' && depth === 0) lastColon = i\n }\n return lastColon >= 0 ? cls.slice(0, lastColon + 1) : ''\n}\n\n/**\n * Splits a class into variant prefix and utility in a single pass.\n * More efficient than calling extractUtility() + getVariantPrefix() separately.\n */\nexport function splitUtilityAndVariant(cls: string): { utility: string; variant: string } {\n let depth = 0\n let lastColon = -1\n for (let i = 0; i < cls.length; i++) {\n if (cls[i] === '[') depth++\n else if (cls[i] === ']') depth--\n else if (cls[i] === ':' && depth === 0) lastColon = i\n }\n return {\n utility: lastColon >= 0 ? cls.slice(lastColon + 1) : cls,\n variant: lastColon >= 0 ? cls.slice(0, lastColon + 1) : '',\n }\n}\n\n/**\n * Checks if a class has an arbitrary value (bracket syntax in the utility part).\n * Distinguishes from arbitrary variants: [&>svg]:w-4 does NOT have an arbitrary value,\n * but w-[200px] does.\n */\nexport function hasArbitraryValue(cls: string): boolean {\n const utility = extractUtility(cls)\n return utility.includes('[') && utility.includes(']')\n}\n\n/**\n * Checks if a class's utility part contains dynamic value syntax: either\n * arbitrary brackets (`w-[200px]`) or CSS variable shorthand (`bg-(--color)`).\n *\n * Unlike `hasArbitraryValue`, this also catches `(--var)` shorthand — both\n * forms are what require the async Tailwind DS to canonicalize, because\n * their value space is unbounded. Simple named classes (`flex`, `px-4`,\n * even with variants like `[&>svg]:hover:flex`) can be canonicalized from\n * the precomputed cache without touching the worker.\n */\nexport function utilityHasDynamicValue(cls: string): boolean {\n const utility = extractUtility(cls)\n return utility.includes('[') || utility.includes('(')\n}\n\n/**\n * Gets the arbitrary value from a class, or null if none.\n * e.g. \"w-[200px]\" → \"200px\"\n * \"bg-[#ff0000]\" → \"#ff0000\"\n * \"flex\" → null\n */\nexport function getArbitraryValue(cls: string): string | null {\n const utility = extractUtility(cls)\n const openBracket = utility.indexOf('[')\n if (openBracket === -1) return null\n\n // Find matching close bracket\n let depth = 0\n for (let i = openBracket; i < utility.length; i++) {\n if (utility[i] === '[') depth++\n else if (utility[i] === ']') {\n depth--\n if (depth === 0) {\n return utility.slice(openBracket + 1, i)\n }\n }\n }\n return null\n}\n\n/**\n * Position of the `!` important modifier within a utility.\n *\n * Tailwind v4 accepts `!` as a prefix (`!flex`) or suffix (`flex!`).\n * Rules that look up the utility's bare form (e.g. against the design\n * system) must strip and later reattach `!` at the original position\n * so the rewrite preserves the user's chosen convention.\n *\n * Reuses the same `'prefix' | 'suffix' | null` shape `parseClass` exposes.\n */\nexport type ImportantPosition = 'prefix' | 'suffix' | null\n\n/**\n * Strip the `!` important modifier from a utility's bare form (no variant\n * prefix). Returns the bare string and the original position. Operate on\n * the utility part — call `splitUtilityAndVariant` first if you have the\n * full class. `parseClass` does both in one pass; use that when you need\n * the full ParsedClass shape.\n */\nexport function splitImportant(utility: string): { bare: string; position: ImportantPosition } {\n if (utility.startsWith('!')) return { bare: utility.slice(1), position: 'prefix' }\n if (utility.endsWith('!')) return { bare: utility.slice(0, -1), position: 'suffix' }\n return { bare: utility, position: null }\n}\n\n/**\n * Reattach `!` at the position recorded by `splitImportant`.\n * The inverse of `splitImportant`: `reattachImportant(splitImportant(x).bare, splitImportant(x).position) === x`.\n */\nexport function reattachImportant(bare: string, position: ImportantPosition): string {\n if (position === 'prefix') return `!${bare}`\n if (position === 'suffix') return `${bare}!`\n return bare\n}\n\n/**\n * Fully parses a Tailwind class into its components.\n */\nexport function parseClass(cls: string): ParsedClass {\n const variants = extractVariants(cls)\n const variantPrefix = variants.length > 0 ? variants.join(':') + ':' : ''\n let utility = extractUtility(cls)\n\n // Detect important modifier\n let important = false\n let importantPosition: 'prefix' | 'suffix' | null = null\n\n if (utility.startsWith('!')) {\n important = true\n importantPosition = 'prefix'\n utility = utility.slice(1)\n } else if (utility.endsWith('!')) {\n important = true\n importantPosition = 'suffix'\n utility = utility.slice(0, -1)\n }\n\n // Detect negative prefix\n let negative = false\n if (utility.startsWith('-')) {\n negative = true\n utility = utility.slice(1)\n }\n\n // Extract arbitrary value\n const arbitraryValue = getArbitraryValue(cls)\n\n return {\n variants,\n variantPrefix,\n important,\n importantPosition,\n negative,\n utility,\n arbitraryValue,\n }\n}\n","/**\n * Rounds rem/em/px values in class strings to avoid\n * JavaScript floating point issues.\n *\n * Example: \"text-lg/[2.4000000000000004rem]\" -> \"text-lg/[2.4rem]\"\n *\n * Regression test for: better-tailwindcss#320\n */\nexport function roundRemValue(className: string): string {\n return className.replace(/\\[(-?\\d+\\.\\d{7,})(rem|em|px|%)\\]/g, (_, num, unit) => {\n const rounded = Number.parseFloat(Number.parseFloat(num).toFixed(6))\n return `[${rounded}${unit}]`\n })\n}\n","import { type PrecomputedData } from './sync-loader'\nimport { roundRemValue } from '../utils/floating-point'\nimport {\n extractUtility,\n extractVariants,\n hasArbitraryValue,\n splitImportant,\n} from '../utils/class-parser'\n\nexport class DesignSystemCache {\n private canonicalMap = new Map<string, string>()\n private validitySet = new Set<string>()\n private orderMap = new Map<string, bigint | null>()\n private cssPropsMap = new Map<string, string[]>()\n private variantOrderMap = new Map<string, number>()\n private arbitraryEquivMap = new Map<string, string>()\n private _validClasses: string[] = []\n private _knownPrefixes: Set<string> | null = null\n private _maxOrder = 0n\n // Tailwind v4 project prefix ('' when none). All maps store prefix-free names;\n // this is consulted to strip/re-apply the prefix at the public-method boundary.\n private _prefix = ''\n // Component classes (`@layer components`, `[class~]`) — valid WITH or WITHOUT\n // the prefix. Kept separate from validitySet so `classValidity` can tell a\n // Tailwind utility (prefix-required) apart from a user component class.\n private componentSet = new Set<string>()\n\n static fromPrecomputed(data: PrecomputedData): DesignSystemCache {\n const cache = new DesignSystemCache()\n\n cache._validClasses = data.validClasses\n for (const cls of data.validClasses) {\n cache.validitySet.add(cls)\n }\n\n for (const [from, to] of Object.entries(data.canonical)) {\n cache.canonicalMap.set(from, roundRemValue(to))\n }\n\n for (const [cls, val] of Object.entries(data.order)) {\n const order = BigInt(val)\n cache.orderMap.set(cls, order)\n if (order > cache._maxOrder) cache._maxOrder = order\n }\n\n for (const [cls, props] of Object.entries(data.cssProps)) {\n cache.cssPropsMap.set(cls, props)\n }\n\n if (data.variantOrder) {\n for (const [name, index] of Object.entries(data.variantOrder)) {\n cache.variantOrderMap.set(name, index)\n }\n }\n\n if (data.componentClasses) {\n for (const cls of data.componentClasses) {\n cache.validitySet.add(cls)\n cache.componentSet.add(cls)\n }\n }\n\n cache._prefix = data.prefix ?? ''\n\n if (data.arbitraryEquivalents) {\n for (const [arb, named] of Object.entries(data.arbitraryEquivalents)) {\n cache.arbitraryEquivMap.set(arb, named)\n }\n }\n\n return cache\n }\n\n get validClasses(): string[] {\n return this._validClasses\n }\n\n get maxOrder(): bigint {\n return this._maxOrder\n }\n\n /** Tailwind v4 project prefix (e.g. 'tw'); '' when none is configured. */\n get prefix(): string {\n return this._prefix\n }\n\n canonicalize(className: string): string {\n const cached = this.canonicalMap.get(className)\n if (cached !== undefined) return cached\n\n // For variant-prefixed classes, canonicalize the base utility\n const utility = extractUtility(className)\n if (utility !== className) {\n const canonicalUtility = this.canonicalMap.get(utility)\n if (canonicalUtility !== undefined) {\n const prefix = className.slice(0, className.length - utility.length)\n return prefix + canonicalUtility\n }\n }\n\n // Strip ! (important) — prefix or suffix — and retry\n const { bare, position } = splitImportant(utility)\n if (position) {\n const canonicalBare = this.canonicalMap.get(bare)\n if (canonicalBare !== undefined) {\n const variantPrefix = className.slice(0, className.length - utility.length)\n // Preserve the user's ! position — enforce-consistent-important-position handles normalization\n return position === 'prefix'\n ? variantPrefix + '!' + canonicalBare\n : variantPrefix + canonicalBare + '!'\n }\n }\n\n return className\n }\n\n /**\n * Resolve a variant name to its priority in the CSS output order.\n * Named variants use the precomputed map. Arbitrary variants use pattern-based heuristics\n * to approximate their position relative to named variants.\n */\n private resolveVariantPriority(variant: string): number {\n // Direct lookup\n const direct = this.variantOrderMap.get(variant)\n if (direct !== undefined) return direct\n\n // Strip named slots: group-hover/sidebar → group-hover\n if (variant.includes('/')) {\n const stripped = variant.slice(0, variant.indexOf('/'))\n const p = this.variantOrderMap.get(stripped)\n if (p !== undefined) return p\n }\n\n // group-* / peer-* compound: extract inner variant and resolve it\n if (variant.startsWith('group-') || variant.startsWith('peer-')) {\n const prefix = variant.startsWith('group-') ? 'group-' : 'peer-'\n const inner = variant.slice(prefix.length)\n const innerClean = inner.includes('/') ? inner.slice(0, inner.indexOf('/')) : inner\n return this.resolveVariantPriority(innerClean)\n }\n\n // data-* arbitrary variants: data-[state=open], data-panel-open → near data-open\n if (variant.startsWith('data-')) {\n return this.variantOrderMap.get('data-open') ?? 121\n }\n\n // Arbitrary selector: [&>svg], [& .class], [&_p] → sort after all named variants\n if (variant.startsWith('[')) {\n return (this.variantOrderMap.get('data-ending-style') ?? 124) + 10\n }\n\n // has-[...] / not-[...] → functional pseudo-classes, sort after state pseudo-classes\n if (variant.startsWith('has-') || variant.startsWith('not-') || variant.startsWith('in-')) {\n return (this.variantOrderMap.get('inert') ?? 48) + 1\n }\n\n // aria-* variants: aria-expanded, aria-invalid, etc. → after state pseudo-classes\n if (variant.startsWith('aria-')) {\n return (this.variantOrderMap.get('inert') ?? 48) + 2\n }\n\n return 0\n }\n\n // Lazily built map from every dash-bounded prefix (with and without\n // trailing dash) to the order of the FIRST class in iteration order that\n // exposes that prefix. Replaces a linear scan in the hot path of\n // `enforce-sort-order` (which calls `findOrderByPrefix` for every dynamic\n // utility — `bg-[#fff]`, `gap-13`, `h-(--var)`, etc.).\n private _prefixOrderMap: Map<string, bigint> | null = null\n\n private buildPrefixOrderMap(): Map<string, bigint> {\n const index = new Map<string, bigint>()\n for (const [cls, order] of this.orderMap) {\n if (order === null) continue\n // For `underline-offset-3` produce: `underline`, `underline-`,\n // `underline-offset`, `underline-offset-`. Insertion order in\n // `orderMap` is preserved, so the first class hitting a prefix wins.\n for (let i = cls.indexOf('-'); i >= 0; i = cls.indexOf('-', i + 1)) {\n const p = cls.slice(0, i)\n if (!index.has(p)) index.set(p, order)\n const pd = p + '-'\n if (!index.has(pd)) index.set(pd, order)\n }\n }\n return index\n }\n\n /** Find the order of the first class matching a prefix (e.g. \"max-w-\" → order of \"max-w-0\") */\n private findOrderByPrefix(prefix: string): bigint | undefined {\n // Try prefix without trailing dash first (e.g. \"border-\" → \"border\")\n const withoutDash = prefix.endsWith('-') ? prefix.slice(0, -1) : null\n if (withoutDash) {\n const order = this.orderMap.get(withoutDash)\n if (order != null) return order\n }\n if (!this._prefixOrderMap) this._prefixOrderMap = this.buildPrefixOrderMap()\n return this._prefixOrderMap.get(prefix)\n }\n\n private getKnownPrefixes(): Set<string> {\n if (!this._knownPrefixes) {\n this._knownPrefixes = new Set<string>()\n for (const cls of this._validClasses) {\n const dash = cls.lastIndexOf('-')\n if (dash > 0) this._knownPrefixes.add(cls.slice(0, dash))\n }\n }\n return this._knownPrefixes\n }\n\n isValid(className: string): boolean {\n if (this.validitySet.has(className)) return true\n\n // Strip variants and check base utility\n const utility = extractUtility(className)\n if (utility !== className && this.validitySet.has(utility)) return true\n\n // Strip ! (important) for validation\n const { bare } = splitImportant(utility)\n if (bare !== utility && this.validitySet.has(bare)) return true\n\n // Slash modifier: bg-black/80 (opacity), aspect-3/2 (ratio), w-1/2 (fraction)\n const slashIdx = bare.lastIndexOf('/')\n if (slashIdx > 0) {\n const base = bare.slice(0, slashIdx)\n // Base is a known valid class: bg-black/80 → bg-black valid\n if (this.validitySet.has(base)) return true\n // Base has a known prefix + numeric value: aspect-3/2 → prefix \"aspect\" known + \"3\" numeric\n if (/^(.+)-(\\d+\\.?\\d*)$/.test(base)) {\n const dashIdx = base.lastIndexOf('-')\n if (dashIdx > 0 && this.getKnownPrefixes().has(base.slice(0, dashIdx))) return true\n }\n }\n\n // Dynamic numeric values: w-45, min-h-17.5, gap-13, etc.\n // Tailwind v4 accepts any number for known utility prefixes\n const numericMatch = /^(.+)-(\\d+\\.?\\d*)$/.exec(bare)\n if (numericMatch && this.getKnownPrefixes().has(numericMatch[1])) {\n return true\n }\n\n // Arbitrary values: bracket syntax [200px] or variable shorthand (--var)\n if (hasArbitraryValue(className)) return true\n if (bare.includes('(') && bare.includes(')')) return true\n\n return false\n }\n\n /**\n * Strict validity for `no-unknown-classes`, prefix-aware.\n *\n * - `'valid'` — usable as written.\n * - `'missing-prefix'`— a real Tailwind utility written WITHOUT the required\n * project prefix (`flex` under `prefix(tw)`); generates no CSS.\n * - `'unknown'` — not a recognized class.\n *\n * When no prefix is configured this collapses to the tolerant `isValid`\n * behavior. `isValid` itself stays tolerant (other rules call it with\n * prefix-free candidates), so the strict check lives here.\n */\n classValidity(className: string): 'valid' | 'missing-prefix' | 'unknown' {\n if (!this._prefix) return this.isValid(className) ? 'valid' : 'unknown'\n\n const tag = this._prefix + ':'\n const hadPrefix = className.startsWith(tag)\n const body = hadPrefix ? className.slice(tag.length) : className\n\n // Base utility (no variants, no important, no slash modifier) to classify\n // component-vs-utility. Component classes are valid with or without prefix.\n let baseUtility = splitImportant(extractUtility(body)).bare\n const slashIdx = baseUtility.lastIndexOf('/')\n if (slashIdx > 0) baseUtility = baseUtility.slice(0, slashIdx)\n if (this.componentSet.has(baseUtility)) return 'valid'\n\n // Tailwind utility? Validate the unprefixed body via the tolerant path,\n // reusing the dynamic-numeric / arbitrary / slash / important logic.\n if (this.isValid(body)) return hadPrefix ? 'valid' : 'missing-prefix'\n\n return 'unknown'\n }\n\n getOrder(className: string): bigint | null {\n // Strip the project prefix so the variant-synthesis below sees the real\n // variant chain. Otherwise `tw` counts as the first variant and distorts\n // the synthesized order for prefixed classes (orderMap is prefix-free).\n if (this._prefix && className.startsWith(this._prefix + ':')) {\n className = className.slice(this._prefix.length + 1)\n }\n\n const cached = this.orderMap.get(className)\n if (cached !== undefined) return cached\n\n const utility = extractUtility(className)\n const hasVariant = utility !== className\n\n // Resolve the base utility order through fallback chain\n let baseOrder: bigint | undefined = this.orderMap.get(utility) ?? undefined\n\n // Strip ! (important) and retry\n if (baseOrder === undefined) {\n const { bare, position } = splitImportant(utility)\n if (position) {\n baseOrder = this.orderMap.get(bare) ?? undefined\n }\n }\n\n // Strip slash modifier: bg-muted/50 → bg-muted\n if (baseOrder === undefined) {\n const slashIdx = utility.lastIndexOf('/')\n if (slashIdx > 0) {\n const base = utility.slice(0, slashIdx)\n baseOrder = this.orderMap.get(base) ?? undefined\n // Also try stripping ! from the base before slash\n if (baseOrder === undefined) {\n const { bare, position } = splitImportant(base)\n if (position) {\n baseOrder = this.orderMap.get(bare) ?? undefined\n }\n }\n }\n }\n\n // Arbitrary values: max-w-[200px] → look up prefix \"max-w-\" in order map\n if (baseOrder === undefined) {\n const stripped = splitImportant(utility).bare\n const bracketIdx = stripped.indexOf('[')\n if (bracketIdx > 0) {\n const prefix = stripped.slice(0, bracketIdx)\n baseOrder = this.findOrderByPrefix(prefix)\n }\n }\n\n // CSS function syntax: h-(--cell-size), rounded-(--radius) → look up prefix \"h-\", \"rounded-\"\n if (baseOrder === undefined) {\n const stripped = splitImportant(utility).bare\n const parenIdx = stripped.indexOf('(')\n if (parenIdx > 0) {\n const prefix = stripped.slice(0, parenIdx)\n baseOrder = this.findOrderByPrefix(prefix)\n }\n }\n\n // Dynamic numeric values: underline-offset-3, gap-13, etc. → look up prefix\n if (baseOrder === undefined) {\n const stripped = splitImportant(utility).bare\n const numericMatch = /^(.+)-(\\d+\\.?\\d*)$/.exec(stripped)\n if (numericMatch && this.getKnownPrefixes().has(numericMatch[1])) {\n baseOrder = this.findOrderByPrefix(numericMatch[1] + '-')\n }\n }\n\n if (baseOrder === undefined) return null\n\n // No variant prefix → just the base order\n if (!hasVariant) return baseOrder\n\n // Synthesize order for variant-prefixed classes.\n // Variant classes must sort AFTER all base classes, grouped by variant priority.\n // Use the first variant's priority as primary key; sub-variants are tie-breakers.\n const variants = extractVariants(className)\n const firstPriority = this.resolveVariantPriority(variants[0]) + 1\n let subPriority = 0\n for (let i = 1; i < variants.length; i++) {\n subPriority += this.resolveVariantPriority(variants[i]) + 1\n }\n\n const bucketSize = this._maxOrder + 1n\n const SUB_MULTIPLIER = 1000n\n return (\n BigInt(firstPriority) * SUB_MULTIPLIER * bucketSize +\n BigInt(subPriority) * bucketSize +\n baseOrder\n )\n }\n\n getClassOrder(classes: string[]): [string, bigint | null][] {\n return classes.map((cls) => [cls, this.getOrder(cls)])\n }\n\n getCssProperties(className: string): string[] {\n const result = this.cssPropsMap.get(className)\n if (result) return result\n const { bare, position } = splitImportant(className)\n if (position) return this.cssPropsMap.get(bare) ?? []\n return []\n }\n\n getVariantPriority(variant: string): number | null {\n return this.variantOrderMap.get(variant) ?? null\n }\n\n hasVariantOrder(): boolean {\n return this.variantOrderMap.size > 0\n }\n\n getNamedEquivalent(className: string): string | null {\n const result = this.arbitraryEquivMap.get(className)\n if (result) return result\n const { bare, position } = splitImportant(className)\n if (position) return this.arbitraryEquivMap.get(bare) ?? null\n return null\n }\n}\n","/**\n * Fatal error types and reporter for the deterministic v1 design.\n *\n * The plugin used to silently skip when the design system could not be\n * loaded or the worker thread misbehaved. v1 fails loud: every DS-dependent\n * rule catches these errors and surfaces them as a single fatal lint\n * diagnostic so the user sees exactly what to fix.\n */\n\n/**\n * The single `messageId` every DS-dependent rule uses to surface a fatal\n * design-system load failure. Exported as a constant so the rule's\n * `meta.messages` and `context.report()` calls in `reportFatalDsError`\n * cannot drift apart silently.\n */\nexport const DS_UNAVAILABLE_MESSAGE_ID = 'designSystemUnavailable' as const\n\n/** Pre-shaped entry for `meta.messages`. Spread it: `messages: { ..., ...DS_UNAVAILABLE_MESSAGE }`. */\nexport const DS_UNAVAILABLE_MESSAGE = {\n [DS_UNAVAILABLE_MESSAGE_ID]: '{{message}}',\n} as const\n\nexport class OxlintTailwindError extends Error {\n /** A short, actionable hint shown alongside the error message. */\n public readonly hint?: string\n\n constructor(message: string, hint?: string, options?: ErrorOptions) {\n super(message, options)\n this.name = this.constructor.name\n this.hint = hint\n }\n}\n\n/** No `settings.tailwindcss.entryPoint` was provided and a DS-dependent rule needs one. */\nexport class MissingEntryPointError extends OxlintTailwindError {}\n\n/** `settings.tailwindcss.entryPoint` is an array of strings — removed in v1. */\nexport class DeprecatedEntryPointShapeError extends OxlintTailwindError {}\n\n/** `__unstable__loadDesignSystem` failed (bad CSS path, malformed CSS, install issue). */\nexport class DesignSystemLoadError extends OxlintTailwindError {}\n\n/** The sort or canonicalize worker thread failed to initialize or timed out. */\nexport class SortServiceError extends OxlintTailwindError {}\n\nexport type FatalError =\n | MissingEntryPointError\n | DeprecatedEntryPointShapeError\n | DesignSystemLoadError\n | SortServiceError\n\n/** Type-guard: did this error originate from the plugin's fail-loud infrastructure? */\nexport function isFatalError(err: unknown): err is FatalError {\n return err instanceof OxlintTailwindError\n}\n\n/**\n * Format a fatal error into the diagnostic message a rule should report.\n *\n * Pulls in the optional `hint` (a one-line \"here's how to fix it\" follow-up)\n * so the message is self-contained even when the user is reading it in an\n * editor without the docs site open.\n */\nexport function formatFatalError(err: FatalError): string {\n return err.hint ? `${err.message}\\n\\nHint: ${err.hint}` : err.message\n}\n\n/**\n * Structural reporter shape. Permissive on the diagnostic parameter so the\n * helper accepts oxlint's strict `RuleContext.report` (which takes a typed\n * `DiagnosticBase`) without pinning to a specific oxlint version.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Reporter = { report: (diagnostic: any) => void }\n\n/**\n * Helper for DS-dependent rules to convert a caught fatal error into a\n * single diagnostic. Returns `true` if the error was reported (and the\n * visitor should bail out), `false` otherwise — the rule layer rethrows\n * non-fatal errors to surface real bugs.\n */\nexport function reportFatalDsError<C extends Reporter>(\n context: C,\n err: unknown,\n node?: unknown,\n): boolean {\n if (!isFatalError(err)) return false\n context.report({\n node,\n messageId: DS_UNAVAILABLE_MESSAGE_ID,\n data: { message: formatFatalError(err) },\n })\n return true\n}\n\n/**\n * Call `getDS()` and route fatal errors through `reportFatalDsError`.\n *\n * Returns the load result on success, or `null` after a fatal error has been\n * reported (rules should `if (!ds) return` and exit the visitor). Non-fatal\n * errors are re-thrown so genuine bugs aren't hidden.\n */\nexport function safeGetDS<T, C extends Reporter>(\n getDS: () => T,\n context: C,\n node?: unknown,\n): T | null {\n try {\n return getDS()\n } catch (err) {\n if (reportFatalDsError(context, err, node)) return null\n throw err\n }\n}\n","/**\n * Single source of truth for the resolved `@tailwindcss/node` entry path\n * and its installed version. Three call sites (sync-loader, sort-service,\n * canonicalize-service) used to each call `require.resolve` independently\n * — this module resolves once at load and exposes the results.\n *\n * The version is read from `dist/../package.json` (the published layout)\n * with a walk-up fallback for unconventional installs.\n */\n\nimport { existsSync, readFileSync } from 'node:fs'\nimport { dirname, join } from 'node:path'\n\nfunction resolveTailwindNodePath(): string | null {\n try {\n return require.resolve('@tailwindcss/node')\n } catch {\n return null\n }\n}\n\nfunction readVersionFromEntry(entryPath: string): string {\n // `@tailwindcss/node` ships as `dist/index.{cjs,mjs}` next to a package.json.\n // Walk up at most a few levels in case the layout differs.\n let dir = dirname(entryPath)\n for (let i = 0; i < 5; i++) {\n const pkgJson = join(dir, 'package.json')\n if (existsSync(pkgJson)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgJson, 'utf-8')) as {\n name?: string\n version?: string\n }\n if (pkg.name === '@tailwindcss/node' && pkg.version) return pkg.version\n } catch {\n // try next level\n }\n }\n const parent = dirname(dir)\n if (parent === dir) break\n dir = parent\n }\n return 'unknown'\n}\n\nconst entryPath = resolveTailwindNodePath()\n\n/**\n * Absolute path to `@tailwindcss/node`'s main entry, or `null` if not\n * installed. Workers receive this path via workerData; the parent does\n * the resolution because module resolution from a child process's `eval`\n * context (with cwd inside a tmp dir or under pnpm strict workspaces) can\n * fail to find the bare specifier.\n */\nexport const TAILWIND_NODE_PATH: string | null = entryPath\n\n/**\n * Installed `@tailwindcss/node` version, or `'unknown'`. Used as part of\n * the disk-cache key in sync-loader so cached precompute output is\n * invalidated when the consumer upgrades.\n */\nexport const TAILWIND_NODE_VERSION: string =\n entryPath !== null ? readVersionFromEntry(entryPath) : 'unknown'\n","/**\n * Synchronous design system loader using a worker_thread.\n *\n * The problem: __unstable__loadDesignSystem is async, but oxlint's createOnce is sync.\n * The solution: run the design-system load + precompute in a worker_thread that writes\n * the result JSON straight to the disk cache and signals completion over a\n * SharedArrayBuffer, while the main thread blocks on `Atomics.wait`. This runs ONCE per\n * unique CSS entry point at plugin init time.\n *\n * Why a worker_thread and not a forked child process (the pre-1.1 design): `execFileSync`\n * does `fork()` of the oxlint host (Rust + embedded Node). Under Linux overcommit\n * accounting on memory-constrained CI runners, forking a large-RSS process is rejected\n * with `spawnSync … ENOMEM` even though the child immediately `exec`s (#24). A\n * worker_thread creates a thread in-process — no address-space duplication — so it is\n * immune. This mirrors what `sort-service.ts` / `canonicalize-service.ts` already do.\n *\n * For arbitrary values (bg-[#123]) that aren't in the class list, we use heuristics.\n */\n\nimport { Worker, threadId } from 'node:worker_threads'\nimport { createHash } from 'node:crypto'\nimport { closeSync, mkdirSync, openSync, readFileSync, statSync, unlinkSync } from 'node:fs'\nimport { join, resolve } from 'node:path'\nimport { tmpdir } from 'node:os'\nimport { DesignSystemLoadError } from '../utils/fatal'\nimport { TAILWIND_NODE_PATH, TAILWIND_NODE_VERSION } from './tailwind-node'\n\nexport interface PrecomputedData {\n /** All valid class names (candidatesToCss returned non-null) */\n validClasses: string[]\n /** className → canonical form (only entries where canonical differs) */\n canonical: Record<string, string>\n /** className → sort order as string (BigInt serialized) */\n order: Record<string, string>\n /** className → CSS property names affected */\n cssProps: Record<string, string[]>\n /** variant name → sort index from the design system */\n variantOrder: Record<string, number>\n /** Classes from @layer components and modifier classes referenced via [class~=\"...\"] */\n componentClasses: string[]\n /** arbitraryForm → namedClass for unnecessary arbitrary value detection */\n arbitraryEquivalents: Record<string, string>\n /**\n * Tailwind v4 project prefix (e.g. 'tw' for `@import \"tailwindcss\" prefix(tw)`).\n * Empty string when no prefix is configured. All other fields store class\n * names WITHOUT the prefix; this is the single source of truth for it.\n */\n prefix: string\n}\n\nconst PRECOMPUTE_SCRIPT = `\n// Runs as a worker_thread (NOT a forked child process). Inputs arrive via\n// workerData; the result is written straight to the disk cache and completion\n// is signaled over the SharedArrayBuffer's control[2] (0=loading, 1=done,\n// -1=error), mirroring sort-service.ts / canonicalize-service.ts.\nconst { workerData } = require('worker_threads');\nconst { tailwindNodePath, cssPath: WD_CSS_PATH, cachePath: WD_CACHE_PATH, tmpPath: WD_TMP_PATH, sharedBuffer } = workerData;\nconst control = new Int32Array(sharedBuffer, 0, 4);\n// On failure, write the error message into the data region so the main thread\n// can surface the real cause instead of a bare \"undefined\".\nconst errLengthView = new DataView(sharedBuffer, 16, 4);\nconst errDataArea = new Uint8Array(sharedBuffer, 20);\nfunction signalError(e) {\n try {\n const msg = Buffer.from(String((e && e.message) || e || 'unknown precompute error'), 'utf-8');\n const n = Math.min(msg.length, errDataArea.length);\n errDataArea.set(msg.subarray(0, n), 0);\n errLengthView.setUint32(0, n);\n } catch {}\n Atomics.store(control, 2, -1);\n Atomics.notify(control, 2);\n}\n// Resolve @tailwindcss/node via an absolute path passed in by the parent —\n// bare-specifier lookup from the worker's cwd fails under pnpm strict\n// workspaces (the module lives under node_modules/.pnpm/... which is not on the\n// resolution path from the consumer's project root).\nconst { __unstable__loadDesignSystem } = require(tailwindNodePath);\nconst { readFileSync, writeFileSync, renameSync } = require('fs');\nconst { dirname, resolve } = require('path');\n\nfunction resolveImport(specifier, baseDir) {\n // Relative import: ./file.css, ../file.css\n if (specifier.startsWith('.')) return resolve(baseDir, specifier);\n // Package import: tw-animate-css, @scope/pkg\n const { join } = require('path');\n const { existsSync } = require('fs');\n // Walk up to find node_modules (monorepo support)\n let dir = baseDir;\n while (true) {\n const pkgDir = join(dir, 'node_modules', specifier);\n if (existsSync(pkgDir)) {\n // Read package.json to find CSS entry (main, style, exports.style)\n try {\n const pkg = JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf-8'));\n const entry = pkg.style || pkg.main || '';\n if (entry.endsWith('.css')) return resolve(pkgDir, entry);\n // Check exports[\".\"].style\n const exp = pkg.exports && pkg.exports['.'];\n const styleEntry = typeof exp === 'object' && exp !== null ? exp.style : null;\n if (styleEntry) return resolve(pkgDir, styleEntry);\n } catch {}\n // Fallback: try common CSS filenames\n const fallbacks = ['index.css', 'dist/index.css', 'style.css', 'styles.css'];\n for (const f of fallbacks) {\n const p = join(pkgDir, f);\n if (existsSync(p)) return p;\n }\n return null;\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\nfunction extractComponentClasses(cssPath, baseDir) {\n let css;\n try { css = readFileSync(cssPath, 'utf-8'); } catch { return []; }\n const files = [css];\n const importRe = /@import\\\\s+['\"]([^'\"]+)['\"]/g;\n let m;\n while ((m = importRe.exec(css)) !== null) {\n const resolved = resolveImport(m[1], baseDir);\n if (resolved) {\n try { files.push(readFileSync(resolved, 'utf-8')); } catch {}\n }\n }\n const result = [];\n for (const content of files) {\n // Scan both @layer components AND @layer utilities\n const layerRe = /@layer\\\\s+(?:components|utilities)\\\\s*\\\\{/g;\n let lm;\n while ((lm = layerRe.exec(content)) !== null) {\n let depth = 1, i = lm.index + lm[0].length;\n while (i < content.length && depth > 0) {\n if (content[i] === '{') depth++;\n if (content[i] === '}') depth--;\n i++;\n }\n const block = content.slice(lm.index + lm[0].length, i - 1);\n const selRe = /\\\\.([\\\\w-]+)/g;\n let sm;\n while ((sm = selRe.exec(block)) !== null) result.push(sm[1]);\n }\n // Scan all class selectors anywhere in the file (.class-name)\n const classSelRe = /\\\\.([a-zA-Z_][\\\\w-]*)/g;\n let cs;\n while ((cs = classSelRe.exec(content)) !== null) result.push(cs[1]);\n }\n return [...new Set(result)];\n}\n\nasync function main() {\n const cssPath = WD_CSS_PATH;\n const css = readFileSync(cssPath, 'utf-8');\n const base = dirname(cssPath);\n const ds = await __unstable__loadDesignSystem(css, { base });\n\n // Tailwind v4 project prefix (\\`@import \"tailwindcss\" prefix(tw)\\`). getClassList()\n // returns names WITHOUT the prefix, but candidatesToCss/getClassOrder/\n // canonicalizeCandidates only resolve the PREFIXED form (\\`tw:flex\\`). We apply\n // the prefix only when calling the DS and strip it back off before storing, so\n // every structure stays prefix-free. The prefix is alphanumeric (no ':' '-' '['\n // ']' '/'), so \\`prefix + ':'\\` is an unambiguous separator.\n const prefix = (ds.theme && ds.theme.prefix) || '';\n const pfx = (c) => prefix ? prefix + ':' + c : c;\n const unpfx = (c) => (prefix && c.startsWith(prefix + ':')) ? c.slice(prefix.length + 1) : c;\n\n const entries = ds.getClassList();\n const classNames = entries.map(e => e[0]);\n\n // Index for O(1) lookups by class name (avoids O(N) indexOf/includes in later phases)\n const classNameIndex = new Map();\n for (let i = 0; i < classNames.length; i++) classNameIndex.set(classNames[i], i);\n\n // Validity: which classes produce CSS. Validate the prefixed form, but keep\n // cssResults aligned positionally to the unprefixed classNames so the later\n // cssProps / arbitraryEquivalents phases keep indexing by position.\n const cssResults = ds.candidatesToCss(classNames.map(pfx));\n const validClasses = classNames.filter((_, i) => cssResults[i] != null);\n\n // Expand: validate extra candidates not in getClassList() but valid in v4\n const validSet = new Set(validClasses);\n const knownPrefixes = new Set();\n for (const cls of validClasses) {\n const dash = cls.lastIndexOf('-');\n if (dash > 0) knownPrefixes.add(cls.slice(0, dash));\n }\n const extraCandidates = [];\n const breakpoints = ['sm', 'md', 'lg', 'xl', '2xl'];\n for (const prefix of knownPrefixes) {\n // Bare utilities: rounded, shadow, blur, etc.\n if (!validSet.has(prefix)) extraCandidates.push(prefix);\n // Screen breakpoint variants: max-w-screen-lg, etc.\n for (const bp of breakpoints) {\n const candidate = prefix + '-screen-' + bp;\n if (!validSet.has(candidate)) extraCandidates.push(candidate);\n }\n }\n if (extraCandidates.length > 0) {\n const extraResults = ds.candidatesToCss(extraCandidates.map(pfx));\n for (let i = 0; i < extraCandidates.length; i++) {\n if (extraResults[i] != null) {\n validClasses.push(extraCandidates[i]);\n validSet.add(extraCandidates[i]);\n }\n }\n }\n\n // Marker classes: group/peer don't produce CSS but enable group-hover:/peer-checked: variants\n const allVariants = ds.getVariants();\n for (const v of allVariants) {\n if (v.name === 'group' || v.name.startsWith('group-')) {\n validClasses.push('group'); validSet.add('group'); break;\n }\n }\n for (const v of allVariants) {\n if (v.name === 'peer' || v.name.startsWith('peer-')) {\n validClasses.push('peer'); validSet.add('peer'); break;\n }\n }\n\n // Named groups/peers: group/name, peer/name — the /name part is user-defined\n // These are validated by the variant system, not by candidatesToCss\n\n // Canonical forms (only store diffs)\n // NOTE: canonicalizeCandidates deduplicates, so we must call it one class at a time\n const canonical = {};\n for (const cls of classNames) {\n const result = ds.canonicalizeCandidates([pfx(cls)]);\n const canon = result[0] ? unpfx(result[0]) : null;\n // Compare unprefixed-vs-unprefixed so the prefix itself never reads as a change.\n if (canon && canon !== cls) {\n canonical[cls] = canon;\n }\n }\n\n // Legacy v3 classes that produce valid CSS in v4 but are not enumerated by\n // getClassList(). Tailwind's canonicalizeCandidates() still rewrites them to\n // their v4 equivalent, so we feed them in explicitly. Without this pass,\n // classes like \\`break-words\\` would be invisible to enforce-canonical\n // (issue #16).\n // - Fixed renames mirror the internal v3->v4 map in tailwindcss/canonicalize.\n // - Pattern renames (start-* -> inset-s-*, end-* -> inset-e-*) are derived\n // from the inset-{s,e}-* utilities present in validClasses so we cover\n // every numeric/named value the design system exposes.\n const legacyCandidates = [\n 'order-none',\n 'break-words',\n 'overflow-ellipsis',\n 'flex-grow', 'flex-grow-0', 'flex-grow-1',\n 'flex-shrink', 'flex-shrink-0', 'flex-shrink-1',\n 'decoration-clone', 'decoration-slice',\n 'bg-gradient-to-t', 'bg-gradient-to-tr', 'bg-gradient-to-r', 'bg-gradient-to-br',\n 'bg-gradient-to-b', 'bg-gradient-to-bl', 'bg-gradient-to-l', 'bg-gradient-to-tl',\n ];\n for (const cls of validClasses) {\n if (cls.startsWith('inset-s-')) legacyCandidates.push('start-' + cls.slice(8));\n else if (cls.startsWith('-inset-s-')) legacyCandidates.push('-start-' + cls.slice(9));\n else if (cls.startsWith('inset-e-')) legacyCandidates.push('end-' + cls.slice(8));\n else if (cls.startsWith('-inset-e-')) legacyCandidates.push('-end-' + cls.slice(9));\n }\n const legacyToProcess = legacyCandidates.filter(cls => !validSet.has(cls));\n if (legacyToProcess.length > 0) {\n const legacyCssResults = ds.candidatesToCss(legacyToProcess.map(pfx));\n for (let i = 0; i < legacyToProcess.length; i++) {\n if (legacyCssResults[i] == null) continue;\n const cls = legacyToProcess[i];\n const result = ds.canonicalizeCandidates([pfx(cls)]);\n const canon = result[0] ? unpfx(result[0]) : null;\n if (canon && canon !== cls) {\n canonical[cls] = canon;\n }\n // Mark as valid so no-unknown-classes doesn't flag legacy spellings.\n validClasses.push(cls);\n validSet.add(cls);\n }\n }\n\n // Sort order — include extra candidates so bare utilities (rounded, blur, etc.) get order\n const allForOrder = [...classNames];\n for (const cls of validClasses) {\n if (!classNameIndex.has(cls)) allForOrder.push(cls);\n }\n const order = {};\n const orderResults = ds.getClassOrder(allForOrder.map(pfx));\n for (const [name, val] of orderResults) {\n if (val !== null) order[unpfx(name)] = val.toString();\n }\n\n // CSS properties per class — extract only from the ROOT selector, not descendant selectors.\n // Plugin classes like \"prose\" generate CSS for both the root element (.prose { color: ...; })\n // and descendant selectors (:where(.prose pre) { overflow-x: auto; }).\n // Only root-level properties should be used for conflict detection.\n const cssProps = {};\n const atPropertyDescriptors = new Set(['syntax', 'inherits', 'initial-value']);\n\n function extractRootCssProps(cssText, className) {\n const rootProps = [];\n const allProps = [];\n // CSS-escape special chars in class name for selector matching\n const escapedName = className.replace(/([^\\\\w-])/g, '\\\\\\\\$1');\n const classSelector = '.' + escapedName;\n const rawSelector = '.' + className;\n const propRe = /^\\\\s+([\\\\w-]+)\\\\s*:/gm;\n\n function isRoot(sel) {\n for (const s of [classSelector, rawSelector]) {\n if (sel === s) return true;\n if (sel.length > s.length && sel.startsWith(s) && sel[s.length] === ':') return true;\n }\n return false;\n }\n\n // Extract only top-level declarations from a block body (skip nested blocks).\n // For CSS nesting like .prose { color: ...; :where(a) { color: ...; } },\n // only extracts \"color\" from the top level, not from the nested :where(a) block.\n function extractTopLevelProps(body) {\n const props = [];\n let depth = 0;\n let lineStart = 0;\n for (let i = 0; i <= body.length; i++) {\n if (i === body.length || body[i] === '\\\\n') {\n if (depth === 0) {\n const line = body.slice(lineStart, i);\n const m = /^\\\\s+([\\\\w-]+)\\\\s*:/.exec(line);\n if (m && !atPropertyDescriptors.has(m[1])) props.push(m[1]);\n }\n lineStart = i + 1;\n } else if (body[i] === '{') {\n depth++;\n } else if (body[i] === '}') {\n depth--;\n }\n }\n return props;\n }\n\n function processText(text) {\n let i = 0;\n while (i < text.length) {\n while (i < text.length && /\\\\s/.test(text[i])) i++;\n if (i >= text.length) break;\n const braceIdx = text.indexOf('{', i);\n if (braceIdx === -1) break;\n const selector = text.slice(i, braceIdx).trim();\n let depth = 1, j = braceIdx + 1;\n while (j < text.length && depth > 0) {\n if (text[j] === '{') depth++;\n if (text[j] === '}') depth--;\n j++;\n }\n const body = text.slice(braceIdx + 1, j - 1);\n if (selector.startsWith('@media') || selector.startsWith('@supports') || selector.startsWith('@layer')) {\n processText(body);\n } else if (!selector.startsWith('@')) {\n propRe.lastIndex = 0;\n let m;\n while ((m = propRe.exec(body)) !== null) {\n if (!atPropertyDescriptors.has(m[1])) allProps.push(m[1]);\n }\n if (isRoot(selector)) rootProps.push(...extractTopLevelProps(body));\n }\n i = j;\n }\n }\n\n processText(cssText);\n // Use root-only properties when found; fall back to all for classes with\n // escaped selectors or single-block output where root matching may miss.\n const result = rootProps.length > 0 ? rootProps : allProps;\n return [...new Set(result)];\n }\n\n for (let i = 0; i < classNames.length; i++) {\n if (cssResults[i]) {\n // Match against the prefixed selector (the CSS emits \\`.tw\\\\:flex\\`), but\n // store under the unprefixed key. extractRootCssProps CSS-escapes the ':'.\n const props = extractRootCssProps(cssResults[i], pfx(classNames[i]));\n if (props.length > 0) cssProps[classNames[i]] = props;\n }\n }\n\n // Variant ordering from the design system\n const variantOrder = {};\n const variants = ds.getVariants();\n for (let i = 0; i < variants.length; i++) {\n if (!variants[i].isArbitrary) {\n variantOrder[variants[i].name] = i;\n }\n }\n\n // Component classes from @layer components\n const componentClasses = extractComponentClasses(cssPath, base);\n\n // Extract class names from attribute selectors [class~=\"...\"] in CSS output.\n // Plugins like @tailwindcss/typography use these for modifier classes (e.g. \"not-prose\")\n // that don't generate their own CSS but are referenced in other classes' selectors.\n const attrClassRe = /\\\\[class~=\"([^\"]+)\"\\\\]/g;\n for (let i = 0; i < cssResults.length; i++) {\n if (cssResults[i]) {\n let acm;\n attrClassRe.lastIndex = 0;\n while ((acm = attrClassRe.exec(cssResults[i])) !== null) {\n // Typography-style plugins emit \\`[class~=\"tw:not-prose\"]\\` under a prefix.\n componentClasses.push(unpfx(acm[1]));\n }\n }\n }\n\n // Arbitrary equivalents: map arbitrary forms to named equivalents.\n // Enumerate every dash split point so multi-segment utilities (e.g.\n // bg-card-foreground) emit candidates for every prefix; lastIndexOf\n // alone drops the shorter prefix and misses multi-segment mappings.\n // Start at indexOf('-', 1) so negative utilities (e.g. -translate-x-1)\n // keep their leading '-' in every prefix instead of producing '' + '-[…]'.\n const arbitraryEquivalents = {};\n const candidates = [];\n for (const cls of validClasses) {\n if (cls.includes('[') || cls.includes('/')) continue;\n const idx = classNameIndex.get(cls);\n if (idx === undefined) continue;\n const cssText = cssResults[idx];\n if (!cssText) continue;\n const pvMatch = cssText.match(/^\\\\s+([\\\\w-]+)\\\\s*:\\\\s*(.+?)\\\\s*;?\\\\s*$/m);\n if (!pvMatch) continue;\n const value = pvMatch[2].trim().replace(/;$/, '');\n for (let dashPos = cls.indexOf('-', 1); dashPos > 0; dashPos = cls.indexOf('-', dashPos + 1)) {\n const prefix = cls.slice(0, dashPos);\n candidates.push({ arbitraryForm: prefix + '-[' + value + ']', namedCls: cls, namedCss: cssText });\n }\n }\n function extractDeclarations(css) {\n const openBrace = css.indexOf('{');\n const closeBrace = css.lastIndexOf('}');\n if (openBrace === -1 || closeBrace === -1) return css;\n return css.slice(openBrace + 1, closeBrace).replace(/\\\\s+/g, ' ').trim();\n }\n if (candidates.length > 0) {\n const arbForms = candidates.map(c => c.arbitraryForm);\n // Prefix only the validation; keys/values stored stay prefix-free. The\n // declaration block extractDeclarations compares is identical with or\n // without the prefix (the prefix only affects the selector).\n const arbResults = ds.candidatesToCss(arbForms.map(pfx));\n for (let i = 0; i < candidates.length; i++) {\n if (!arbResults[i]) continue;\n if (extractDeclarations(arbResults[i]) === extractDeclarations(candidates[i].namedCss)) {\n arbitraryEquivalents[candidates[i].arbitraryForm] = candidates[i].namedCls;\n }\n }\n }\n\n const json = JSON.stringify({ validClasses, canonical, order, cssProps, variantOrder, componentClasses, arbitraryEquivalents, prefix });\n // Atomic write: write to a unique temp path then rename, so a peer isolate\n // busy-waiting on the cache file never observes a half-written JSON.\n writeFileSync(WD_TMP_PATH, json);\n renameSync(WD_TMP_PATH, WD_CACHE_PATH);\n}\nmain()\n .then(() => { Atomics.store(control, 2, 1); Atomics.notify(control, 2); })\n .catch((e) => signalError(e));\n`\n\nconst CACHE_DIR = join(tmpdir(), 'oxlint-tailwindcss')\n\n/**\n * Cache key derived from:\n * - md5(PRECOMPUTE_SCRIPT): auto-invalidates when our precompute logic changes,\n * since the shape and content of the cached JSON is fully determined by what\n * this script prints to stdout.\n * - @tailwindcss/node version: auto-invalidates when the consumer upgrades\n * tailwindcss (e.g. 4.2 → 4.3 adding `zoom-*`, `tab-*`, `scrollbar-*` etc.),\n * so `validClasses`, `cssProps`, `canonical`, and `arbitraryEquivalents`\n * reflect the installed version. @tailwindcss/node and tailwindcss are\n * published together, so their versions match.\n */\nexport function computeCacheKey(scriptContent: string, tailwindVersion: string): string {\n const scriptHash = createHash('md5').update(scriptContent).digest('hex').slice(0, 8)\n return `${scriptHash}:${tailwindVersion}`\n}\n\nconst CACHE_KEY = computeCacheKey(PRECOMPUTE_SCRIPT, TAILWIND_NODE_VERSION)\n\n/**\n * Single-level disk cache keyed by content hash only.\n *\n * `loader.ts` keeps a per-process in-memory cache keyed by `(path, mtime)`\n * to avoid re-stat'ing the same file repeatedly. The disk cache lives in\n * `os.tmpdir()/oxlint-tailwindcss/` and is shared across processes — and\n * across packages in a monorepo, since two packages with identical CSS\n * content produce the same hash.\n *\n * v1 removed the legacy two-level cache (mtime-keyed `.idx` files →\n * content-keyed `.json`). The fast path it provided is duplicated by the\n * in-memory mtime check in loader.ts; storing it on disk too created the\n * possibility of mtime/content drift that could serve stale data.\n */\n\nexport const DEFAULT_LOAD_TIMEOUT_MS = 60_000\n\nfunction computeContentHash(content: string): string {\n return createHash('md5').update(`${CACHE_KEY}:${content}`).digest('hex')\n}\n\nfunction getContentCachePath(contentHash: string): string {\n return join(CACHE_DIR, `${contentHash}.json`)\n}\n\n/**\n * The on-disk cache artifacts for a CSS entry point: the precomputed `json`\n * and the coordination `lock`. Exposed for tests that exercise the\n * cold-cache precompute coordination (issue #24).\n */\nexport function cacheArtifactPaths(cssPath: string): { json: string; lock: string } {\n const content = readFileSync(resolve(cssPath), 'utf-8')\n const hash = computeContentHash(content)\n return { json: getContentCachePath(hash), lock: join(CACHE_DIR, `${hash}.lock`) }\n}\n\nfunction tryReadCache(cachePath: string): PrecomputedData | null {\n const raw = tryReadRawCache(cachePath)\n if (raw === null) return null\n try {\n return JSON.parse(raw) as PrecomputedData\n } catch {\n return null\n }\n}\n\nfunction tryReadRawCache(cachePath: string): string | null {\n try {\n return readFileSync(cachePath, 'utf-8')\n } catch {\n return null\n }\n}\n\n// --- Cross-isolate precompute coordination (issue #24) ---\n//\n// oxlint lints files across parallel isolates. On a cold cache they would all\n// reach `loadDesignSystemSync` for the same CSS at once, and each would spawn a\n// precompute worker that loads `@tailwindcss/node`. Letting a dozen run at once\n// wastes memory re-doing identical work.\n//\n// The fix: a content-hash-scoped file lock. The first isolate to create the\n// lock runs the precompute worker (which writes the cache); the others busy-wait\n// for the resulting `.json` instead of spawning their own. Coordination is keyed\n// by content hash, so distinct CSS files still precompute in parallel.\n\nconst LOCK_POLL_MS = 50\n\n// Reused zero-initialized buffer for synchronous sleeps. `Atomics.wait` blocks\n// the calling thread for up to `ms` because nothing ever notifies index 0.\nconst SLEEP_BUFFER = new Int32Array(new SharedArrayBuffer(4))\n\nfunction syncSleep(ms: number): void {\n Atomics.wait(SLEEP_BUFFER, 0, 0, ms)\n}\n\n/** Age of the lock file in ms, or Infinity if it has already vanished. */\nfunction lockAgeMs(lockPath: string): number {\n try {\n return Date.now() - statSync(lockPath).mtimeMs\n } catch {\n return Number.POSITIVE_INFINITY\n }\n}\n\nfunction tryUnlink(path: string): void {\n try {\n unlinkSync(path)\n } catch {\n // Already gone, or not ours to remove — either way, nothing to do.\n }\n}\n\n/** control[2] — the worker's ready/done signal (0=loading, 1=done, -1=error). */\nconst PRECOMPUTE_SIGNAL_INDEX = 2\n\n// Control ints (16 B) + length (4 B) + room for an error message. The success\n// payload goes to disk, so 64 KB is far more than the failure path ever needs.\nconst ERR_BUFFER_SIZE = 64 * 1024\n\n// Monotonic suffix so two precompute workers in the same process never collide\n// on the temp file they write before renaming it into place.\nlet precomputeSeq = 0\n\n/**\n * Choose the diagnostic hint based on the underlying error code. ENOMEM/EAGAIN\n * is memory pressure, not a CSS or timeout problem — the legacy hint pointed\n * users at the wrong levers (issue #24 / birdman CI report). Exported for tests.\n */\nexport function precomputeHint(cause: unknown): string {\n const code = (cause as NodeJS.ErrnoException | undefined)?.code\n const message = cause instanceof Error ? cause.message : ''\n if (code === 'ENOMEM' || code === 'EAGAIN' || message.includes('ENOMEM')) {\n return 'The host ran out of memory spawning the precompute worker. This is rare now that precompute runs in a worker thread; if it persists, lower oxlint concurrency (e.g. `--threads`) or give the machine/CI runner more memory.'\n }\n return 'Check the CSS file (and its imports) for syntax errors. If this looks like a timeout, raise `settings.tailwindcss.timeout`.'\n}\n\nfunction precomputeLoadError(resolvedPath: string, cause: unknown): DesignSystemLoadError {\n const causeError = cause instanceof Error ? cause : undefined\n const message = causeError?.message ?? String(cause)\n return new DesignSystemLoadError(\n `Failed to precompute design system from \"${resolvedPath}\": ${message}`,\n precomputeHint(cause),\n { cause: causeError },\n )\n}\n\n/**\n * Run the precompute in a worker_thread (not a forked child). The worker loads\n * the design system in-process, writes the JSON straight to `cachePath`, and\n * signals completion over a SharedArrayBuffer; the main thread blocks on\n * `Atomics.wait`. Because worker_threads don't fork the host's address space,\n * this avoids the `spawnSync … ENOMEM` the fork-based path hit on\n * memory-constrained CI runners (#24).\n *\n * Throws `DesignSystemLoadError` on spawn failure, worker error, or timeout.\n * The worker writes the result itself, so this returns nothing — callers read\n * it back from `cachePath`.\n */\nfunction runPrecomputeViaWorker(\n resolvedPath: string,\n tailwindNodePath: string,\n cachePath: string,\n timeout: number,\n): void {\n // The precompute payload travels via the disk cache, so the buffer only needs\n // room for the control ints plus an error message on the failure path:\n // [0..3] Int32 control (index 2 = ready signal)\n // [16..19] Uint32 error-message length\n // [20..] Uint8 error-message bytes\n const sharedBuffer = new SharedArrayBuffer(ERR_BUFFER_SIZE)\n const control = new Int32Array(sharedBuffer, 0, 4)\n const errLengthView = new DataView(sharedBuffer, 16, 4)\n const errDataArea = new Uint8Array(sharedBuffer, 20)\n const tmpPath = `${cachePath}.tmp.${process.pid}.${threadId}.${precomputeSeq++}`\n\n let worker: Worker\n try {\n worker = new Worker(PRECOMPUTE_SCRIPT, {\n eval: true,\n workerData: { sharedBuffer, cssPath: resolvedPath, cachePath, tmpPath, tailwindNodePath },\n })\n } catch (cause) {\n throw precomputeLoadError(resolvedPath, cause)\n }\n\n // The main thread is blocked in `Atomics.wait`, so this handler can only run\n // after the wait returns. It captures hard crashes that never signaled, so\n // the `-1` branch below can report the real cause instead of a bare timeout.\n let workerError: Error | undefined\n worker.on('error', (err: Error) => {\n workerError = err\n })\n\n try {\n const result = Atomics.wait(control, PRECOMPUTE_SIGNAL_INDEX, 0, timeout)\n if (result === 'timed-out') {\n throw new DesignSystemLoadError(\n `Timed out precomputing design system from \"${resolvedPath}\" after ${timeout}ms.`,\n 'Raise `settings.tailwindcss.timeout` if your machine or CI runner is slow, or verify the CSS imports resolve.',\n )\n }\n if (control[PRECOMPUTE_SIGNAL_INDEX] === -1) {\n // Prefer the message the worker wrote; fall back to a hard-crash error.\n const len = errLengthView.getUint32(0)\n const cause =\n len > 0 ? new Error(Buffer.from(errDataArea.slice(0, len)).toString('utf-8')) : workerError\n throw precomputeLoadError(resolvedPath, cause)\n }\n // Success: the worker wrote the cache file. Nothing else to do here.\n } finally {\n tryUnlink(tmpPath)\n void worker.terminate()\n }\n}\n\n/**\n * Run the precompute worker, then read back the JSON it wrote to `cachePath`.\n * Used by both the lock-winner path and the uncoordinated degrade path.\n */\nfunction precomputeAndRead(\n resolvedPath: string,\n tailwindNodePath: string,\n cachePath: string,\n timeout: number,\n): string {\n runPrecomputeViaWorker(resolvedPath, tailwindNodePath, cachePath, timeout)\n const raw = tryReadRawCache(cachePath)\n if (raw === null) {\n throw new DesignSystemLoadError(\n `Precompute worker finished but wrote no cache file for \"${resolvedPath}\".`,\n 'This usually means the system temp directory is not writable; check its permissions.',\n )\n }\n return raw\n}\n\n/**\n * Return the raw precompute JSON for `contentHash`, spawning at most one\n * precompute worker across all isolates competing for the same hash. Whoever\n * wins the lock computes and writes the cache; the rest wait for that file.\n */\nfunction computeWithLock(\n resolvedPath: string,\n tailwindNodePath: string,\n contentHash: string,\n cachePath: string,\n timeout: number,\n): string {\n const lockPath = join(CACHE_DIR, `${contentHash}.lock`)\n // A healthy holder is busy inside the precompute worker (up to `timeout`);\n // only treat the lock as abandoned once it outlives that window plus a margin.\n const staleMs = timeout + 30_000\n\n try {\n mkdirSync(CACHE_DIR, { recursive: true })\n } catch {\n // If we can't even create the cache dir, locking is impossible — fall back\n // to an uncoordinated compute rather than spin forever.\n return precomputeAndRead(resolvedPath, tailwindNodePath, cachePath, timeout)\n }\n\n const start = Date.now()\n for (;;) {\n // A peer may have finished while we looped.\n const raw = tryReadRawCache(cachePath)\n if (raw !== null) return raw\n\n let lockFd: number\n try {\n lockFd = openSync(lockPath, 'wx')\n } catch (cause) {\n if ((cause as NodeJS.ErrnoException).code === 'EEXIST') {\n // Someone else holds it. Reclaim if stale, or if we've waited well past\n // the point a healthy holder should have produced the cache.\n if (lockAgeMs(lockPath) > staleMs || Date.now() - start > staleMs * 2) {\n tryUnlink(lockPath)\n } else {\n syncSleep(LOCK_POLL_MS)\n }\n continue\n }\n // Lock dir not writable or similar — degrade to uncoordinated compute.\n return precomputeAndRead(resolvedPath, tailwindNodePath, cachePath, timeout)\n }\n\n try {\n // The worker writes the cache file itself; read it back as the result.\n return precomputeAndRead(resolvedPath, tailwindNodePath, cachePath, timeout)\n } finally {\n closeSync(lockFd)\n tryUnlink(lockPath)\n }\n }\n}\n\n/**\n * Synchronously load and precompute the design system for a CSS file.\n *\n * Throws `DesignSystemLoadError` on any failure (missing file, worker\n * error, missing `@tailwindcss/node`, etc.). Callers catch via\n * `reportFatalDsError` to surface a single Program-level diagnostic.\n */\nexport function loadDesignSystemSync(cssPath: string, timeout?: number): PrecomputedData {\n const resolvedPath = resolve(cssPath)\n\n let content: string\n try {\n content = readFileSync(resolvedPath, 'utf-8')\n } catch (cause) {\n throw new DesignSystemLoadError(\n `Could not read CSS entry point: ${resolvedPath}`,\n 'Verify the path resolves from the oxlint working directory and the file is readable.',\n { cause: cause instanceof Error ? cause : undefined },\n )\n }\n\n const contentHash = computeContentHash(content)\n const contentCachePath = getContentCachePath(contentHash)\n\n const cached = tryReadCache(contentCachePath)\n if (cached) return cached\n\n // The worker receives @tailwindcss/node's absolute path via workerData.\n // Bare-specifier resolution from the worker's cwd would fail under pnpm\n // strict workspaces where the consumer's project root has no direct\n // access to the plugin's transitive deps.\n if (TAILWIND_NODE_PATH === null) {\n throw new DesignSystemLoadError(\n `Could not resolve '@tailwindcss/node' while loading \"${resolvedPath}\".`,\n \"Install '@tailwindcss/node' (or upgrade oxlint-tailwindcss) and re-run.\",\n )\n }\n\n // Coordinate parallel isolates: at most one spawns the precompute worker for a\n // given content hash; the rest wait for the cache file it writes. The worker\n // runs in-thread (no fork), so it can't trigger the cold-cache `spawnSync …\n // ENOMEM` that the fork-based precompute hit on constrained CI runners (#24).\n const raw = computeWithLock(\n resolvedPath,\n TAILWIND_NODE_PATH,\n contentHash,\n contentCachePath,\n timeout ?? DEFAULT_LOAD_TIMEOUT_MS,\n )\n\n try {\n return JSON.parse(raw) as PrecomputedData\n } catch (cause) {\n throw new DesignSystemLoadError(\n `Precompute output for \"${resolvedPath}\" was not valid JSON.`,\n 'This is likely a bug in oxlint-tailwindcss. Please open an issue with the CSS that triggered it.',\n { cause: cause instanceof Error ? cause : undefined },\n )\n }\n}\n\n// validateCandidatesSync removed — runtime child process calls were too slow.\n// Unknown classes are now handled via precomputed expansion + heuristics in cache.isValid().\n","const PREFIX = '[oxlint-tailwindcss]'\n\nlet _enabled: boolean | null = null\n\n/**\n * Check if debug logging is enabled.\n * Activated by `settings.tailwindcss.debug: true` or `DEBUG=oxlint-tailwindcss` env var.\n */\nexport function isDebugEnabled(settings?: Readonly<Record<string, unknown>>): boolean {\n // Env var always wins — avoids needing to change config\n if (process.env.DEBUG === 'oxlint-tailwindcss') return true\n\n if (settings !== undefined) {\n const tw = settings?.tailwindcss\n if (tw && typeof tw === 'object' && 'debug' in tw) {\n return (tw as Record<string, unknown>).debug === true\n }\n }\n\n return false\n}\n\n/**\n * Enable debug mode (called once when settings become available).\n */\nexport function setDebugEnabled(enabled: boolean): void {\n _enabled = enabled\n}\n\n/**\n * Log a debug message if debug mode is active.\n */\nexport function debugLog(message: string): void {\n if (_enabled || process.env.DEBUG === 'oxlint-tailwindcss') {\n console.error(`${PREFIX} ${message}`)\n }\n}\n\n/**\n * Reset debug state (for tests).\n */\nexport function resetDebug(): void {\n _enabled = null\n}\n","/**\n * Safe accessors for `context.options`, `context.settings`, `context.filename`,\n * plus a `createLazyOptions` helper for the pattern every rule with options\n * reinvents.\n *\n * In oxlint, the context fields may not be available inside `createOnce()`\n * (they're populated when visitors run). The plain getter throws in older\n * versions and returns `null` in newer ones — the safe wrappers absorb both.\n *\n * Lives in `utils/` and not `types.ts` because these are runtime functions,\n * not types — keeping `types.ts` import-type-only enables aggressive\n * tree-shaking and makes the module boundary honest.\n */\n\ninterface ContextLike {\n options?: readonly unknown[]\n settings?: Readonly<Record<string, unknown>>\n filename?: string\n}\n\n/**\n * Safely read `context.options[0]`. Returns `undefined` if the getter throws\n * (oxlint < 1.31.0) or if options aren't populated yet.\n */\nexport function safeOptions<T = Record<string, unknown>>(context: ContextLike): T | undefined {\n try {\n return (context.options?.[0] ?? undefined) as T | undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * Safely read `context.settings`. Same try/catch pattern as `safeOptions`\n * for the createOnce-throws case.\n */\nexport function safeSettings(context: ContextLike): Readonly<Record<string, unknown>> | undefined {\n try {\n return context.settings ?? undefined\n } catch {\n return undefined\n }\n}\n\n/** Safely read `context.filename`. Same try/catch pattern. */\nexport function safeFilename(context: ContextLike): string | undefined {\n try {\n return context.filename ?? undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * Lazily memoize a compiled options object across visitor calls.\n *\n * Every rule with options reinvents:\n *\n * let _x: CompiledOptions | null = null\n * function getX() {\n * if (_x === null) _x = compile(safeOptions<RawOptions>(context))\n * return _x\n * }\n *\n * This wraps the pattern: pass the context and a `compile` function (which\n * receives the raw options object — possibly undefined) and get a memoized\n * thunk back. Inside `createOnce`, options aren't available yet, so the first\n * visitor call triggers compilation; every subsequent call is O(1).\n */\nexport function createLazyOptions<Raw, Compiled>(\n context: ContextLike,\n compile: (raw: Raw | undefined) => Compiled,\n): () => Compiled {\n let cached: { value: Compiled } | null = null\n return () => {\n if (cached) return cached.value\n cached = { value: compile(safeOptions<Raw>(context)) }\n return cached.value\n }\n}\n","import { DesignSystemCache } from './cache'\nimport { loadDesignSystemSync } from './sync-loader'\nimport { debugLog, isDebugEnabled, setDebugEnabled, resetDebug } from './debug'\nimport { statSync } from 'node:fs'\nimport { relative, resolve } from 'node:path'\nimport {\n DeprecatedEntryPointShapeError,\n DesignSystemLoadError,\n isFatalError,\n MissingEntryPointError,\n} from '../utils/fatal'\nimport type { EntryPointMapping } from '../types'\nimport { safeFilename, safeOptions, safeSettings } from '../utils/context'\n\nexport type { EntryPointMapping }\n\nexport interface LoadResult {\n cache: DesignSystemCache\n entryPoint: string\n}\n\ntype EntryPointSetting = string | EntryPointMapping[]\n\nconst dsCache = new Map<string, { cache: DesignSystemCache; mtime: number }>()\n\n/**\n * Memoizes DS-load FAILURES per entry point, keyed by `(resolvedPath, mtime)`.\n *\n * Without this, a single environmental failure (e.g. `spawnSync … ENOMEM` on a\n * constrained CI runner) was re-attempted on every AST node × every rule ×\n * every file — the storm that turned one failure into ~18k re-spawns and 21k\n * per-class errors (issue #24 / birdman report). Caching the failure collapses\n * it to one attempt per entry point per process. Keyed by mtime so fixing the\n * CSS (mtime changes) invalidates the entry and a fresh load is attempted.\n */\nconst dsFailureCache = new Map<string, { error: Error; mtime: number }>()\n\nfunction isEntryPointMapping(v: unknown): v is EntryPointMapping {\n if (typeof v !== 'object' || v === null) return false\n const m = v as Record<string, unknown>\n const filesOk =\n typeof m.files === 'string' ||\n (Array.isArray(m.files) && m.files.every((s) => typeof s === 'string'))\n return filesOk && typeof m.use === 'string'\n}\n\n/**\n * Read `settings.tailwindcss.entryPoint` and normalize it to the v1 shape.\n *\n * Throws `DeprecatedEntryPointShapeError` if the legacy `string[]` shape is\n * still in use (removed in v1; the user must migrate to `{ files, use }[]`).\n */\nexport function entryPointFromSettings(\n settings?: Readonly<Record<string, unknown>>,\n): EntryPointSetting | undefined {\n const tw = settings?.tailwindcss\n if (!tw || typeof tw !== 'object' || !('entryPoint' in tw)) return undefined\n const ep = (tw as Record<string, unknown>).entryPoint\n if (typeof ep === 'string') return ep\n if (Array.isArray(ep)) {\n if (ep.length === 0) return undefined\n if (ep.every((e) => typeof e === 'string')) {\n throw new DeprecatedEntryPointShapeError(\n '`settings.tailwindcss.entryPoint: string[]` was removed in v1.0.0.',\n 'Convert each entry into an object with explicit globs:\\n' +\n ' entryPoint: [\\n' +\n ' { files: \"packages/app/**\", use: \"packages/app/src/styles.css\" },\\n' +\n ' ...\\n' +\n ' ]\\n' +\n 'See https://oxlint-tailwindcss.pages.dev/migration/v0-to-v1',\n )\n }\n if (ep.every(isEntryPointMapping)) return ep as EntryPointMapping[]\n throw new MissingEntryPointError(\n '`settings.tailwindcss.entryPoint` must be either a string or an array of `{ files, use }` objects.',\n 'Each item needs `files` (glob or array of globs) and `use` (path to a CSS file).',\n )\n }\n return undefined\n}\n\n/**\n * Compile a minimal glob pattern to a regular expression.\n *\n * Supported syntax: `**` (any depth), `*` (any chars except `/`), `?` (one\n * char except `/`), plus literal segments. Anchored on both ends.\n *\n * Memoized across calls because `resolveByGlobMapping` runs per lint visit;\n * recompiling the same pattern per AST node would be wasted work.\n */\nconst globRegexCache = new Map<string, RegExp>()\nfunction globToRegExp(glob: string): RegExp {\n const cached = globRegexCache.get(glob)\n if (cached) return cached\n let re = ''\n let i = 0\n while (i < glob.length) {\n const c = glob[i]\n if (c === '*' && glob[i + 1] === '*') {\n re += '.*'\n i += 2\n if (glob[i] === '/') i++\n } else if (c === '*') {\n re += '[^/]*'\n i++\n } else if (c === '?') {\n re += '[^/]'\n i++\n } else if ('+()|.\\\\$^{}[]'.includes(c)) {\n re += '\\\\' + c\n i++\n } else {\n re += c\n i++\n }\n }\n const compiled = new RegExp('^' + re + '$')\n globRegexCache.set(glob, compiled)\n return compiled\n}\n\nfunction matchesAnyGlob(filePath: string, globs: string | string[]): boolean {\n const list = typeof globs === 'string' ? [globs] : globs\n return list.some((g) => globToRegExp(g).test(filePath))\n}\n\n/**\n * Resolve a file path to its entry-point CSS via a mapping array.\n * First-match-wins. Paths are matched relative to `baseDir` (typically the\n * process CWD where oxlint runs), with forward-slash normalization for\n * cross-platform consistency. Returns the absolute CSS path, or `null` if\n * no mapping matches.\n */\nexport function resolveByGlobMapping(\n mappings: EntryPointMapping[],\n filePath: string,\n baseDir: string,\n): string | null {\n const relPath = relative(baseDir, resolve(filePath)).split('\\\\').join('/')\n for (const m of mappings) {\n if (matchesAnyGlob(relPath, m.files)) return resolve(baseDir, m.use)\n }\n return null\n}\n\n/**\n * Extract `rootFontSize` from `settings.tailwindcss` (default: 16).\n */\nexport function rootFontSizeFromSettings(settings?: Readonly<Record<string, unknown>>): number {\n const tw = settings?.tailwindcss\n if (tw && typeof tw === 'object' && 'rootFontSize' in tw) {\n const v = (tw as Record<string, unknown>).rootFontSize\n if (typeof v === 'number' && v > 0) return v\n }\n return 16\n}\n\nfunction timeoutFromSettings(settings?: Readonly<Record<string, unknown>>): number | undefined {\n const tw = settings?.tailwindcss\n if (tw && typeof tw === 'object' && 'timeout' in tw) {\n const t = (tw as Record<string, unknown>).timeout\n if (typeof t === 'number' && t > 0) return t\n }\n return undefined\n}\n\n/**\n * Load the design system for a specific CSS entry point.\n *\n * Throws `DesignSystemLoadError` if the load fails for any reason. Callers\n * (rules via `createLazyLoader`) catch via `reportFatalDsError` and surface\n * the failure as a single Program-level diagnostic.\n *\n * Cached per absolute entry-point path, keyed by mtime. In monorepos each\n * unique CSS gets its own cache entry.\n */\nexport function getLoadedDesignSystem(\n cssPath: string,\n settings?: Readonly<Record<string, unknown>>,\n): LoadResult {\n const resolvedPath = resolve(cssPath)\n\n let mtime: number\n try {\n mtime = statSync(resolvedPath).mtimeMs\n } catch (cause) {\n throw new DesignSystemLoadError(\n `Could not stat CSS entry point: ${resolvedPath}`,\n 'Check that the file exists and is readable. The path is resolved relative to the oxlint working directory.',\n { cause: cause instanceof Error ? cause : undefined },\n )\n }\n\n const cached = dsCache.get(resolvedPath)\n if (cached && cached.mtime === mtime) return { cache: cached.cache, entryPoint: resolvedPath }\n\n // A prior load for this exact (path, mtime) already failed — rethrow the\n // cached error instead of paying the load cost again (issue #24 storm).\n const failed = dsFailureCache.get(resolvedPath)\n if (failed && failed.mtime === mtime) throw failed.error\n\n let data\n try {\n data = loadDesignSystemSync(resolvedPath, timeoutFromSettings(settings))\n } catch (err) {\n // Memoize only plugin-fatal load errors; let genuine bugs propagate without\n // poisoning the cache (mirrors `safeGetDS`'s fatal-vs-rethrow split).\n if (isFatalError(err)) dsFailureCache.set(resolvedPath, { error: err, mtime })\n throw err\n }\n const cache = DesignSystemCache.fromPrecomputed(data)\n dsCache.set(resolvedPath, { cache, mtime })\n debugLog(`Loaded design system from \"${resolvedPath}\"`)\n return { cache, entryPoint: resolvedPath }\n}\n\n/**\n * Lazy DS loader for a rule. Resolves the correct design system for each\n * file being linted, using (in priority order):\n *\n * 1. Rule option `entryPoint` (a string path).\n * 2. `settings.tailwindcss.entryPoint` as a string.\n * 3. `settings.tailwindcss.entryPoint` as an `EntryPointMapping[]` —\n * first matching glob (relative to CWD) wins.\n *\n * If none of those produce an entry point for the current file, throws\n * `MissingEntryPointError`. If the resolved CSS fails to load, throws\n * `DesignSystemLoadError`. Both extend `OxlintTailwindError` and are\n * meant to be caught by `reportFatalDsError` in the rule's `check()`.\n *\n * `context.settings` and `context.filename` are unavailable in `createOnce`,\n * so the actual work is deferred until the returned thunk is invoked from\n * inside a visitor.\n */\nexport function createLazyLoader(context: {\n options?: readonly unknown[]\n settings?: Readonly<Record<string, unknown>>\n filename?: string\n}): () => LoadResult {\n let debugInitialized = false\n let lastFilePath: string | undefined\n let lastResult: LoadResult | undefined\n let lastError: Error | undefined\n\n return () => {\n const filePath = safeFilename(context)\n\n // Visitors fire on every AST node and the file is stable within a lint\n // pass; once we have a result (or a failure) for this filename we can skip\n // the entire resolve → stat → cache-lookup chain. Caching the failure here\n // is what stops a single fatal error from re-running per node (issue #24);\n // `getLoadedDesignSystem` memoizes it across rules, this does it per rule.\n if (filePath !== undefined && filePath === lastFilePath) {\n if (lastError) throw lastError\n if (lastResult) return lastResult\n }\n\n const ruleOptionEntry = safeOptions<{ entryPoint?: string }>(context)?.entryPoint\n const settings = safeSettings(context)\n\n if (!debugInitialized && settings) {\n debugInitialized = true\n setDebugEnabled(isDebugEnabled(settings))\n }\n\n lastFilePath = filePath\n lastResult = undefined\n lastError = undefined\n try {\n const settingsEntry = entryPointFromSettings(settings)\n const cssPath = resolveEntryPointForFile(ruleOptionEntry, settingsEntry, filePath)\n lastResult = getLoadedDesignSystem(cssPath, settings)\n } catch (err) {\n if (isFatalError(err) && err instanceof Error) lastError = err\n throw err\n }\n if (filePath) {\n debugLog(\n `${relative(process.cwd(), filePath)} → ${relative(process.cwd(), lastResult.entryPoint)}`,\n )\n }\n return lastResult\n }\n}\n\n/**\n * Pure resolution from (rule option, settings entry, file path) to a CSS\n * entry-point path. Exported for testability.\n *\n * Throws `MissingEntryPointError` if nothing resolves. The error message\n * names the file so the user knows which one tripped the configuration.\n */\nexport function resolveEntryPointForFile(\n ruleOptionEntry: string | undefined,\n settingsEntry: EntryPointSetting | undefined,\n filePath: string | undefined,\n): string {\n if (ruleOptionEntry) return ruleOptionEntry\n if (typeof settingsEntry === 'string') return settingsEntry\n if (Array.isArray(settingsEntry)) {\n if (!filePath) {\n throw new MissingEntryPointError(\n '`settings.tailwindcss.entryPoint` is a mapping array but no file path is available to match against.',\n 'This usually means the rule ran outside the linter context. Open an issue if you see this in a real lint run.',\n )\n }\n const matched = resolveByGlobMapping(settingsEntry, filePath, process.cwd())\n if (matched) return matched\n throw new MissingEntryPointError(\n `No \\`entryPoint\\` mapping matched \\`${filePath}\\`.`,\n 'Add a mapping covering this file to `settings.tailwindcss.entryPoint`, or use a `\"**\"` fallback entry.',\n )\n }\n throw new MissingEntryPointError(\n `\\`settings.tailwindcss.entryPoint\\` is required${filePath ? ` (linting \\`${filePath}\\`)` : ''}.`,\n 'Set it to a string (single-project) or an array of `{ files, use }` mappings (monorepo).',\n )\n}\n\n/** Reset all DS caches (useful for tests). */\nexport function resetDesignSystem(): void {\n dsCache.clear()\n dsFailureCache.clear()\n resetDebug()\n}\n","/**\n * Shared reporter for the \"first-as-fix, rest-as-suggestion\" pattern.\n *\n * Nine rules (enforce-canonical, enforce-logical, enforce-physical,\n * enforce-consistent-variable-syntax, enforce-consistent-important-position,\n * enforce-negative-arbitrary-values, no-deprecated-classes,\n * no-unnecessary-arbitrary-value, prefer-theme-tokens) all emit\n * replacements via the same shape:\n *\n * 1. Collect `{ cls, replacement }` entries from a class string.\n * 2. Rebuild the full class string with replacements applied.\n * 3. Emit ONE diagnostic with the autofix attached.\n * 4. Emit one MORE diagnostic per remaining offender, each carrying\n * the same autofix as a `suggest`.\n *\n * oxlint's fixer is single-shot per AST node, so multiple offenders in the\n * same class string can only get one mechanical fix; the rest stay as\n * suggestions the IDE can offer interactively.\n */\n\nimport { rebuildClassString, type ClassSplit } from './class-splitter'\nimport { preserveSpaces, type ClassLocation } from './extractors'\n\nexport interface ReplacementEntry {\n cls: string\n replacement: string\n}\n\ninterface Fixer {\n replaceTextRange(range: [number, number], text: string): unknown\n}\n\n// Typed as `unknown` so the helper isn't pinned to a specific oxlint version's\n// diagnostic shape. Rules pass their own typed context; the property access is\n// duck-typed and the diagnostic shape is what oxlint validates.\ntype Reporter = unknown\n\nexport interface ReportOptions {\n /** messageId for every diagnostic emitted (primary fix + suggestion duplicates). */\n messageId: string\n /**\n * Key under which `replacement` appears in the primary diagnostic's data.\n * Defaults to `'replacement'`. enforce-canonical templates \"{{canonical}}\"\n * and passes `'canonical'`.\n */\n replacementKey?: string\n /** messageId of the suggest entry shown for the non-first offenders. */\n suggestMessageId?: string\n}\n\n/**\n * Emit autofix + suggestion diagnostics for a list of class replacements.\n *\n * If `offending` is empty, no-op. The fixer's `replaceTextRange` is shared\n * across all diagnostics — the first one is the primary fix, the rest carry\n * the same fix as a suggestion (oxlint can only apply one autofix per node).\n */\nexport function reportClassReplacements(\n context: Reporter,\n loc: ClassLocation,\n split: ClassSplit,\n classes: string[],\n offending: readonly ReplacementEntry[],\n options: ReportOptions,\n): void {\n if (offending.length === 0) return\n\n const replacements = new Map(offending.map(({ cls, replacement }) => [cls, replacement]))\n const fixedValue = rebuildClassString(\n split,\n classes.map((c) => replacements.get(c) ?? c),\n )\n\n const replacementKey = options.replacementKey ?? 'replacement'\n const suggestMessageId = options.suggestMessageId ?? 'suggestReplace'\n\n const applyFix = (fixer: Fixer) =>\n fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixedValue))\n\n const report = (context as { report: (d: unknown) => void }).report\n\n for (let i = 0; i < offending.length; i++) {\n const { cls, replacement } = offending[i]\n const primaryData: Record<string, string> = { className: cls, [replacementKey]: replacement }\n\n if (i === 0) {\n report({\n node: loc.node,\n messageId: options.messageId,\n data: primaryData,\n fix: applyFix,\n })\n } else {\n report({\n node: loc.node,\n messageId: options.messageId,\n data: primaryData,\n suggest: [\n {\n messageId: suggestMessageId,\n data: { className: cls, replacement },\n fix: applyFix,\n },\n ],\n })\n }\n }\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClassesWithSeparators } from '../utils/class-splitter'\nimport { reportClassReplacements } from '../utils/report'\nimport { reattachImportant, splitImportant, splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\nimport { DS_UNAVAILABLE_MESSAGE, safeGetDS } from '../utils/fatal'\n\n// Mapping of deprecated classes in TW v4 to their replacements\nexport const DEPRECATED_MAP: Record<string, string> = {\n 'flex-grow': 'grow',\n 'flex-grow-0': 'grow-0',\n 'flex-shrink': 'shrink',\n 'flex-shrink-0': 'shrink-0',\n 'overflow-ellipsis': 'text-ellipsis',\n 'decoration-slice': 'box-decoration-slice',\n 'decoration-clone': 'box-decoration-clone',\n 'bg-gradient-to-t': 'bg-linear-to-t',\n 'bg-gradient-to-tr': 'bg-linear-to-tr',\n 'bg-gradient-to-r': 'bg-linear-to-r',\n 'bg-gradient-to-br': 'bg-linear-to-br',\n 'bg-gradient-to-b': 'bg-linear-to-b',\n 'bg-gradient-to-bl': 'bg-linear-to-bl',\n 'bg-gradient-to-l': 'bg-linear-to-l',\n 'bg-gradient-to-tl': 'bg-linear-to-tl',\n}\n\nexport const noDeprecatedClasses = defineRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow deprecated Tailwind CSS v4 classes',\n },\n fixable: 'code',\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n },\n additionalProperties: false,\n },\n ],\n hasSuggestions: true,\n defaultOptions: [{}],\n messages: {\n deprecated: '\"{{className}}\" is deprecated in Tailwind v4. Use \"{{replacement}}\" instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n ...DS_UNAVAILABLE_MESSAGE,\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n if (locations.length === 0) return\n const dsResult = safeGetDS(getDS, context, locations[0].node)\n if (!dsResult) return\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const offending = split.classes.flatMap((cls) => {\n const { utility, variant } = splitUtilityAndVariant(cls)\n const { bare: bareUtility, position } = splitImportant(utility)\n const replacement = DEPRECATED_MAP[bareUtility]\n return replacement\n ? [{ cls, replacement: variant + reattachImportant(replacement, position) }]\n : []\n })\n reportClassReplacements(context, loc, split, split.classes, offending, {\n messageId: 'deprecated',\n })\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { findBestSuggestion } from '../utils/levenshtein'\nimport { splitImportant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\nimport { createLazyOptions } from '../utils/context'\nimport { DEPRECATED_MAP } from './no-deprecated-classes'\nimport { DS_UNAVAILABLE_MESSAGE, safeGetDS } from '../utils/fatal'\n\ninterface Options {\n entryPoint?: string\n allowlist?: string[]\n ignorePrefixes?: string[]\n}\n\nexport const noUnknownClasses = defineRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow classes that are not defined in the Tailwind CSS design system',\n },\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n allowlist: { type: 'array', items: { type: 'string' } },\n ignorePrefixes: {\n type: 'array',\n items: { type: 'string' },\n },\n },\n additionalProperties: false,\n },\n ],\n hasSuggestions: true,\n defaultOptions: [{ allowlist: [], ignorePrefixes: [] }],\n messages: {\n unknown: '\"{{className}}\" is not a valid Tailwind class.',\n unknownWithSuggestion:\n '\"{{className}}\" is not a valid Tailwind class. Did you mean \"{{suggestion}}\"?',\n missingPrefix:\n '\"{{className}}\" needs the \"{{prefix}}:\" prefix to produce CSS. Did you mean \"{{suggestion}}\"?',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n ...DS_UNAVAILABLE_MESSAGE,\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n const getLazyOptions = createLazyOptions<\n Options,\n { allowlist: Set<string>; ignorePrefixes: string[] }\n >(context, (o) => ({\n allowlist: new Set(o?.allowlist ?? []),\n ignorePrefixes: o?.ignorePrefixes ?? [],\n }))\n\n function shouldIgnore(className: string): boolean {\n const { allowlist, ignorePrefixes } = getLazyOptions()\n if (allowlist.has(className)) return true\n return ignorePrefixes.some((prefix) => className.startsWith(prefix))\n }\n\n function stripModifiers(className: string): string {\n return splitImportant(className).bare\n }\n\n function check(locations: ClassLocation[]) {\n if (locations.length === 0) return\n const ds = safeGetDS(getDS, context, locations[0].node)\n if (!ds) return\n const { cache } = ds\n\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const classes = split.classes\n\n for (const cls of classes) {\n if (shouldIgnore(cls)) continue\n\n const validity = cache.classValidity(cls)\n if (validity === 'valid') continue\n\n const stripped = stripModifiers(cls)\n // Don't report deprecated classes — no-deprecated-classes handles those\n if (DEPRECATED_MAP[stripped]) continue\n\n // A real Tailwind utility written without the required project prefix:\n // suggest the prefixed form rather than a Levenshtein neighbor.\n if (validity === 'missing-prefix') {\n const fixed = `${cache.prefix}:${cls}`\n const fixedValue = rebuildClassString(\n split,\n classes.map((c) => (c === cls ? fixed : c)),\n )\n context.report({\n node: loc.node,\n messageId: 'missingPrefix',\n data: { className: cls, prefix: cache.prefix, suggestion: fixed },\n suggest: [\n {\n messageId: 'suggestReplace',\n data: { className: cls, replacement: fixed },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixedValue))\n },\n },\n ],\n })\n continue\n }\n\n const suggestion = findBestSuggestion(stripped, cache.validClasses)\n\n if (suggestion) {\n const fixedValue = rebuildClassString(\n split,\n classes.map((c) => (c === cls ? suggestion : c)),\n )\n context.report({\n node: loc.node,\n messageId: 'unknownWithSuggestion',\n data: { className: cls, suggestion },\n suggest: [\n {\n messageId: 'suggestReplace',\n data: { className: cls, replacement: suggestion },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixedValue))\n },\n },\n ],\n })\n } else {\n context.report({\n node: loc.node,\n messageId: 'unknown',\n data: { className: cls },\n })\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","/**\n * Declarative spec for `no-conflicting-classes`.\n *\n * The rule's logic stays in `../no-conflicting-classes.ts`; this module holds\n * the data-only tables it consumes (plus a `reason` string for each entry).\n * The reason field is what the docs site renders in the rule's reference\n * page so users can see at a glance why a given combination composes.\n *\n * v1 extracted these tables out of the rule body so the docs build can\n * import them as plain data without pulling in oxlint's plugin runtime.\n */\n\nexport interface ComplementaryGroup {\n /**\n * Regex that matches utilities that may compose within the group. If the\n * regex has a capture group, two utilities match-compose ONLY when their\n * captured prefixes differ (e.g. `from-red-500` and `to-blue-500` compose,\n * but `from-red-500` and `from-blue-500` fall through to the overlap\n * check and end up flagged as conflicting). No capture group means \"any\n * pair that matches this regex composes\" (e.g. `prose prose-sm`).\n */\n pattern: RegExp\n /** Human-readable explanation rendered by the docs site. */\n reason: string\n}\n\nexport interface CompositionPair {\n /** Regex for one side of the pair. */\n a: RegExp\n /** Regex for the other side; orientation doesn't matter when matching. */\n b: RegExp\n /** Human-readable explanation rendered by the docs site. */\n reason: string\n}\n\nexport const COMPLEMENTARY_GROUPS: readonly ComplementaryGroup[] = [\n {\n pattern: /^(from|via|to)-/,\n reason:\n 'Gradient stops (`from-*`, `via-*`, `to-*`) share `--tw-gradient-stops`; different prefixes compose, same prefix conflicts.',\n },\n {\n pattern: /^(transition|duration|ease|delay)(?:-|$)/,\n reason:\n '`transition-*` composes with `duration-*`, `ease-*`, `delay-*` — `transition-all` itself has no `--tw-*` vars so the heuristic misses it.',\n },\n {\n pattern: /^-?(translate|scale|rotate|skew)-/,\n reason:\n 'Transform axes (translate / scale / rotate / skew) compose into a single `transform`; the overlap is not captured in `cssProps`.',\n },\n {\n pattern: /^-?mask-((?:linear|radial|conic|[trblxy])(?:-(?:from|via|to|at))?)(?:-|$)/,\n reason:\n 'Mask gradients: different families (e.g. `mask-linear-*` vs `mask-radial-*`) or roles (`from`/`via`/`to`/`at`) compose; same family+role conflicts.',\n },\n {\n pattern: /^prose(?:-|$)/,\n reason:\n '`prose` + `prose-sm`/`prose-lg`/`prose-xl` modify the same scope and are designed to compose.',\n },\n]\n\nexport const COMPOSITION_PAIRS: readonly CompositionPair[] = [\n {\n a: /^text-/,\n b: /^leading-/,\n reason: '`text-*` sets line-height via its size token; `leading-*` overrides it.',\n },\n {\n a: /^text-/,\n b: /^tracking-/,\n reason: '`text-*` may set letter-spacing via its size token; `tracking-*` overrides it.',\n },\n {\n a: /^border(?:-[0-9]|$)/,\n b: /^border-(?:solid|dashed|dotted|double|hidden|none)$/,\n reason: '`border-*` (width) composes with `border-{solid,dashed,…}` (style).',\n },\n {\n a: /^divide-/,\n b: /^border(?:-[trblxyse])?-/,\n reason: '`divide-*` styles direct children; `border-*` styles the element itself.',\n },\n {\n a: /^prose(?:-|$)/,\n b: /^max-w-/,\n reason: '`prose` sets a default max-width; `max-w-*` overrides it.',\n },\n {\n a: /^animate-in$/,\n b: /^(?:fade|spin|zoom|blur)-in(?:-|$)|^slide-in-from-/,\n reason:\n '`animate-in` initializes all `--tw-enter-*` vars; `*-in` modifiers each override one. (`tailwindcss-animate` / `tw-animate-css`.)',\n },\n {\n a: /^animate-out$/,\n b: /^(?:fade|spin|zoom|blur)-out(?:-|$)|^slide-out-to-/,\n reason:\n '`animate-out` initializes all `--tw-exit-*` vars; `*-out` modifiers each override one.',\n },\n {\n a: /^mask-(?:add|subtract|intersect|exclude)$/,\n b: /^-?mask-(?:linear|radial|conic|[trblxy])-/,\n reason:\n '`mask-{add,subtract,intersect,exclude}` are mask-composite modes that compose with mask-gradient utilities.',\n },\n]\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { extractUtility, getVariantPrefix, splitImportant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\nimport { DS_UNAVAILABLE_MESSAGE, safeGetDS } from '../utils/fatal'\nimport { COMPLEMENTARY_GROUPS, COMPOSITION_PAIRS } from './no-conflicting-classes/spec'\n\nexport { COMPLEMENTARY_GROUPS, COMPOSITION_PAIRS } from './no-conflicting-classes/spec'\n\n/**\n * Two utilities compose via CSS custom properties if both define their own\n * --tw-* properties that don't overlap — they each contribute to a shared\n * shorthand (e.g. `shadow` and `ring` both end up in `box-shadow` via\n * different intermediate vars).\n */\nexport function isCompositionViaCssVars(\n propsA: readonly string[],\n propsB: readonly string[],\n): boolean {\n const customA = propsA.filter((p) => p.startsWith('--'))\n const customB = propsB.filter((p) => p.startsWith('--'))\n if (customA.length === 0 || customB.length === 0) return false\n return !customA.some((p) => customB.includes(p))\n}\n\n/**\n * Detect a narrowing override: the later class's CSS properties are a strict\n * subset of the earlier class's, so the later class refines one of the\n * shorthand's properties (size-4 h-6, rounded-t-lg rounded-tl-sm, truncate\n * text-clip). Direction-sensitive: the inverse means the wider later class\n * clobbers a prior narrower override.\n */\nexport function isNarrowingOverride(\n propsEarlier: readonly string[],\n propsLater: readonly string[],\n): boolean {\n if (propsLater.length === 0 || propsLater.length >= propsEarlier.length) return false\n const setEarlier = new Set(propsEarlier)\n return propsLater.every((p) => setEarlier.has(p))\n}\n\n/**\n * Returns true if two classes (within the same variant) should NOT be reported\n * as conflicting despite sharing CSS properties. Pure: regex tables are passed\n * in (or default to the module-level constants).\n */\nexport function shouldSkipPair(\n a: string,\n b: string,\n propsA: readonly string[],\n propsB: readonly string[],\n rules: {\n complementaryGroups?: readonly RegExp[]\n compositionPairs?: readonly (readonly [RegExp, RegExp])[]\n } = {},\n): boolean {\n if (isCompositionViaCssVars(propsA, propsB)) return true\n // Narrowing override (shorthand → longhand on one of its props)\n if (isNarrowingOverride(propsA, propsB)) return true\n\n const ua = splitImportant(extractUtility(a)).bare\n const ub = splitImportant(extractUtility(b)).bare\n\n const groups: readonly { pattern: RegExp }[] =\n rules.complementaryGroups !== undefined\n ? rules.complementaryGroups.map((pattern) => ({ pattern }))\n : COMPLEMENTARY_GROUPS\n for (const { pattern: re } of groups) {\n const ma = ua.match(re)\n const mb = ub.match(re)\n if (!ma || !mb) continue\n // No capture group: always compose within group (e.g. prose)\n if (ma[1] === undefined) return true\n // Different prefix: compose; same prefix: fall through to overlap check\n if (ma[1] !== mb[1]) return true\n }\n\n const pairs: readonly { a: RegExp; b: RegExp }[] =\n rules.compositionPairs !== undefined\n ? rules.compositionPairs.map(([a, b]) => ({ a, b }))\n : COMPOSITION_PAIRS\n for (const { a: reA, b: reB } of pairs) {\n if ((reA.test(ua) && reB.test(ub)) || (reA.test(ub) && reB.test(ua))) return true\n }\n return false\n}\n\nexport const noConflictingClasses = defineRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow Tailwind CSS classes that generate conflicting CSS properties',\n },\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{}],\n messages: {\n conflict:\n '\"{{classA}}\" and \"{{classB}}\" affect {{properties}}. \"{{winner}}\" takes precedence (appears later).',\n ...DS_UNAVAILABLE_MESSAGE,\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n if (locations.length === 0) return\n const ds = safeGetDS(getDS, context, locations[0].node)\n if (!ds) return\n const { cache } = ds\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n if (classes.length < 2) continue\n\n // Group classes by variant prefix (bracket-aware)\n const byVariant = new Map<string, string[]>()\n for (const cls of classes) {\n const variant = getVariantPrefix(cls)\n const existing = byVariant.get(variant) ?? []\n existing.push(cls)\n byVariant.set(variant, existing)\n }\n\n for (const [, variantClasses] of byVariant) {\n if (variantClasses.length < 2) continue\n\n // For each pair of classes in the same variant, compare CSS properties\n const propsMap = new Map<string, string[]>()\n for (const cls of variantClasses) {\n const props = cache.getCssProperties(splitImportant(extractUtility(cls)).bare)\n propsMap.set(cls, props)\n }\n\n // Detect conflicts\n for (let i = 0; i < variantClasses.length; i++) {\n const classA = variantClasses[i]\n const propsA = propsMap.get(classA) ?? []\n\n for (let j = i + 1; j < variantClasses.length; j++) {\n const classB = variantClasses[j]\n const propsB = propsMap.get(classB) ?? []\n\n // Skip pairs that share CSS properties but target different elements/roles\n if (shouldSkipPair(classA, classB, propsA, propsB)) continue\n\n const overlap = propsA.filter((p) => propsB.includes(p))\n if (overlap.length > 0) {\n const propList =\n overlap.length <= 3\n ? `\"${overlap.join('\", \"')}\"`\n : `${overlap.length} CSS properties`\n\n context.report({\n node: loc.node,\n messageId: 'conflict',\n data: {\n classA,\n classB,\n properties: propList,\n winner: classB,\n },\n })\n }\n }\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","/**\n * Generic worker-thread service wrapping `__unstable__loadDesignSystem`.\n *\n * `sort-service.ts` and `canonicalize-service.ts` used to be near-byte-identical\n * (~500 LOC) — both spawned a worker that loaded the design system, then served\n * synchronous requests over a SharedArrayBuffer using `Atomics.wait`. The only\n * real difference was the body of the request loop: `getClassOrder` vs\n * `canonicalizeCandidates`. This class encapsulates the entire shared protocol\n * — SharedArrayBuffer layout, state machine, lifecycle, fail-loud — and each\n * service shrinks to ~40 LOC of singleton + public signature.\n *\n * v1: failures throw `SortServiceError`. The error is sticky for the lifetime\n * of the process (per cssPath) so subsequent calls don't pay another\n * init-timeout cost. Callers wrap via `safeGetDS` to surface the failure as a\n * single `designSystemUnavailable` diagnostic.\n */\n\nimport { Worker } from 'node:worker_threads'\nimport { SortServiceError } from '../utils/fatal'\nimport { TAILWIND_NODE_PATH } from './tailwind-node'\n\n// SharedArrayBuffer layout:\n// [0] Int32 — requestSignal (0=idle, 1=has_request)\n// [1] Int32 — responseSignal (0=idle, 1=has_response)\n// [2] Int32 — readySignal (0=loading, 1=ready, -1=error)\n// [3] Int32 — (reserved/padding)\n// [16..19] — Uint32 data length\n// [20..] — Uint8 data (JSON, shared for request & response)\n\nconst BUFFER_SIZE = 4 * 1024 * 1024 // 4 MB\nconst HEADER_INTS = 4\nconst DATA_OFFSET = HEADER_INTS * 4 + 4 // 20 bytes\nconst INIT_TIMEOUT = 60_000 // 60 s to load DS (raised in v1 to avoid spurious timeouts on slow CI)\nconst REQUEST_TIMEOUT = 30_000 // 30 s per request\n\ninterface ReadyState {\n worker: Worker\n controlArray: Int32Array\n lengthView: DataView\n dataArea: Uint8Array\n cssPath: string\n}\n\nexport interface DesignSystemWorkerOptions {\n /** JS source passed to `new Worker(..., { eval: true })`. */\n workerScript: string\n /** Human-readable name shown in error messages — `'sort'` or `'canonicalize'`. */\n serviceName: 'sort' | 'canonicalize'\n}\n\nexport class DesignSystemWorker<Req, Res> {\n private ready: ReadyState | null = null\n private lastError: SortServiceError | null = null\n\n constructor(private readonly opts: DesignSystemWorkerOptions) {}\n\n /**\n * Ensure the worker is running and pointed at `cssPath`. Returns the\n * ready state. Throws `SortServiceError` on any failure (init timeout,\n * spawn error, DS-load error). Sticky: subsequent calls for the same\n * cssPath rethrow without retrying.\n */\n private ensure(cssPath: string): ReadyState {\n if (this.lastError && this.ready?.cssPath === cssPath) throw this.lastError\n if (this.ready && this.ready.cssPath === cssPath) return this.ready\n\n if (this.ready) this.cleanup()\n this.lastError = null\n\n if (TAILWIND_NODE_PATH === null) {\n this.lastError = new SortServiceError(\n `Could not resolve '@tailwindcss/node' for the ${this.opts.serviceName} worker.`,\n \"Install '@tailwindcss/node' (or upgrade oxlint-tailwindcss) and re-run.\",\n )\n throw this.lastError\n }\n\n const sharedBuffer = new SharedArrayBuffer(BUFFER_SIZE)\n const controlArray = new Int32Array(sharedBuffer, 0, HEADER_INTS)\n const lengthView = new DataView(sharedBuffer, HEADER_INTS * 4, 4)\n const dataArea = new Uint8Array(sharedBuffer, DATA_OFFSET)\n\n let worker: Worker\n try {\n worker = new Worker(this.opts.workerScript, {\n eval: true,\n workerData: { sharedBuffer, cssPath, tailwindNodePath: TAILWIND_NODE_PATH },\n })\n } catch (cause) {\n this.lastError = new SortServiceError(\n `Failed to spawn ${this.opts.serviceName} worker for \"${cssPath}\".`,\n 'This is unexpected; please open an issue with the error details.',\n { cause: cause instanceof Error ? cause : undefined },\n )\n throw this.lastError\n }\n\n worker.unref()\n worker.on('error', (err: Error) => {\n this.lastError = new SortServiceError(\n `${this.opts.serviceName} worker died: ${err.message}`,\n 'The worker will not be restarted in this process. Restart the lint session.',\n { cause: err },\n )\n })\n\n // Wait for DS to load\n const result = Atomics.wait(controlArray, 2, 0, INIT_TIMEOUT)\n if (result === 'timed-out') {\n this.lastError = new SortServiceError(\n `${this.opts.serviceName} worker timed out loading the design system from \"${cssPath}\" after ${INIT_TIMEOUT}ms.`,\n 'Raise settings.tailwindcss.timeout if your machine is slow, or verify the CSS imports resolve.',\n )\n this.terminateWorker(worker)\n throw this.lastError\n }\n if (controlArray[2] === -1) {\n this.lastError = new SortServiceError(\n `${this.opts.serviceName} worker failed to load the design system from \"${cssPath}\".`,\n 'Verify @tailwindcss/node is installed and the CSS file (and its imports) is valid.',\n )\n this.terminateWorker(worker)\n throw this.lastError\n }\n\n this.ready = { worker, controlArray, lengthView, dataArea, cssPath }\n return this.ready\n }\n\n /**\n * Send a request to the worker and synchronously wait for the response.\n * Throws `SortServiceError` on any failure.\n */\n callSync(cssPath: string, req: Req): Res {\n const state = this.ensure(cssPath)\n\n const requestBytes = Buffer.from(JSON.stringify(req), 'utf-8')\n if (requestBytes.length > BUFFER_SIZE - DATA_OFFSET) {\n throw new SortServiceError(\n `${this.opts.serviceName} request payload is too large (${requestBytes.length} > ${BUFFER_SIZE - DATA_OFFSET} bytes).`,\n 'This is unexpected with typical class lists; please open an issue.',\n )\n }\n\n state.dataArea.set(requestBytes, 0)\n state.lengthView.setUint32(0, requestBytes.length)\n\n Atomics.store(state.controlArray, 0, 1)\n Atomics.notify(state.controlArray, 0)\n\n const result = Atomics.wait(state.controlArray, 1, 0, REQUEST_TIMEOUT)\n if (result === 'timed-out') {\n this.lastError = new SortServiceError(\n `${this.opts.serviceName} worker request timed out after ${REQUEST_TIMEOUT}ms.`,\n 'Raise settings.tailwindcss.timeout if your machine is slow.',\n )\n this.cleanup()\n throw this.lastError\n }\n\n const responseLen = state.lengthView.getUint32(0)\n const responseStr = Buffer.from(state.dataArea.slice(0, responseLen)).toString('utf-8')\n Atomics.store(state.controlArray, 1, 0)\n\n let parsed: unknown\n try {\n parsed = JSON.parse(responseStr)\n } catch (cause) {\n this.lastError = new SortServiceError(\n `${this.opts.serviceName} worker returned non-JSON response.`,\n 'This is a bug; please open an issue.',\n { cause: cause instanceof Error ? cause : undefined },\n )\n this.cleanup()\n throw this.lastError\n }\n\n if (parsed === null) {\n this.lastError = new SortServiceError(\n `${this.opts.serviceName} worker returned null — request body was rejected.`,\n 'This is a bug; please open an issue with the input that triggered it.',\n )\n this.cleanup()\n throw this.lastError\n }\n\n return parsed as Res\n }\n\n reset(): void {\n this.cleanup()\n this.lastError = null\n }\n\n private cleanup(): void {\n if (this.ready) {\n this.terminateWorker(this.ready.worker)\n this.ready = null\n }\n }\n\n private terminateWorker(worker: Worker): void {\n try {\n worker.terminate()\n } catch {\n // Already dead — nothing to do.\n }\n }\n}\n","/**\n * Persistent canonicalize service backed by `DesignSystemWorker`.\n *\n * Calls `ds.canonicalizeCandidates([cls], { rem })` one class at a time\n * (the design system deduplicates its input, so batching changes the\n * result shape — see sync-loader.ts). The shared protocol lives in\n * `./ds-worker.ts`.\n *\n * ## Per-class cache (process-wide)\n *\n * Results are cached by `${cssPath}\\0${rem}\\0${class}`. The worker is\n * invoked only for cache misses. In practice the cache converges quickly —\n * after the first few files any given class has been seen, and every\n * subsequent lookup is O(1).\n */\n\nimport { DesignSystemWorker } from './ds-worker'\nimport { SortServiceError } from '../utils/fatal'\n\ninterface CanonicalizeRequest {\n classes: string[]\n rem?: number\n}\n\nconst WORKER_SCRIPT = `\nconst { workerData } = require('worker_threads');\n\nasync function main() {\n const { sharedBuffer, cssPath } = workerData;\n const control = new Int32Array(sharedBuffer, 0, 4);\n const lengthView = new DataView(sharedBuffer, 4 * 4, 4);\n const dataArea = new Uint8Array(sharedBuffer, 4 * 4 + 4);\n\n let ds;\n try {\n const { __unstable__loadDesignSystem } = require(workerData.tailwindNodePath);\n const { readFileSync } = require('fs');\n const { dirname } = require('path');\n const css = readFileSync(cssPath, 'utf-8');\n ds = await __unstable__loadDesignSystem(css, { base: dirname(cssPath) });\n } catch {\n Atomics.store(control, 2, -1);\n Atomics.notify(control, 2);\n return;\n }\n\n Atomics.store(control, 2, 1);\n Atomics.notify(control, 2);\n\n while (true) {\n Atomics.wait(control, 0, 0);\n const len = lengthView.getUint32(0);\n const requestStr = Buffer.from(dataArea.slice(0, len)).toString('utf-8');\n Atomics.store(control, 0, 0);\n\n let response;\n try {\n const { classes, rem } = JSON.parse(requestStr);\n const options = rem ? { rem } : undefined;\n // canonicalizeCandidates deduplicates its input, so we must call it\n // one class at a time to preserve order/length. See sync-loader.ts.\n const result = classes.map((cls) => {\n const r = ds.canonicalizeCandidates([cls], options);\n return r[0] ?? cls;\n });\n response = Buffer.from(JSON.stringify(result), 'utf-8');\n } catch {\n response = Buffer.from('null', 'utf-8');\n }\n\n dataArea.set(response, 0);\n lengthView.setUint32(0, response.length);\n Atomics.store(control, 1, 1);\n Atomics.notify(control, 1);\n }\n}\nmain();\n`\n\nconst canonWorker = new DesignSystemWorker<CanonicalizeRequest, string[]>({\n workerScript: WORKER_SCRIPT,\n serviceName: 'canonicalize',\n})\n\n/**\n * Process-wide cache of canonicalized classes.\n * Key: `${cssPath}\\0${rem}\\0${className}` — isolates monorepos (multiple\n * DSs) and different rem settings. Value: canonicalized class string.\n */\nconst canonCache = new Map<string, string>()\n\n/**\n * Canonicalize classes via the worker thread.\n *\n * Throws `SortServiceError` on any worker failure (init timeout, request\n * timeout, worker crash). Callers should wrap via `safeGetDS` so the\n * failure surfaces as a single `designSystemUnavailable` diagnostic.\n *\n * Returns an array the same length and order as `classes`. Uses a\n * process-wide per-class cache: the worker is invoked only for classes\n * not already seen with this (cssPath, rem) combination.\n */\nexport function canonicalizeClassesSync(\n cssPath: string,\n classes: string[],\n rem?: number,\n): string[] {\n const out: string[] = Array.from({ length: classes.length })\n const missingIdx: number[] = []\n const missing: string[] = []\n const cachePrefix = `${cssPath}\\0${rem ?? ''}\\0`\n\n for (let i = 0; i < classes.length; i++) {\n const key = cachePrefix + classes[i]\n const hit = canonCache.get(key)\n if (hit !== undefined) {\n out[i] = hit\n } else {\n missingIdx.push(i)\n missing.push(classes[i])\n }\n }\n\n if (missing.length === 0) return out\n\n // Deduplicate the worker request: if a location repeats a class, we\n // don't need to canonicalize it twice. The per-class cache serves\n // repeats in subsequent calls; within a single call the cache is cold.\n const uniqueMissing = [...new Set(missing)]\n const fresh = canonWorker.callSync(cssPath, { classes: uniqueMissing, rem })\n if (fresh.length !== uniqueMissing.length) {\n throw new SortServiceError(\n `Canonicalize worker returned ${fresh.length} results for ${uniqueMissing.length} inputs.`,\n 'This is a bug; please open an issue.',\n )\n }\n\n const freshByClass = new Map<string, string>()\n for (let k = 0; k < uniqueMissing.length; k++) {\n freshByClass.set(uniqueMissing[k], fresh[k])\n }\n\n for (let j = 0; j < missing.length; j++) {\n const cls = missing[j]\n const value = freshByClass.get(cls) ?? cls\n canonCache.set(cachePrefix + cls, value)\n out[missingIdx[j]] = value\n }\n\n return out\n}\n\n/** Reset the canonicalize service (for tests). */\nexport function resetCanonicalizeService(): void {\n canonWorker.reset()\n canonCache.clear()\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClassesWithSeparators } from '../utils/class-splitter'\nimport { reportClassReplacements } from '../utils/report'\nimport {\n reattachImportant,\n splitImportant,\n splitUtilityAndVariant,\n utilityHasDynamicValue,\n} from '../utils/class-parser'\nimport { createLazyLoader, rootFontSizeFromSettings } from '../design-system/loader'\nimport { canonicalizeClassesSync } from '../design-system/canonicalize-service'\nimport { safeSettings } from '../utils/context'\nimport { DS_UNAVAILABLE_MESSAGE, safeGetDS } from '../utils/fatal'\n\n/**\n * Preserve the user's `!` position after canonicalization.\n *\n * `canonicalizeCandidates` normalizes `!` to suffix; this restores the\n * original prefix-or-suffix-or-none position so `enforce-consistent-important-position`\n * remains the single source of truth for ! placement policy.\n *\n * Bracket-aware via `splitUtilityAndVariant` — arbitrary variants like\n * `[&>svg]:!w-4` round-trip correctly.\n */\nfunction preserveImportantPosition(original: string, canonicalized: string): string {\n const { position } = splitImportant(splitUtilityAndVariant(original).utility)\n const { utility, variant } = splitUtilityAndVariant(canonicalized)\n const bare = splitImportant(utility).bare\n return variant + reattachImportant(bare, position)\n}\n\nexport const enforceCanonical = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Enforce canonical Tailwind CSS class names using canonicalizeCandidates()',\n },\n fixable: 'code',\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n },\n additionalProperties: false,\n },\n ],\n hasSuggestions: true,\n defaultOptions: [{}],\n messages: {\n nonCanonical: '\"{{className}}\" can be written as \"{{canonical}}\". Use the canonical form.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n ...DS_UNAVAILABLE_MESSAGE,\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n let _rem: number | null = null\n function getRem(): number {\n if (_rem === null) {\n const settings = safeSettings(context)\n _rem = rootFontSizeFromSettings(settings)\n }\n return _rem\n }\n\n function check(locations: ClassLocation[]) {\n if (locations.length === 0) return\n const ds = safeGetDS(getDS, context, locations[0].node)\n if (!ds) return\n const { cache, entryPoint } = ds\n\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const classes = split.classes\n\n // Split the location into two buckets:\n // - named classes → precomputed `canonicalMap` is ground truth,\n // resolved via `cache.canonicalize` (sync, sub-microsecond).\n // - classes with arbitrary/CSS-var values in the utility\n // (`p-[2px]`, `bg-(--c)`) → need the async DS to canonicalize,\n // routed through the worker.\n //\n // Keeping named classes out of the worker call avoids the round-trip\n // entirely for the majority of locations, and shrinks the payload for\n // the rest. The local cache preserves `!` position, so no\n // preserveImportantPosition step is needed on that path.\n const canonicals: string[] = Array.from({ length: classes.length })\n const arbitraryIdx: number[] = []\n const arbitrary: string[] = []\n\n for (let i = 0; i < classes.length; i++) {\n if (utilityHasDynamicValue(classes[i])) {\n arbitraryIdx.push(i)\n arbitrary.push(classes[i])\n } else {\n canonicals[i] = cache.canonicalize(classes[i])\n }\n }\n\n if (arbitrary.length > 0) {\n const rem = getRem()\n // Worker provides the authoritative canonicalization for arbitrary\n // values. Failures throw SortServiceError, surfaced as a fatal\n // diagnostic via safeGetDS — no heuristic fallback.\n const dynamic = safeGetDS(\n () => canonicalizeClassesSync(entryPoint, arbitrary, rem),\n context,\n loc.node,\n )\n if (!dynamic) return // worker fatal already reported; stop the check\n for (let k = 0; k < arbitrary.length; k++) {\n canonicals[arbitraryIdx[k]] = preserveImportantPosition(arbitrary[k], dynamic[k])\n }\n }\n\n const offending = classes.flatMap((cls, i) =>\n canonicals[i] === cls ? [] : [{ cls, replacement: canonicals[i] }],\n )\n reportClassReplacements(context, loc, split, classes, offending, {\n messageId: 'nonCanonical',\n replacementKey: 'canonical',\n })\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","/**\n * Persistent sort service backed by `DesignSystemWorker`.\n *\n * Calls `ds.getClassOrder(classes)` and returns the class names in the\n * Tailwind-canonical order. The shared protocol (SharedArrayBuffer,\n * Atomics.wait, fail-loud, sticky lastError) lives in `./ds-worker.ts`.\n */\n\nimport { DesignSystemWorker } from './ds-worker'\n\nconst WORKER_SCRIPT = `\nconst { workerData } = require('worker_threads');\n\nasync function main() {\n const { sharedBuffer, cssPath } = workerData;\n const control = new Int32Array(sharedBuffer, 0, 4);\n const lengthView = new DataView(sharedBuffer, 4 * 4, 4);\n const dataArea = new Uint8Array(sharedBuffer, 4 * 4 + 4);\n\n let ds;\n try {\n const { __unstable__loadDesignSystem } = require(workerData.tailwindNodePath);\n const { readFileSync } = require('fs');\n const { dirname } = require('path');\n const css = readFileSync(cssPath, 'utf-8');\n ds = await __unstable__loadDesignSystem(css, { base: dirname(cssPath) });\n } catch {\n Atomics.store(control, 2, -1);\n Atomics.notify(control, 2);\n return;\n }\n\n Atomics.store(control, 2, 1);\n Atomics.notify(control, 2);\n\n while (true) {\n Atomics.wait(control, 0, 0);\n const len = lengthView.getUint32(0);\n const requestStr = Buffer.from(dataArea.slice(0, len)).toString('utf-8');\n Atomics.store(control, 0, 0);\n\n let response;\n try {\n const classes = JSON.parse(requestStr);\n const ordered = ds.getClassOrder(classes);\n const sorted = [...ordered]\n .sort((a, b) => {\n if (a[1] === null && b[1] === null) return 0;\n if (a[1] === null) return -1;\n if (b[1] === null) return 1;\n return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0;\n })\n .map(([name]) => name);\n response = Buffer.from(JSON.stringify(sorted), 'utf-8');\n } catch {\n response = Buffer.from('null', 'utf-8');\n }\n\n dataArea.set(response, 0);\n lengthView.setUint32(0, response.length);\n Atomics.store(control, 1, 1);\n Atomics.notify(control, 1);\n }\n}\nmain();\n`\n\nconst sortWorker = new DesignSystemWorker<string[], string[]>({\n workerScript: WORKER_SCRIPT,\n serviceName: 'sort',\n})\n\n/**\n * Sort classes via worker thread using the official Tailwind class order.\n *\n * Throws `SortServiceError` on any failure (worker init timeout, request\n * timeout, worker crash, payload too large). Callers should wrap via\n * `safeGetDS` so the failure surfaces as a single `designSystemUnavailable`\n * diagnostic instead of crashing the lint.\n */\nexport function sortClassesSync(cssPath: string, classes: string[]): string[] {\n return sortWorker.callSync(cssPath, classes)\n}\n\n/** Reset the sort service (for tests). */\nexport function resetSortService(): void {\n sortWorker.reset()\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\nimport { sortClassesSync } from '../design-system/sort-service'\nimport { createLazyOptions } from '../utils/context'\nimport { DS_UNAVAILABLE_MESSAGE, safeGetDS } from '../utils/fatal'\n\ninterface Options {\n entryPoint?: string\n mode?: 'default' | 'strict'\n}\n\nexport const enforceSortOrder = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Enforce consistent sort order of Tailwind CSS classes using the official class order',\n },\n fixable: 'code',\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n mode: { type: 'string', enum: ['default', 'strict'] },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ mode: 'default' }],\n messages: {\n unsorted: 'Tailwind classes are not in the recommended order.',\n ...DS_UNAVAILABLE_MESSAGE,\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n const getMode = createLazyOptions<Options, 'default' | 'strict'>(\n context,\n (o) => o?.mode ?? 'default',\n )\n\n function check(locations: ClassLocation[]) {\n if (locations.length === 0) return\n const ds = safeGetDS(getDS, context, locations[0].node)\n if (!ds) return\n const { cache, entryPoint } = ds\n const mode = getMode()\n\n function sortDefault(classes: string[]): string[] {\n // Worker provides the exact official Tailwind sort order. Failures\n // throw SortServiceError, which the caller surfaces as a fatal\n // diagnostic via safeGetDS.\n return sortClassesSync(entryPoint, classes)\n }\n\n function sortStrict(classes: string[]): string[] {\n const groups = new Map<string, string[]>()\n const groupOrder: string[] = []\n for (const cls of classes) {\n const { variant } = splitUtilityAndVariant(cls)\n if (!groups.has(variant)) {\n groups.set(variant, [])\n groupOrder.push(variant)\n }\n groups.get(variant)!.push(cls)\n }\n\n for (const [, groupClasses] of groups) {\n const ordered = cache.getClassOrder(groupClasses)\n ordered.sort((a, b) => {\n if (a[1] === null && b[1] === null) return 0\n if (a[1] === null) return -1\n if (b[1] === null) return 1\n if (a[1] < b[1]) return -1\n if (a[1] > b[1]) return 1\n return 0\n })\n groupClasses.length = 0\n for (const [name] of ordered) groupClasses.push(name)\n }\n\n // Normalize the project prefix out of the group key so the base group\n // (`tw:` → '') sorts first and the first REAL variant drives ordering.\n // Without this every prefixed group collapses to first variant `tw`\n // (priority MAX) and the order between groups is unstable.\n const stripKey = (k: string): string =>\n cache.prefix && k.startsWith(cache.prefix + ':') ? k.slice(cache.prefix.length + 1) : k\n\n const sortedGroupKeys = [...groups.keys()].sort((ka, kb) => {\n const a = stripKey(ka)\n const b = stripKey(kb)\n if (a === '' && b !== '') return -1\n if (a !== '' && b === '') return 1\n if (a === '' && b === '') return 0\n\n // For compound variant keys like \"dark:hover:\", use the first variant for ordering\n const variantA = a.slice(0, -1)\n const variantB = b.slice(0, -1)\n const firstA = variantA.includes(':') ? variantA.split(':')[0] : variantA\n const firstB = variantB.includes(':') ? variantB.split(':')[0] : variantB\n const prioA = cache.getVariantPriority(firstA) ?? Number.MAX_SAFE_INTEGER\n const prioB = cache.getVariantPriority(firstB) ?? Number.MAX_SAFE_INTEGER\n return prioA - prioB\n })\n\n const result: string[] = []\n for (const key of sortedGroupKeys) {\n result.push(...groups.get(key)!)\n }\n return result\n }\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const classes = split.classes\n if (classes.length < 2) continue\n\n const sortedNames =\n mode === 'strict'\n ? sortStrict(classes)\n : safeGetDS(() => sortDefault(classes), context, loc.node)\n if (!sortedNames) return // worker fatal already reported; stop the check\n\n const isSorted = classes.every((name, i) => name === sortedNames[i])\n if (isSorted) continue\n\n context.report({\n node: loc.node,\n messageId: 'unsorted',\n fix(fixer) {\n return fixer.replaceTextRange(\n loc.range,\n preserveSpaces(loc, rebuildClassString(split, sortedNames)),\n )\n },\n })\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { splitImportant, splitUtilityAndVariant } from '../utils/class-parser'\n\nconst VALUE_RE =\n /^(?:m[trbl]|mx|my|p[trbl]|px|py|[wh]|rounded-t[lr]|rounded-b[lr]|min-[wh]|max-[wh])-(.+)$/\n\n// Values where w-X + h-X should NOT merge to size-X (different CSS units per axis)\nconst INVALID_SIZE_VALUES = new Set(['screen', 'dvw', 'dvh', 'svw', 'svh', 'lvw', 'lvh'])\n\ninterface ShorthandRule {\n parts: string[]\n replacement: string\n}\n\n/**\n * Generates shorthand rules parameterized by value.\n * E.g.: mt-2 + mr-2 + mb-2 + ml-2 -> m-2\n */\nfunction createShorthandRules(value: string): ShorthandRule[] {\n return [\n {\n parts: [`mt-${value}`, `mr-${value}`, `mb-${value}`, `ml-${value}`],\n replacement: `m-${value}`,\n },\n {\n parts: [`mt-${value}`, `mb-${value}`],\n replacement: `my-${value}`,\n },\n {\n parts: [`ml-${value}`, `mr-${value}`],\n replacement: `mx-${value}`,\n },\n {\n parts: [`mx-${value}`, `my-${value}`],\n replacement: `m-${value}`,\n },\n {\n parts: [`pt-${value}`, `pr-${value}`, `pb-${value}`, `pl-${value}`],\n replacement: `p-${value}`,\n },\n {\n parts: [`pt-${value}`, `pb-${value}`],\n replacement: `py-${value}`,\n },\n {\n parts: [`pl-${value}`, `pr-${value}`],\n replacement: `px-${value}`,\n },\n {\n parts: [`px-${value}`, `py-${value}`],\n replacement: `p-${value}`,\n },\n // w-* + h-* → size-* only when both produce the same CSS value\n // Exclude viewport units where w/h use different axes (vw vs vh)\n ...(!INVALID_SIZE_VALUES.has(value)\n ? [{ parts: [`w-${value}`, `h-${value}`], replacement: `size-${value}` }]\n : []),\n {\n parts: [\n `rounded-tl-${value}`,\n `rounded-tr-${value}`,\n `rounded-br-${value}`,\n `rounded-bl-${value}`,\n ],\n replacement: `rounded-${value}`,\n },\n ]\n}\n\nexport const enforceShorthand = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Enforce shorthand Tailwind CSS classes when all axes have the same value',\n },\n fixable: 'code',\n schema: [],\n messages: {\n shorthand: '{{parts}} can be simplified to \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const classes = split.classes\n if (classes.length < 2) continue\n\n const classSet = new Set(classes)\n\n // Extract unique (variant prefix, value) pairs — variants must match across parts.\n const variantValues = new Set<string>()\n for (const cls of classes) {\n const { utility, variant } = splitUtilityAndVariant(cls)\n const match = VALUE_RE.exec(splitImportant(utility).bare)\n if (match) variantValues.add(`${variant}\\0${match[1]}`)\n }\n\n for (const variantValue of variantValues) {\n const nul = variantValue.indexOf('\\0')\n const variant = variantValue.slice(0, nul)\n const value = variantValue.slice(nul + 1)\n const rules = createShorthandRules(value)\n\n for (const rule of rules) {\n const withVariant = (p: string) => `${variant}${p}`\n // Check with ! modifier: all parts must share the same modifier\n const hasImportantPrefix = rule.parts.every((p) => classSet.has(withVariant(`!${p}`)))\n const hasImportantSuffix =\n !hasImportantPrefix && rule.parts.every((p) => classSet.has(withVariant(`${p}!`)))\n const hasPlain = rule.parts.every((p) => classSet.has(withVariant(p)))\n\n if (!hasImportantPrefix && !hasImportantSuffix && !hasPlain) continue\n\n const importantStart = hasImportantPrefix ? '!' : ''\n const importantEnd = hasImportantSuffix ? '!' : ''\n const matchParts = rule.parts.map((p) =>\n withVariant(`${importantStart}${p}${importantEnd}`),\n )\n const remaining = classes.filter((c) => !matchParts.includes(c))\n remaining.push(withVariant(`${importantStart}${rule.replacement}${importantEnd}`))\n\n context.report({\n node: loc.node,\n messageId: 'shorthand',\n data: {\n parts: matchParts.map((p) => `\"${p}\"`).join(', '),\n replacement: withVariant(`${importantStart}${rule.replacement}${importantEnd}`),\n },\n fix(fixer) {\n return fixer.replaceTextRange(\n loc.range,\n preserveSpaces(loc, rebuildClassString(split, remaining)),\n )\n },\n })\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","/**\n * Shared regex-allowlist helpers used by rules that accept an `allowlist`\n * option of regex source strings (currently enforce-logical / enforce-physical).\n *\n * Invalid regex sources are skipped rather than thrown so a typo in one\n * pattern doesn't blow up the entire lint run.\n */\n\nexport function compileRegexList(patterns?: string[]): RegExp[] {\n if (!patterns || patterns.length === 0) return []\n const compiled: RegExp[] = []\n for (const p of patterns) {\n try {\n compiled.push(new RegExp(p))\n } catch {\n // Skip invalid regex sources rather than blowing up the lint.\n }\n }\n return compiled\n}\n\nexport function matchesAny(value: string, list: readonly RegExp[]): boolean {\n return list.some((re) => re.test(value))\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClassesWithSeparators } from '../utils/class-splitter'\nimport { reportClassReplacements } from '../utils/report'\nimport { reattachImportant, splitImportant, splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyOptions } from '../utils/context'\nimport { compileRegexList, matchesAny } from '../utils/allowlist'\n\nexport type Direction = 'inline' | 'block' | 'both'\n\n/**\n * Shared `{ allowlist, direction }` shape consumed by both enforce-logical and\n * enforce-physical. Co-located here so a future option addition lands in one\n * place.\n */\nexport interface LogicalPhysicalOptions {\n allowlist?: string[]\n direction?: Direction\n}\n\nexport const LOGICAL_PHYSICAL_SCHEMA = {\n type: 'object',\n properties: {\n allowlist: { type: 'array', items: { type: 'string' } },\n direction: { type: 'string', enum: ['inline', 'block', 'both'] },\n },\n additionalProperties: false,\n} as const\n\n/**\n * A directional mapping entry: replace `from` with `to` along `axis`. Used by\n * both enforce-logical (physical → logical) and enforce-physical (logical →\n * physical, just the inverted table).\n *\n * The `axis` tag lets the rule's `direction` option filter — today every entry\n * is `'inline'` because Tailwind has no block-axis logical-vs-physical pair,\n * but the shape is in place for when it does.\n */\nexport interface AxisMapping {\n from: string\n to: string\n axis: 'inline' | 'block'\n}\n\nexport const PHYSICAL_TO_LOGICAL_MAPPINGS: AxisMapping[] = [\n { from: 'ml', to: 'ms', axis: 'inline' },\n { from: 'mr', to: 'me', axis: 'inline' },\n { from: 'pl', to: 'ps', axis: 'inline' },\n { from: 'pr', to: 'pe', axis: 'inline' },\n { from: 'left', to: 'start', axis: 'inline' },\n { from: 'right', to: 'end', axis: 'inline' },\n { from: 'border-l', to: 'border-s', axis: 'inline' },\n { from: 'border-r', to: 'border-e', axis: 'inline' },\n { from: 'rounded-l', to: 'rounded-s', axis: 'inline' },\n { from: 'rounded-r', to: 'rounded-e', axis: 'inline' },\n { from: 'rounded-tl', to: 'rounded-ss', axis: 'inline' },\n { from: 'rounded-tr', to: 'rounded-se', axis: 'inline' },\n { from: 'rounded-bl', to: 'rounded-es', axis: 'inline' },\n { from: 'rounded-br', to: 'rounded-ee', axis: 'inline' },\n { from: 'scroll-ml', to: 'scroll-ms', axis: 'inline' },\n { from: 'scroll-mr', to: 'scroll-me', axis: 'inline' },\n { from: 'scroll-pl', to: 'scroll-ps', axis: 'inline' },\n { from: 'scroll-pr', to: 'scroll-pe', axis: 'inline' },\n]\n\n/** Invert a directional table. enforce-physical consumes this. */\nexport function invertAxisMappings(mappings: AxisMapping[]): AxisMapping[] {\n return mappings.map((m) => ({ from: m.to, to: m.from, axis: m.axis }))\n}\n\n/**\n * Flat `physical → logical` lookup. Kept exported so the test matrices in\n * `tests/rules/enforce-{logical,physical}.test.ts` can iterate the table\n * without depending on the richer `AxisMapping` shape.\n */\nexport const PHYSICAL_TO_LOGICAL: Record<string, string> = Object.fromEntries(\n PHYSICAL_TO_LOGICAL_MAPPINGS.map((m) => [m.from, m.to]),\n)\n\n/**\n * Build the `check` callback for a directional-rewrite rule. Both\n * enforce-logical and enforce-physical instantiate this with their own\n * mapping table and messageId; the rule's `createOnce` wires it through\n * `createExtractorVisitors`.\n *\n * Owns: option compilation (allowlist + direction), per-class conversion\n * (linear scan of the mapping table respecting `!`-prefix/suffix), and\n * the `reportClassReplacements` dispatch.\n */\nexport function createDirectionalMapper(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n context: any,\n opts: { mappings: AxisMapping[]; messageId: string },\n): { check: (locations: ClassLocation[]) => void } {\n const getState = createLazyOptions<\n LogicalPhysicalOptions,\n { allowlist: RegExp[]; direction: Direction }\n >(context, (o) => ({\n allowlist: compileRegexList(o?.allowlist),\n direction: o?.direction ?? 'both',\n }))\n\n function convertClass(cls: string): string | null {\n const { allowlist, direction } = getState()\n if (matchesAny(cls, allowlist)) return null\n\n const { utility, variant } = splitUtilityAndVariant(cls)\n const { bare: bareUtility, position } = splitImportant(utility)\n\n for (const { from, to, axis } of opts.mappings) {\n if (direction !== 'both' && direction !== axis) continue\n if (bareUtility === from || bareUtility.startsWith(`${from}-`)) {\n const suffix = bareUtility.slice(from.length)\n return `${variant}${reattachImportant(to + suffix, position)}`\n }\n }\n return null\n }\n\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const offending = split.classes.flatMap((cls) => {\n const converted = convertClass(cls)\n return converted ? [{ cls, replacement: converted }] : []\n })\n reportClassReplacements(context, loc, split, split.classes, offending, {\n messageId: opts.messageId,\n })\n }\n }\n\n return { check }\n}\n\nexport const enforceLogical = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Enforce logical (RTL-friendly) Tailwind CSS properties instead of physical ones',\n },\n fixable: 'code',\n schema: [LOGICAL_PHYSICAL_SCHEMA],\n hasSuggestions: true,\n defaultOptions: [{ allowlist: [], direction: 'both' }],\n messages: {\n useLogical:\n '\"{{className}}\" uses a physical property. Use \"{{replacement}}\" for LTR/RTL support.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const { check } = createDirectionalMapper(context, {\n mappings: PHYSICAL_TO_LOGICAL_MAPPINGS,\n messageId: 'useLogical',\n })\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors } from '../utils/extractors'\nimport {\n LOGICAL_PHYSICAL_SCHEMA,\n PHYSICAL_TO_LOGICAL_MAPPINGS,\n createDirectionalMapper,\n invertAxisMappings,\n} from './enforce-logical'\n\nexport const enforcePhysical = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Enforce physical Tailwind CSS properties instead of logical ones for consistency in LTR-only projects',\n },\n fixable: 'code',\n schema: [LOGICAL_PHYSICAL_SCHEMA],\n hasSuggestions: true,\n defaultOptions: [{ allowlist: [], direction: 'both' }],\n messages: {\n usePhysical:\n '\"{{className}}\" uses a logical property. Use \"{{replacement}}\" for consistency.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const { check } = createDirectionalMapper(context, {\n mappings: invertAxisMappings(PHYSICAL_TO_LOGICAL_MAPPINGS),\n messageId: 'usePhysical',\n })\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { createLazyOptions } from '../utils/context'\n\ninterface Options {\n max?: number\n}\n\nconst DEFAULT_MAX = 20\n\nexport const maxClassCount = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Enforce a maximum number of Tailwind CSS classes per element',\n },\n schema: [\n {\n type: 'object',\n properties: {\n max: { type: 'number' },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ max: DEFAULT_MAX }],\n messages: {\n tooMany:\n 'Too many Tailwind classes ({{count}}). Maximum allowed is {{max}}. Consider extracting into a component or utility.',\n },\n },\n createOnce(context) {\n const getMax = createLazyOptions<Options, number>(context, (o) => o?.max ?? DEFAULT_MAX)\n\n function check(locations: ClassLocation[]) {\n const max = getMax()\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n if (classes.length > max) {\n context.report({\n node: loc.node,\n messageId: 'tooMany',\n data: { count: String(classes.length), max: String(max) },\n })\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { createLazyOptions } from '../utils/context'\n\ninterface PatternConfig {\n pattern: string\n message?: string\n}\n\ninterface Options {\n classes?: string[]\n patterns?: PatternConfig[]\n}\n\nexport const noRestrictedClasses = defineRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Disallow specific Tailwind CSS classes',\n },\n schema: [\n {\n type: 'object',\n properties: {\n classes: { type: 'array', items: { type: 'string' } },\n patterns: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n pattern: { type: 'string' },\n message: { type: 'string' },\n },\n required: ['pattern'],\n additionalProperties: false,\n },\n },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ classes: [], patterns: [] }],\n messages: {\n restricted: '\"{{className}}\" is restricted.',\n restrictedWithMessage: '\"{{className}}\" is restricted: {{message}}',\n },\n },\n createOnce(context) {\n const getConfig = createLazyOptions<\n Options,\n { restrictedClasses: Set<string>; patterns: Array<{ regex: RegExp; message?: string }> }\n >(context, (o) => ({\n restrictedClasses: new Set(o?.classes ?? []),\n patterns: (o?.patterns ?? []).map((p) => ({\n regex: new RegExp(p.pattern),\n message: p.message,\n })),\n }))\n\n function check(locations: ClassLocation[]) {\n const { restrictedClasses, patterns } = getConfig()\n // No restrictions configured — nothing to do\n if (restrictedClasses.size === 0 && patterns.length === 0) return\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n\n for (const cls of classes) {\n // Check exact matches\n if (restrictedClasses.has(cls)) {\n context.report({\n node: loc.node,\n messageId: 'restricted',\n data: { className: cls },\n })\n continue\n }\n\n // Check patterns\n for (const { regex, message } of patterns) {\n if (regex.test(cls)) {\n if (message) {\n context.report({\n node: loc.node,\n messageId: 'restrictedWithMessage',\n data: { className: cls, message },\n })\n } else {\n context.report({\n node: loc.node,\n messageId: 'restricted',\n data: { className: cls },\n })\n }\n break\n }\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { hasArbitraryValue, extractUtility, splitImportant } from '../utils/class-parser'\nimport { createLazyOptions } from '../utils/context'\n\ninterface Options {\n allow?: string[]\n}\n\nexport const noArbitraryValue = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow arbitrary values in Tailwind CSS classes',\n },\n schema: [\n {\n type: 'object',\n properties: {\n allow: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ allow: [] }],\n messages: {\n noArbitrary:\n '\"{{className}}\" uses an arbitrary value. Use a design token or extend your theme instead.',\n },\n },\n createOnce(context) {\n const getAllowPrefixes = createLazyOptions<Options, string[]>(context, (o) => o?.allow ?? [])\n\n function isAllowed(utility: string): boolean {\n return getAllowPrefixes().some((prefix) => utility.startsWith(prefix))\n }\n\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n\n for (const cls of classes) {\n if (!hasArbitraryValue(cls)) continue\n\n const utility = splitImportant(extractUtility(cls)).bare\n if (isAllowed(utility)) continue\n\n context.report({\n node: loc.node,\n messageId: 'noArbitrary',\n data: { className: cls },\n })\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClassesWithSeparators } from '../utils/class-splitter'\nimport { reportClassReplacements } from '../utils/report'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyOptions } from '../utils/context'\n\ninterface Options {\n position?: 'prefix' | 'suffix'\n}\n\nexport const enforceConsistentImportantPosition = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Enforce consistent position of the important (!) modifier. Default: suffix (Tailwind v4 canonical form). Note: using \"prefix\" may conflict with enforce-canonical which normalizes to suffix.',\n },\n fixable: 'code',\n schema: [\n {\n type: 'object',\n properties: {\n position: { type: 'string', enum: ['prefix', 'suffix'] },\n },\n additionalProperties: false,\n },\n ],\n hasSuggestions: true,\n defaultOptions: [{ position: 'suffix' }],\n messages: {\n usePrefix: '\"{{className}}\" uses suffix important. Use \"{{replacement}}\" (prefix) instead.',\n useSuffix: '\"{{className}}\" uses prefix important. Use \"{{replacement}}\" (suffix) instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getPosition = createLazyOptions<Options, 'prefix' | 'suffix'>(\n context,\n (o) => o?.position ?? 'suffix',\n )\n\n function fixUtility(utility: string, variantPfx: string): string | null {\n const position = getPosition()\n if (position === 'prefix' && utility.endsWith('!') && !utility.startsWith('!')) {\n return `${variantPfx}!${utility.slice(0, -1)}`\n }\n if (position === 'suffix' && utility.startsWith('!') && !utility.endsWith('!')) {\n return `${variantPfx}${utility.slice(1)}!`\n }\n return null\n }\n\n function check(locations: ClassLocation[]) {\n const position = getPosition()\n const messageId = position === 'prefix' ? 'usePrefix' : 'useSuffix'\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const offending = split.classes.flatMap((cls) => {\n const { utility, variant } = splitUtilityAndVariant(cls)\n const fixed = fixUtility(utility, variant)\n return fixed ? [{ cls, replacement: fixed }] : []\n })\n reportClassReplacements(context, loc, split, split.classes, offending, { messageId })\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClassesWithSeparators } from '../utils/class-splitter'\nimport { reportClassReplacements } from '../utils/report'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\n\nfunction fixClass(cls: string): string | null {\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for analysis — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bare = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n if (!bare.startsWith('-')) return null\n\n const bracketOpen = bare.indexOf('[')\n if (bracketOpen === -1) return null\n\n const bracketClose = bare.lastIndexOf(']')\n if (bracketClose === -1 || bracketClose < bracketOpen) return null\n\n const innerValue = bare.slice(bracketOpen + 1, bracketClose)\n if (innerValue.startsWith('-')) return null\n\n const baseUtility = bare.slice(1, bracketOpen)\n return `${variant}${hasImportantPrefix ? '!' : ''}${baseUtility}[-${innerValue}]${hasImportantSuffix ? '!' : ''}`\n}\n\n/**\n * Detects `-utility-[value]` and suggests `utility-[-value]`.\n * e.g. `-top-[5px]` → `top-[-5px]`\n */\nexport const enforceNegativeArbitraryValues = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Enforce moving the negative sign inside arbitrary value brackets: -top-[5px] → top-[-5px]',\n },\n fixable: 'code',\n schema: [],\n hasSuggestions: true,\n messages: {\n moveNegative:\n '\"{{className}}\" has the negative outside brackets. Use \"{{replacement}}\" instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const offending = split.classes.flatMap((cls) => {\n const fixed = fixClass(cls)\n return fixed ? [{ cls, replacement: fixed }] : []\n })\n reportClassReplacements(context, loc, split, split.classes, offending, {\n messageId: 'moveNegative',\n })\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClassesWithSeparators } from '../utils/class-splitter'\nimport { reportClassReplacements } from '../utils/report'\nimport { reattachImportant, splitImportant, splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyOptions } from '../utils/context'\n\ninterface Options {\n syntax?: 'shorthand' | 'explicit'\n}\n\n// Match bg-[var(--something)] — simple var() wrapping a single CSS variable\nconst EXPLICIT_VAR_RE = /^([a-z][a-z0-9-]*(?:-[a-z0-9]+)*)-\\[var\\((--[a-zA-Z0-9-]+)\\)\\]$/\n// Match bg-(--something) — shorthand v4 syntax\nconst SHORTHAND_VAR_RE = /^([a-z][a-z0-9-]*(?:-[a-z0-9]+)*)-\\((--[a-zA-Z0-9-]+)\\)$/\n\nfunction convertClass(cls: string, syntax: 'shorthand' | 'explicit'): string | null {\n const { utility, variant } = splitUtilityAndVariant(cls)\n const { bare: bareUtility, position } = splitImportant(utility)\n\n if (syntax === 'shorthand') {\n const match = EXPLICIT_VAR_RE.exec(bareUtility)\n if (match) {\n const [, prefix, varName] = match\n return `${variant}${reattachImportant(`${prefix}-(${varName})`, position)}`\n }\n } else {\n const match = SHORTHAND_VAR_RE.exec(bareUtility)\n if (match) {\n const [, prefix, varName] = match\n return `${variant}${reattachImportant(`${prefix}-[var(${varName})]`, position)}`\n }\n }\n return null\n}\n\nexport const enforceConsistentVariableSyntax = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Enforce consistent CSS variable syntax: bg-[var(--color)] ↔ bg-(--color)',\n },\n fixable: 'code',\n schema: [\n {\n type: 'object',\n properties: {\n syntax: { type: 'string', enum: ['shorthand', 'explicit'] },\n },\n additionalProperties: false,\n },\n ],\n hasSuggestions: true,\n defaultOptions: [{ syntax: 'shorthand' }],\n messages: {\n useShorthand:\n '\"{{className}}\" uses explicit var() syntax. Use \"{{replacement}}\" (shorthand) instead.',\n useExplicit:\n '\"{{className}}\" uses shorthand syntax. Use \"{{replacement}}\" (explicit) instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getSyntax = createLazyOptions<Options, 'shorthand' | 'explicit'>(\n context,\n (o) => o?.syntax ?? 'shorthand',\n )\n\n function check(locations: ClassLocation[]) {\n const syntax = getSyntax()\n const messageId = syntax === 'shorthand' ? 'useShorthand' : 'useExplicit'\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const offending = split.classes.flatMap((cls) => {\n const converted = convertClass(cls, syntax)\n return converted ? [{ cls, replacement: converted }] : []\n })\n reportClassReplacements(context, loc, split, split.classes, offending, { messageId })\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { extractVariants, extractUtility, splitImportant } from '../utils/class-parser'\nimport { createLazyOptions } from '../utils/context'\n\ninterface Options {\n variants?: string[]\n}\n\nconst DEFAULT_VARIANTS = ['dark']\n\n// Multi-part prefixes, sorted longest-first so longer matches take priority\nconst KNOWN_PREFIXES = [\n 'rounded-tl',\n 'rounded-tr',\n 'rounded-bl',\n 'rounded-br',\n 'rounded-ss',\n 'rounded-se',\n 'rounded-es',\n 'rounded-ee',\n 'ring-offset',\n 'border-t',\n 'border-b',\n 'border-l',\n 'border-r',\n 'border-s',\n 'border-e',\n 'border-x',\n 'border-y',\n 'rounded-t',\n 'rounded-b',\n 'rounded-l',\n 'rounded-r',\n 'rounded-s',\n 'rounded-e',\n 'divide-x',\n 'divide-y',\n 'scroll-m',\n 'scroll-p',\n 'from',\n 'via',\n 'to',\n]\n\n/**\n * Extracts the utility prefix (e.g. \"bg\" from \"bg-gray-900\", \"text\" from \"text-white\").\n * Used to group utilities by their property type.\n */\nfunction getUtilityPrefix(utility: string): string {\n let u = splitImportant(utility).bare\n if (u.startsWith('-')) u = u.slice(1)\n\n for (const prefix of KNOWN_PREFIXES) {\n if (u === prefix || u.startsWith(`${prefix}-`)) return prefix\n }\n\n const dashIdx = u.indexOf('-')\n return dashIdx >= 0 ? u.slice(0, dashIdx) : u\n}\n\nexport const noDarkWithoutLight = defineRule({\n meta: {\n type: 'problem',\n docs: {\n description: 'Require a base (light) utility when using dark: (or other scheme) variant',\n },\n schema: [\n {\n type: 'object',\n properties: {\n variants: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ variants: DEFAULT_VARIANTS }],\n messages: {\n missingBase:\n '\"{{className}}\" uses the {{variant}} variant, but there is no base \"{{prefix}}-*\" class on this element.',\n },\n },\n createOnce(context) {\n const getWatchedVariants = createLazyOptions<Options, Set<string>>(\n context,\n (o) => new Set(o?.variants ?? DEFAULT_VARIANTS),\n )\n\n function check(locations: ClassLocation[]) {\n const watchedVariants = getWatchedVariants()\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n\n // Collect utility prefixes that have a base (no watched variant)\n const basePrefixes = new Set<string>()\n // Collect classes that have a watched variant\n const variantClasses: Array<{ cls: string; variant: string; prefix: string }> = []\n\n for (const cls of classes) {\n const variants = extractVariants(cls)\n const utility = extractUtility(cls)\n const prefix = getUtilityPrefix(utility)\n\n const hasWatchedVariant = variants.some((v) => watchedVariants.has(v))\n\n if (hasWatchedVariant) {\n const variant = variants.find((v) => watchedVariants.has(v))!\n variantClasses.push({ cls, variant, prefix })\n } else {\n basePrefixes.add(prefix)\n }\n }\n\n // Report variant classes that don't have a matching base\n for (const { cls, variant, prefix } of variantClasses) {\n if (!basePrefixes.has(prefix)) {\n context.report({\n node: loc.node,\n messageId: 'missingBase',\n data: { className: cls, variant, prefix },\n })\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport {\n hasArbitraryValue,\n getArbitraryValue,\n extractUtility,\n splitImportant,\n} from '../utils/class-parser'\nimport { createLazyOptions } from '../utils/context'\n\ninterface Options {\n entryPoint?: string\n allow?: string[]\n}\n\n// Color-related utility prefixes\nconst COLOR_UTILITY_PREFIXES = [\n 'bg',\n 'text',\n 'border',\n 'border-t',\n 'border-b',\n 'border-l',\n 'border-r',\n 'border-s',\n 'border-e',\n 'border-x',\n 'border-y',\n 'outline',\n 'ring',\n 'ring-offset',\n 'shadow',\n 'accent',\n 'caret',\n 'fill',\n 'stroke',\n 'decoration',\n 'divide',\n 'placeholder',\n 'from',\n 'via',\n 'to',\n]\n\n// Patterns that match hardcoded color values\nconst HEX_RE = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/\nconst RGB_RE = /^rgba?\\s*\\(/\nconst HSL_RE = /^hsla?\\s*\\(/\nconst OKLCH_RE = /^oklch\\s*\\(/\nconst OKLAB_RE = /^oklab\\s*\\(/\nconst LCH_RE = /^lch\\s*\\(/\nconst LAB_RE = /^lab\\s*\\(/\nconst HWB_RE = /^hwb\\s*\\(/\nconst COLOR_RE = /^color\\s*\\(/\nconst VAR_REF_RE = /var\\(\\s*--[\\w-]+/i\n\nfunction isHardcodedColor(value: string): boolean {\n const trimmed = value.trim()\n // Skip values referencing CSS variables (e.g. hsl(var(--x)), oklch(var(--x))).\n if (VAR_REF_RE.test(trimmed)) return false\n return (\n HEX_RE.test(trimmed) ||\n RGB_RE.test(trimmed) ||\n HSL_RE.test(trimmed) ||\n OKLCH_RE.test(trimmed) ||\n OKLAB_RE.test(trimmed) ||\n LCH_RE.test(trimmed) ||\n LAB_RE.test(trimmed) ||\n HWB_RE.test(trimmed) ||\n COLOR_RE.test(trimmed)\n )\n}\n\nfunction isColorUtility(utility: string): boolean {\n for (const prefix of COLOR_UTILITY_PREFIXES) {\n if (utility === prefix || utility.startsWith(`${prefix}-`)) return true\n }\n return false\n}\n\nexport const noHardcodedColors = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow hardcoded color values in Tailwind CSS classes',\n },\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n allow: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ allow: [] }],\n messages: {\n noHardcoded:\n '\"{{className}}\" uses a hardcoded color value. Use a design token from your theme instead.',\n },\n },\n createOnce(context) {\n const getAllowlist = createLazyOptions<Options, Set<string>>(\n context,\n (o) => new Set(o?.allow ?? []),\n )\n\n function check(locations: ClassLocation[]) {\n const allowlist = getAllowlist()\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n\n for (const cls of classes) {\n if (allowlist.has(cls)) continue\n if (!hasArbitraryValue(cls)) continue\n\n const utility = splitImportant(extractUtility(cls)).bare\n if (!isColorUtility(utility)) continue\n\n const value = getArbitraryValue(cls)\n if (!value) continue\n\n if (isHardcodedColor(value)) {\n context.report({\n node: loc.node,\n messageId: 'noHardcoded',\n data: { className: cls },\n })\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { extractVariants, extractUtility } from '../utils/class-parser'\n\n// Variants that change the selector target (pseudo-elements, children, descendants)\n// These are NOT conditions on the same element, so they can't contradict a base class.\nconst TARGET_CHANGING_VARIANTS = new Set([\n 'after',\n 'before',\n 'file',\n 'placeholder',\n 'marker',\n 'backdrop',\n 'selection',\n 'first-line',\n 'first-letter',\n])\n\nfunction changesTarget(variant: string): boolean {\n // Pseudo-element variants\n if (TARGET_CHANGING_VARIANTS.has(variant)) return true\n // Child (*:) and descendant (**:) selectors\n if (variant === '*' || variant === '**') return true\n // Arbitrary selectors: [&>svg], [&_div], etc.\n if (variant.startsWith('[') && variant.endsWith(']')) return true\n // Compound child selectors: *:data-[slot=...], etc.\n if (variant.startsWith('*:')) return true\n return false\n}\n\nexport const noContradictingVariants = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Disallow variant-prefixed classes that are redundant because the base class already applies unconditionally',\n },\n schema: [],\n messages: {\n redundantVariant:\n '\"{{variantClass}}\" is redundant because \"{{baseClass}}\" already applies unconditionally.',\n },\n },\n createOnce(context) {\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n\n // Collect base classes (no variants) — store their full utility string\n const baseUtilities = new Set<string>()\n for (const cls of classes) {\n const variants = extractVariants(cls)\n if (variants.length === 0) {\n baseUtilities.add(cls)\n }\n }\n\n // Check variant classes against base classes\n for (const cls of classes) {\n const variants = extractVariants(cls)\n if (variants.length === 0) continue\n\n // Skip if any variant changes the selector target\n if (variants.some(changesTarget)) continue\n\n const utility = extractUtility(cls)\n // Only report if the exact same utility exists as a base class\n if (baseUtilities.has(utility)) {\n context.report({\n node: loc.node,\n messageId: 'redundantVariant',\n data: { variantClass: cls, baseClass: utility },\n })\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { extractVariants, extractUtility } from '../utils/class-parser'\nimport { createLazyOptions } from '../utils/context'\nimport { createLazyLoader } from '../design-system/loader'\nimport type { DesignSystemCache } from '../design-system/cache'\nimport { isFatalError } from '../utils/fatal'\n\ninterface Options {\n entryPoint?: string\n order?: string[]\n}\n\n// Pseudo-element variants — must always be innermost (closest to the utility).\n// In Tailwind v4 variants apply left-to-right, so pseudo-elements placed before\n// element-selecting variants (arbitrary selectors, has-[], aria-*, etc.) produce\n// broken CSS (e.g. `&::before { &>svg { ... } }` — pseudo-elements have no children).\nconst PSEUDO_ELEMENTS = new Set([\n 'before',\n 'after',\n 'file',\n 'placeholder',\n 'selection',\n 'marker',\n 'backdrop',\n 'first-line',\n 'first-letter',\n 'details-content',\n])\n\n// Default variant ordering: responsive → features → color scheme → container →\n// group/peer → interactive states → form states → content → pseudo elements\nconst DEFAULT_VARIANT_ORDER = [\n // Child/descendant selectors (Tailwind v4)\n '*',\n '**',\n // Responsive\n 'sm',\n 'md',\n 'lg',\n 'xl',\n '2xl',\n // Feature queries\n 'supports',\n 'motion-safe',\n 'motion-reduce',\n 'contrast-more',\n 'contrast-less',\n 'forced-colors',\n // Prefers color scheme\n 'dark',\n 'light',\n // Container queries\n '@sm',\n '@md',\n '@lg',\n '@xl',\n '@2xl',\n // Print\n 'print',\n // Group & peer\n 'group-hover',\n 'group-focus',\n 'group-active',\n 'group-first',\n 'group-last',\n 'peer-hover',\n 'peer-focus',\n 'peer-checked',\n 'peer-invalid',\n 'peer-disabled',\n // Interactive states (LVHFA order)\n 'hover',\n 'focus',\n 'focus-within',\n 'focus-visible',\n 'active',\n // Form states\n 'enabled',\n 'disabled',\n 'checked',\n 'indeterminate',\n 'default',\n 'required',\n 'valid',\n 'invalid',\n 'in-range',\n 'out-of-range',\n 'placeholder-shown',\n 'autofill',\n 'read-only',\n // Structural\n 'first',\n 'last',\n 'only',\n 'odd',\n 'even',\n 'first-of-type',\n 'last-of-type',\n 'only-of-type',\n 'empty',\n 'has',\n // Content / pseudo elements\n 'before',\n 'after',\n 'file',\n 'placeholder',\n 'selection',\n 'marker',\n 'backdrop',\n 'first-line',\n 'first-letter',\n // Direction\n 'ltr',\n 'rtl',\n // Open/closed\n 'open',\n]\n\nexport const consistentVariantOrder = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Enforce a consistent order for Tailwind CSS variant prefixes',\n },\n fixable: 'code',\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n order: { type: 'array', items: { type: 'string' } },\n },\n additionalProperties: false,\n },\n ],\n hasSuggestions: true,\n // No defaultOptions for `order`: leaving it undefined is what triggers\n // the \"use the design system's order when available, fall back to the\n // built-in static list otherwise\" detection in createOnce.\n defaultOptions: [{}],\n messages: {\n wrongOrder: '\"{{className}}\" has variants in wrong order. Use \"{{replacement}}\" instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n // consistent-variant-order is the one DS-optional rule in v1: its static\n // fallback is also fully deterministic, so when no entryPoint is\n // configured we silently fall back to it instead of erroring. Only\n // plugin-fatal errors are swallowed — anything else is rethrown so real\n // bugs stay visible.\n const getPriority = createLazyOptions<Options, (variant: string) => number>(context, (o) => {\n let dsCache: DesignSystemCache | null = null\n try {\n dsCache = getDS().cache\n } catch (err) {\n if (!isFatalError(err)) throw err\n }\n\n if (o?.order) {\n const map = new Map<string, number>()\n for (let i = 0; i < o.order.length; i++) map.set(o.order[i], i)\n const fallback = o.order.length\n return (v) => map.get(v) ?? fallback\n }\n\n if (dsCache && dsCache.hasVariantOrder()) {\n const ds = dsCache\n return (v) => ds.getVariantPriority(v) ?? Number.MAX_SAFE_INTEGER\n }\n\n const map = new Map<string, number>()\n for (let i = 0; i < DEFAULT_VARIANT_ORDER.length; i++) {\n map.set(DEFAULT_VARIANT_ORDER[i], i)\n }\n const fallback = DEFAULT_VARIANT_ORDER.length\n return (v) => map.get(v) ?? fallback\n })\n\n // The project prefix (`tw:`) is structurally a variant but MUST stay first\n // (`hover:tw:flex` produces no CSS). Split it off before reordering and\n // re-attach it. '' when no DS / no prefix → behavior is unchanged.\n const getPrefix = createLazyOptions<Options, string>(context, () => {\n try {\n return getDS().cache.prefix\n } catch (err) {\n if (!isFatalError(err)) throw err\n return ''\n }\n })\n\n function reorderClass(cls: string): string | null {\n const prefix = getPrefix()\n let pfx = ''\n let body = cls\n if (prefix && cls.startsWith(prefix + ':')) {\n pfx = prefix + ':'\n body = cls.slice(prefix.length + 1)\n }\n\n const variants = extractVariants(body)\n if (variants.length < 2) return null\n\n const priorityOf = getPriority()\n const sorted = [...variants].sort((a, b) => priorityOf(a) - priorityOf(b))\n\n // Pseudo-elements must always be innermost (last in the variant chain).\n // Partition sorted variants: non-pseudo-elements first, pseudo-elements last.\n const nonPseudo: string[] = []\n const pseudo: string[] = []\n for (const v of sorted) {\n if (PSEUDO_ELEMENTS.has(v)) {\n pseudo.push(v)\n } else {\n nonPseudo.push(v)\n }\n }\n const final = nonPseudo.length > 0 && pseudo.length > 0 ? [...nonPseudo, ...pseudo] : sorted\n\n if (variants.every((v, i) => v === final[i])) return null\n\n const utility = extractUtility(body)\n return pfx + final.join(':') + ':' + utility\n }\n\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const classes = split.classes\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const fixed = reorderClass(cls)\n if (fixed) offending.push({ cls, replacement: fixed })\n }\n\n if (offending.length === 0) continue\n\n const replacements = new Map(offending.map(({ cls, replacement }) => [cls, replacement]))\n const fixedValue = rebuildClassString(\n split,\n classes.map((cls) => replacements.get(cls) ?? cls),\n )\n\n for (let i = 0; i < offending.length; i++) {\n const { cls, replacement } = offending[i]\n if (i === 0) {\n context.report({\n node: loc.node,\n messageId: 'wrongOrder',\n data: { className: cls, replacement },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixedValue))\n },\n })\n } else {\n context.report({\n node: loc.node,\n messageId: 'wrongOrder',\n data: { className: cls, replacement },\n suggest: [\n {\n messageId: 'suggestReplace',\n data: { className: cls, replacement },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixedValue))\n },\n },\n ],\n })\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { createLazyOptions } from '../utils/context'\n\ninterface Options {\n printWidth?: number\n classesPerLine?: number\n}\n\nconst DEFAULT_PRINT_WIDTH = 80\n\nexport const enforceConsistentLineWrapping = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Warn when a class string exceeds the configured print width',\n },\n fixable: 'whitespace',\n schema: [\n {\n type: 'object',\n properties: {\n printWidth: { type: 'number' },\n classesPerLine: { type: 'number' },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ printWidth: DEFAULT_PRINT_WIDTH }],\n messages: {\n tooLong:\n 'Class string is {{length}} characters long, exceeding the print width of {{printWidth}}. Consider splitting into multiple lines or extracting into a component.',\n tooManyPerLine:\n 'Too many classes on a single line ({{count}}). Maximum allowed per line is {{max}}.',\n },\n },\n createOnce(context) {\n const getPrintWidth = createLazyOptions<Options, number>(\n context,\n (o) => o?.printWidth ?? DEFAULT_PRINT_WIDTH,\n )\n const getClassesPerLine = createLazyOptions<Options, number | undefined>(\n context,\n (o) => o?.classesPerLine,\n )\n\n function check(locations: ClassLocation[]) {\n const printWidth = getPrintWidth()\n const classesPerLine = getClassesPerLine()\n\n for (const loc of locations) {\n if (loc.value.length > printWidth) {\n context.report({\n node: loc.node,\n messageId: 'tooLong',\n data: {\n length: String(loc.value.length),\n printWidth: String(printWidth),\n },\n })\n }\n\n if (classesPerLine !== undefined) {\n const classes = splitClasses(loc.value)\n if (classes.length > classesPerLine) {\n const isTemplateLiteral = loc.node.type === 'TemplateElement'\n if (isTemplateLiteral) {\n // Autofix: split into chunks of classesPerLine\n const chunks: string[] = []\n for (let i = 0; i < classes.length; i += classesPerLine) {\n chunks.push(classes.slice(i, i + classesPerLine).join(' '))\n }\n // Compute base indentation from the node's start column\n const startCol = loc.node.loc?.start.column ?? 0\n const indent = ' '.repeat(startCol)\n const fixedValue = chunks.join('\\n' + indent)\n\n context.report({\n node: loc.node,\n messageId: 'tooManyPerLine',\n data: {\n count: String(classes.length),\n max: String(classesPerLine),\n },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixedValue))\n },\n })\n } else {\n context.report({\n node: loc.node,\n messageId: 'tooManyPerLine',\n data: {\n count: String(classes.length),\n max: String(classesPerLine),\n },\n })\n }\n }\n }\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClassesWithSeparators } from '../utils/class-splitter'\nimport { reportClassReplacements } from '../utils/report'\nimport {\n hasArbitraryValue,\n reattachImportant,\n splitImportant,\n splitUtilityAndVariant,\n} from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\nimport { DS_UNAVAILABLE_MESSAGE, safeGetDS } from '../utils/fatal'\n\nexport const noUnnecessaryArbitraryValue = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Disallow arbitrary values when a named Tailwind class produces the same CSS',\n },\n fixable: 'code',\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n },\n additionalProperties: false,\n },\n ],\n hasSuggestions: true,\n defaultOptions: [{}],\n messages: {\n unnecessaryArbitrary:\n '\"{{className}}\" can be written as \"{{replacement}}\". Use the named class instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n ...DS_UNAVAILABLE_MESSAGE,\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n if (locations.length === 0) return\n const ds = safeGetDS(getDS, context, locations[0].node)\n if (!ds) return\n const { cache } = ds\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const offending = split.classes.flatMap((cls) => {\n if (!hasArbitraryValue(cls)) return []\n const { utility, variant } = splitUtilityAndVariant(cls)\n const { bare: bareUtility, position } = splitImportant(utility)\n const named = cache.getNamedEquivalent(bareUtility)\n return named ? [{ cls, replacement: variant + reattachImportant(named, position) }] : []\n })\n reportClassReplacements(context, loc, split, split.classes, offending, {\n messageId: 'unnecessaryArbitrary',\n })\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClassesWithSeparators } from '../utils/class-splitter'\nimport { reportClassReplacements } from '../utils/report'\nimport { reattachImportant, splitImportant, splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\nimport { DS_UNAVAILABLE_MESSAGE, safeGetDS } from '../utils/fatal'\n\n/**\n * Match `prefix-(--name)` or `prefix-(--name)/modifier`.\n * Captures: 1=prefix, 2=variable name, 3=optional `/modifier` (kept verbatim).\n */\nconst PAREN_VAR_RE = /^(.+?)-\\(--([\\w-]+)\\)(\\/[^/\\s]+)?$/\n\n/**\n * Match `prefix-[var(--name)]` or `prefix-[var(--name)]/modifier`.\n * Captures: 1=prefix, 2=variable name, 3=optional `/modifier`.\n */\nconst BRACKET_VAR_RE = /^(.+?)-\\[var\\(--([\\w-]+)\\)\\](\\/[^/\\s]+)?$/\n\nfunction detectRawVariable(\n utility: string,\n): { prefix: string; varName: string; modifier: string } | null {\n const paren = PAREN_VAR_RE.exec(utility)\n if (paren) return { prefix: paren[1], varName: paren[2], modifier: paren[3] ?? '' }\n const bracket = BRACKET_VAR_RE.exec(utility)\n if (bracket) return { prefix: bracket[1], varName: bracket[2], modifier: bracket[3] ?? '' }\n return null\n}\n\nexport const preferThemeTokens = defineRule({\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Prefer named theme-token utilities over raw CSS variable references when a matching utility exists',\n },\n fixable: 'code',\n schema: [\n {\n type: 'object',\n properties: {\n entryPoint: { type: 'string' },\n },\n additionalProperties: false,\n },\n ],\n hasSuggestions: true,\n defaultOptions: [{}],\n messages: {\n preferNamed:\n '\"{{className}}\" can be written as \"{{replacement}}\". Use the named theme token.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n ...DS_UNAVAILABLE_MESSAGE,\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n if (locations.length === 0) return\n const ds = safeGetDS(getDS, context, locations[0].node)\n if (!ds) return\n const { cache } = ds\n\n for (const loc of locations) {\n const split = splitClassesWithSeparators(loc.value)\n const offending = split.classes.flatMap((cls) => {\n const { utility, variant } = splitUtilityAndVariant(cls)\n const { bare: bareUtility, position } = splitImportant(utility)\n const match = detectRawVariable(bareUtility)\n if (!match) return []\n\n const candidate = `${match.prefix}-${match.varName}${match.modifier}`\n if (!cache.isValid(candidate)) return []\n\n // Reject if the named candidate resolves to a class that produces\n // the same CSS as the original — that case is handled by\n // no-unnecessary-arbitrary-value. This rule only catches the\n // heuristic-only cases.\n const namedEquivalent = cache.getNamedEquivalent(bareUtility)\n if (namedEquivalent && namedEquivalent === `${match.prefix}-${match.varName}`) return []\n\n return [{ cls, replacement: variant + reattachImportant(candidate, position) }]\n })\n reportClassReplacements(context, loc, split, split.classes, offending, {\n messageId: 'preferNamed',\n })\n }\n }\n\n return createExtractorVisitors(context, check)\n },\n})\n","import { definePlugin } from '@oxlint/plugins'\nimport { noDuplicateClasses } from './rules/no-duplicate-classes'\nimport { noUnnecessaryWhitespace } from './rules/no-unnecessary-whitespace'\nimport { noUnknownClasses } from './rules/no-unknown-classes'\nimport { noConflictingClasses } from './rules/no-conflicting-classes'\nimport { noDeprecatedClasses } from './rules/no-deprecated-classes'\nimport { enforceCanonical } from './rules/enforce-canonical'\nimport { enforceSortOrder } from './rules/enforce-sort-order'\nimport { enforceShorthand } from './rules/enforce-shorthand'\nimport { enforceLogical } from './rules/enforce-logical'\nimport { enforcePhysical } from './rules/enforce-physical'\nimport { maxClassCount } from './rules/max-class-count'\nimport { noRestrictedClasses } from './rules/no-restricted-classes'\nimport { noArbitraryValue } from './rules/no-arbitrary-value'\nimport { enforceConsistentImportantPosition } from './rules/enforce-consistent-important-position'\nimport { enforceNegativeArbitraryValues } from './rules/enforce-negative-arbitrary-values'\nimport { enforceConsistentVariableSyntax } from './rules/enforce-consistent-variable-syntax'\nimport { noDarkWithoutLight } from './rules/no-dark-without-light'\nimport { noHardcodedColors } from './rules/no-hardcoded-colors'\nimport { noContradictingVariants } from './rules/no-contradicting-variants'\nimport { consistentVariantOrder } from './rules/consistent-variant-order'\nimport { enforceConsistentLineWrapping } from './rules/enforce-consistent-line-wrapping'\nimport { noUnnecessaryArbitraryValue } from './rules/no-unnecessary-arbitrary-value'\nimport { preferThemeTokens } from './rules/prefer-theme-tokens'\n\nconst plugin = definePlugin({\n meta: { name: 'tailwindcss' },\n rules: {\n 'no-duplicate-classes': noDuplicateClasses,\n 'no-unnecessary-whitespace': noUnnecessaryWhitespace,\n 'no-unknown-classes': noUnknownClasses,\n 'no-conflicting-classes': noConflictingClasses,\n 'no-deprecated-classes': noDeprecatedClasses,\n 'enforce-canonical': enforceCanonical,\n 'enforce-sort-order': enforceSortOrder,\n 'enforce-shorthand': enforceShorthand,\n 'enforce-logical': enforceLogical,\n 'enforce-physical': enforcePhysical,\n 'max-class-count': maxClassCount,\n 'no-restricted-classes': noRestrictedClasses,\n 'no-arbitrary-value': noArbitraryValue,\n 'enforce-consistent-important-position': enforceConsistentImportantPosition,\n 'enforce-negative-arbitrary-values': enforceNegativeArbitraryValues,\n 'enforce-consistent-variable-syntax': enforceConsistentVariableSyntax,\n 'no-dark-without-light': noDarkWithoutLight,\n 'no-hardcoded-colors': noHardcodedColors,\n 'no-contradicting-variants': noContradictingVariants,\n 'consistent-variant-order': consistentVariantOrder,\n 'enforce-consistent-line-wrapping': enforceConsistentLineWrapping,\n 'no-unnecessary-arbitrary-value': noUnnecessaryArbitraryValue,\n 'prefer-theme-tokens': preferThemeTokens,\n },\n})\n\nexport default plugin\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,SAAgB,eAAe,KAAoB,OAAuB;CACxE,IAAI,IAAI,wBAAwB,CAAC,MAAM,WAAW,GAAG,GAAG,QAAQ,IAAI;CACpE,IAAI,IAAI,yBAAyB,CAAC,MAAM,SAAS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