oxlint-tailwindcss 0.6.2 → 0.7.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 +22 -4
- package/dist/index.cjs +318 -42
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +404 -125
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["BUFFER_SIZE","HEADER_INTS","DATA_OFFSET","INIT_TIMEOUT","REQUEST_TIMEOUT","WORKER_SCRIPT","worker","controlArray","lengthView","dataArea","initialized","available","currentCssPath","ensureService","cleanup"],"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/floating-point.ts","../src/utils/class-parser.ts","../src/design-system/cache.ts","../src/design-system/sync-loader.ts","../src/design-system/auto-detect.ts","../src/design-system/debug.ts","../src/design-system/loader.ts","../src/types.ts","../src/rules/no-deprecated-classes.ts","../src/rules/no-unknown-classes.ts","../src/rules/no-conflicting-classes.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/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/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\nlet _cachedConfig: ExtractorConfig | null = null\nlet _settingsResolved = false\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, merging defaults with user settings from\n * `settings.tailwindcss`. Caches after the first successful settings read.\n * Falls back to DEFAULT_EXTRACTOR_CONFIG if settings are unavailable.\n */\nexport function getExtractorConfig(context: {\n settings?: Readonly<Record<string, unknown>>\n}): ExtractorConfig {\n if (_settingsResolved) return _cachedConfig!\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 _settingsResolved = true\n } catch {\n // createOnce — settings not available yet, return defaults without caching\n return DEFAULT_EXTRACTOR_CONFIG\n }\n\n if (!tw) {\n _cachedConfig = DEFAULT_EXTRACTOR_CONFIG\n return _cachedConfig\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 _cachedConfig = {\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 return _cachedConfig\n}\n\n/** Reset cached config — for test isolation */\nexport function resetExtractorConfig(): void {\n _cachedConfig = null\n _settingsResolved = false\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 results.push(...extractFromExpression(arg))\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 results.push(...extractFromExpression(prop.value))\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 results.push(...extractFromExpression(arg))\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 results.push(...extractFromExpression(arg))\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 results.push(...extractFromExpression(variant.value))\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 results.push(...extractFromExpression(prop.value))\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 results.push(...extractFromExpression(arg))\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 results.push(...extractFromExpression(prop.value))\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 results.push(...extractFromExpression(slot.value))\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 results.push(...extractFromExpression(slotProp.value))\n }\n }\n } else {\n results.push(...extractFromExpression(variant.value))\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 results.push(...extractFromExpression(prop.value))\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 results.push(...extractFromExpression(prop.value))\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\nfunction extractFromExpression(node: ESTree.Node): ClassLocation[] {\n if (node.type === 'Literal' && typeof node.value === 'string') {\n return [\n {\n value: node.value,\n node,\n range: [node.range[0] + 1, node.range[1] - 1],\n },\n ]\n }\n\n if (node.type === 'TemplateLiteral') {\n return extractFromTemplateLiteral(node as ESTree.TemplateLiteral)\n }\n\n if (node.type === 'ConditionalExpression') {\n return [\n ...extractFromExpression((node as ESTree.ConditionalExpression).consequent),\n ...extractFromExpression((node as ESTree.ConditionalExpression).alternate),\n ]\n }\n\n if (node.type === 'LogicalExpression') {\n return extractFromExpression((node as ESTree.LogicalExpression).right)\n }\n\n // Objects: cn({ \"bg-red-500\": isError }) — extract the keys\n if (node.type === 'ObjectExpression') {\n const results: ClassLocation[] = []\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 results.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 results\n }\n\n return []\n}\n\nfunction extractFromTemplateLiteral(node: ESTree.TemplateLiteral): ClassLocation[] {\n const results: 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 results.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 results\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","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } 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 classes = splitClasses(loc.value)\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 = unique.join(' ')\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 // Collapse all whitespace runs to a single space\n let normalized = loc.value.replace(/\\s+/g, ' ')\n\n // Trim edges, but preserve a single space at template expression boundaries\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 * 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","/**\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 * 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 * 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","import { type PrecomputedData } from './sync-loader'\nimport { roundRemValue } from '../utils/floating-point'\nimport { extractUtility, extractVariants, hasArbitraryValue } from '../utils/class-parser'\n\n/** Strip `!` modifier from start or end: `!flex` → `flex`, `flex!` → `flex` */\nfunction stripImportant(cls: string): { bare: string; important: boolean } {\n if (cls.startsWith('!')) return { bare: cls.slice(1), important: true }\n if (cls.endsWith('!')) return { bare: cls.slice(0, -1), important: true }\n return { bare: cls, important: false }\n}\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\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 }\n }\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 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, important } = stripImportant(utility)\n if (important) {\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 const isPrefix = utility.startsWith('!')\n return isPrefix ? variantPrefix + '!' + canonicalBare : 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 /** 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 // Find first matching class in the order map\n for (const [cls, order] of this.orderMap) {\n if (cls.startsWith(prefix) && order != null) return order\n }\n return undefined\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 } = stripImportant(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 getOrder(className: string): bigint | null {\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, important } = stripImportant(utility)\n if (important) {\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, important } = stripImportant(base)\n if (important) {\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 = stripImportant(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 = stripImportant(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 = stripImportant(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, important } = stripImportant(className)\n if (important) 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, important } = stripImportant(className)\n if (important) return this.arbitraryEquivMap.get(bare) ?? null\n return null\n }\n}\n","/**\n * Synchronous design system loader using execFileSync.\n *\n * The problem: __unstable__loadDesignSystem is async, but oxlint's createOnce is sync.\n * The solution: spawn a child process that loads the design system, pre-computes all\n * data we need, and returns it as JSON via stdout. This runs ONCE at plugin init time.\n *\n * For arbitrary values (bg-[#123]) that aren't in the class list, we use heuristics.\n */\n\nimport { execFileSync } from 'node:child_process'\nimport { createHash } from 'node:crypto'\nimport { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'\nimport { dirname, join, resolve } from 'node:path'\nimport { tmpdir } from 'node:os'\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\nconst PRECOMPUTE_SCRIPT = `\nconst { __unstable__loadDesignSystem } = require('@tailwindcss/node');\nconst { readFileSync } = 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 = process.env.TAILWIND_CSS_PATH;\n const css = readFileSync(cssPath, 'utf-8');\n const base = dirname(cssPath);\n const ds = await __unstable__loadDesignSystem(css, { base });\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\n const cssResults = ds.candidatesToCss(classNames);\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);\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([cls]);\n if (result[0] && result[0] !== cls) {\n canonical[cls] = result[0];\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);\n for (const [name, val] of orderResults) {\n if (val !== null) order[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 const props = extractRootCssProps(cssResults[i], 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 componentClasses.push(acm[1]);\n }\n }\n }\n\n // Arbitrary equivalents: map arbitrary forms to named equivalents\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 const lastDash = cls.lastIndexOf('-');\n if (lastDash <= 0) continue;\n const prefix = cls.slice(0, lastDash);\n candidates.push({ arbitraryForm: prefix + '-[' + value + ']', namedCls: cls, namedCss: cssText });\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 const arbResults = ds.candidatesToCss(arbForms);\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 process.stdout.write(JSON.stringify({ validClasses, canonical, order, cssProps, variantOrder, componentClasses, arbitraryEquivalents }));\n}\nmain().catch(e => { process.stderr.write(e.message); process.exit(1); });\n`\n\nconst CACHE_DIR = join(tmpdir(), 'oxlint-tailwindcss')\n\n// Bump this when precompute logic changes to invalidate disk cache\nconst CACHE_VERSION = 11\n\n/**\n * Two-level disk cache for monorepo deduplication:\n *\n * Level 1 — mtime index (.idx): maps path+mtime → content hash (fast-path, avoids reading CSS)\n * Level 2 — content cache (.json): maps content hash → precomputed data (shared across packages)\n *\n * In monorepos, multiple packages with identical CSS (e.g. `@import 'tailwindcss'`) at different\n * paths share a single content cache entry, avoiding redundant child process spawns.\n */\n\nfunction getMtimeIndexPath(cssPath: string, mtime: number): string {\n const hash = createHash('md5').update(`v${CACHE_VERSION}:${cssPath}:${mtime}`).digest('hex')\n return join(CACHE_DIR, `${hash}.idx`)\n}\n\nfunction computeContentHash(content: string): string {\n return createHash('md5').update(`v${CACHE_VERSION}:${content}`).digest('hex')\n}\n\nfunction getContentCachePath(contentHash: string): string {\n return join(CACHE_DIR, `${contentHash}.json`)\n}\n\nfunction tryReadCache(cachePath: string): PrecomputedData | null {\n try {\n return JSON.parse(readFileSync(cachePath, 'utf-8')) as PrecomputedData\n } catch {\n return null\n }\n}\n\nfunction writeCacheFiles(\n contentCachePath: string,\n mtimeIndexPath: string,\n contentHash: string,\n data: string,\n): void {\n try {\n mkdirSync(CACHE_DIR, { recursive: true })\n writeFileSync(contentCachePath, data)\n writeFileSync(mtimeIndexPath, contentHash)\n } catch {\n // Non-fatal — cache is optional\n }\n}\n\nexport function loadDesignSystemSync(cssPath: string, timeout?: number): PrecomputedData | null {\n const resolvedPath = resolve(cssPath)\n\n try {\n const mtime = statSync(resolvedPath).mtimeMs\n const mtimeIndexPath = getMtimeIndexPath(resolvedPath, mtime)\n\n // Fast path: mtime index exists → read content hash → look up content cache\n if (existsSync(mtimeIndexPath)) {\n try {\n const contentHash = readFileSync(mtimeIndexPath, 'utf-8').trim()\n const contentCachePath = getContentCachePath(contentHash)\n const cached = tryReadCache(contentCachePath)\n if (cached) return cached\n } catch {\n // Index corrupted, fall through\n }\n }\n\n // Slow path: read CSS content, compute content hash\n const content = readFileSync(resolvedPath, 'utf-8')\n const contentHash = computeContentHash(content)\n const contentCachePath = getContentCachePath(contentHash)\n\n // Check content cache — another package with identical CSS may have already computed this\n const cached = tryReadCache(contentCachePath)\n if (cached) {\n // Content cache hit (monorepo deduplication) — just write the mtime index\n try {\n mkdirSync(CACHE_DIR, { recursive: true })\n writeFileSync(mtimeIndexPath, contentHash)\n } catch {\n // Non-fatal\n }\n return cached\n }\n\n // Full computation: spawn child process\n const stdout = execFileSync(process.execPath, ['-e', PRECOMPUTE_SCRIPT], {\n encoding: 'utf-8',\n timeout: timeout ?? 30_000,\n maxBuffer: 50 * 1024 * 1024,\n env: { ...process.env, TAILWIND_CSS_PATH: resolvedPath },\n cwd: dirname(resolvedPath),\n })\n\n // Write both cache levels\n writeCacheFiles(contentCachePath, mtimeIndexPath, contentHash, stdout)\n\n return JSON.parse(stdout) as PrecomputedData\n } catch (error) {\n console.error(\n `[oxlint-tailwindcss] Failed to load design system from \"${resolvedPath}\":`,\n error instanceof Error ? error.message : error,\n )\n return null\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","import { existsSync, readFileSync } from 'node:fs'\nimport { dirname, join, resolve } from 'node:path'\n\nconst IMPORT_RE = /@import\\s+['\"]([^'\"]+)['\"]/g\n\n/**\n * Resolves a CSS @import specifier to an absolute path.\n * Handles relative paths and package imports (walks up to node_modules).\n */\nfunction resolveImport(specifier: string, baseDir: string): string | null {\n if (specifier.startsWith('.')) return resolve(baseDir, specifier)\n\n // Package import — walk up looking for node_modules\n let dir = baseDir\n while (true) {\n const candidate = join(dir, 'node_modules', specifier)\n if (existsSync(candidate)) return candidate\n const parent = dirname(dir)\n if (parent === dir) break\n dir = parent\n }\n return null\n}\n\n/**\n * Checks if any @import in the CSS content points to a file containing a Tailwind signal.\n * Only follows ONE level of imports — no recursion.\n */\nfunction hasTailwindSignalInImports(content: string, baseDir: string, signals: string[]): boolean {\n IMPORT_RE.lastIndex = 0\n let match\n while ((match = IMPORT_RE.exec(content)) !== null) {\n const specifier = match[1]\n if (specifier === 'tailwindcss') continue\n\n const resolved = resolveImport(specifier, baseDir)\n if (!resolved) continue\n\n try {\n const imported = readFileSync(resolved, 'utf-8')\n if (signals.some((signal) => imported.includes(signal))) return true\n } catch {\n continue\n }\n }\n return false\n}\n\nexport const CANDIDATE_DIRS = [\n 'src',\n '.',\n 'app',\n 'styles',\n 'style',\n 'css',\n 'assets',\n 'assets/css',\n 'resources/css',\n]\nexport const CANDIDATE_NAMES = [\n 'app',\n 'globals',\n 'global',\n 'style',\n 'styles',\n 'index',\n 'main',\n 'tailwind',\n 'tailwindcss',\n]\n\nconst CANDIDATE_PATHS = CANDIDATE_DIRS.flatMap((dir) =>\n CANDIDATE_NAMES.map((name) => (dir === '.' ? `${name}.css` : `${dir}/${name}.css`)),\n)\n\nconst TAILWIND_SIGNALS = [\n '@import \"tailwindcss\"',\n \"@import 'tailwindcss'\",\n '@tailwind base',\n '@import tailwindcss',\n]\n\n/**\n * Searches for the Tailwind CSS entry point by walking UP from the file\n * being linted. Monorepo-aware: stops at package.json boundaries.\n */\nexport function autoDetectEntryPoint(filePath?: string): string | null {\n const startDir = filePath ? dirname(resolve(filePath)) : process.cwd()\n let currentDir = startDir\n\n for (let depth = 0; depth < 20; depth++) {\n for (const candidate of CANDIDATE_PATHS) {\n const fullPath = join(currentDir, candidate)\n if (!existsSync(fullPath)) continue\n\n try {\n const content = readFileSync(fullPath, 'utf-8')\n if (TAILWIND_SIGNALS.some((signal) => content.includes(signal))) {\n return fullPath\n }\n if (hasTailwindSignalInImports(content, dirname(fullPath), TAILWIND_SIGNALS)) {\n return fullPath\n }\n } catch {\n continue\n }\n }\n\n // If current directory has package.json, we've reached the package root — stop\n if (existsSync(join(currentDir, 'package.json'))) break\n\n const parentDir = dirname(currentDir)\n if (parentDir === currentDir) break\n\n currentDir = parentDir\n }\n\n return null\n}\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","import { DesignSystemCache } from './cache'\nimport { loadDesignSystemSync } from './sync-loader'\nimport { autoDetectEntryPoint } from './auto-detect'\nimport { debugLog, isDebugEnabled, setDebugEnabled, resetDebug } from './debug'\nimport { statSync } from 'node:fs'\nimport { dirname, resolve, relative } from 'node:path'\n\nexport interface LoadResult {\n cache: DesignSystemCache\n entryPoint: string\n}\n\n// Per-entry-point DS cache — supports multiple design systems in monorepos\nconst dsCache = new Map<string, { cache: DesignSystemCache; mtime: number }>()\n\n// Auto-detect result cache by directory — avoids repeated filesystem walks\nconst autoDetectCache = new Map<string, string | null>()\n\n// Fallback path — only set by explicit entryPoint calls (tests, rule options),\n// never by auto-detect. Prevents cross-package contamination in monorepos.\nlet lastLoadedPath: string | null = null\n\n/**\n * Extracts `entryPoint` from `context.settings.tailwindcss`.\n * Supports both `string` and `string[]` (for monorepos).\n */\nfunction entryPointFromSettings(\n settings?: Readonly<Record<string, unknown>>,\n): string | string[] | undefined {\n const tw = settings?.tailwindcss\n if (tw && typeof tw === 'object' && 'entryPoint' in tw) {\n const ep = (tw as Record<string, unknown>).entryPoint\n if (typeof ep === 'string') return ep\n if (Array.isArray(ep) && ep.length > 0 && ep.every((e) => typeof e === 'string')) {\n return ep as string[]\n }\n }\n return undefined\n}\n\n/**\n * Given an array of entry points and a file path, pick the one that shares\n * the longest common directory prefix with the file. Falls back to first entry.\n */\nfunction resolveClosestEntryPoint(entryPoints: string[], filePath?: string): string {\n if (entryPoints.length === 1 || !filePath) return entryPoints[0]\n\n const fileDir = dirname(resolve(filePath))\n let best = entryPoints[0]\n let bestLen = 0\n\n for (const ep of entryPoints) {\n const epDir = dirname(resolve(ep))\n // Count shared path prefix length\n const len = commonPrefixLength(fileDir, epDir)\n if (len > bestLen) {\n bestLen = len\n best = ep\n }\n }\n\n return best\n}\n\nfunction commonPrefixLength(a: string, b: string): number {\n const len = Math.min(a.length, b.length)\n let i = 0\n while (i < len && a[i] === b[i]) i++\n return i\n}\n\n/**\n * Extracts `rootFontSize` from `context.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\n/**\n * Extracts `timeout` from `context.settings.tailwindcss`.\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 * Cached auto-detect: caches by directory since all files in the same directory\n * resolve to the same entry point. Avoids repeated filesystem walks.\n */\nfunction cachedAutoDetect(filePath?: string): string | null {\n if (!filePath) return autoDetectEntryPoint(filePath)\n const dir = dirname(resolve(filePath))\n const cached = autoDetectCache.get(dir)\n if (cached !== undefined) return cached\n const result = autoDetectEntryPoint(filePath)\n autoDetectCache.set(dir, result)\n return result\n}\n\n/**\n * Returns the design system cache, loading synchronously on first call.\n * Uses execFileSync internally to bridge the async Tailwind API.\n *\n * Supports multiple design systems: each unique CSS entry point gets its own cache.\n * In monorepos, files in different packages auto-detect to different entry points\n * and each gets the correct DS.\n *\n * Resolution order: rule option `entryPoint` > `settings.tailwindcss.entryPoint` > auto-detect.\n */\nexport function getLoadedDesignSystem(\n entryPoint?: string,\n settings?: Readonly<Record<string, unknown>>,\n filePath?: string,\n): LoadResult | null {\n // Explicit entry points (rule option or settings) update the fallback path.\n // Auto-detect results do NOT — this prevents cross-package contamination in monorepos.\n const settingsEntry = entryPointFromSettings(settings)\n const explicitEntry =\n entryPoint ??\n (Array.isArray(settingsEntry)\n ? resolveClosestEntryPoint(settingsEntry, filePath)\n : settingsEntry)\n const cssPath = explicitEntry ?? cachedAutoDetect(filePath) ?? lastLoadedPath\n if (!cssPath) return null\n\n const resolvedPath = resolve(cssPath)\n\n try {\n const mtime = statSync(resolvedPath).mtimeMs\n const cached = dsCache.get(resolvedPath)\n if (cached && cached.mtime === mtime) {\n if (explicitEntry) lastLoadedPath = resolvedPath\n return { cache: cached.cache, entryPoint: resolvedPath }\n }\n\n const data = loadDesignSystemSync(resolvedPath, timeoutFromSettings(settings))\n if (!data) return null\n\n const cache = DesignSystemCache.fromPrecomputed(data)\n dsCache.set(resolvedPath, { cache, mtime })\n debugLog(`Loaded design system from \"${resolvedPath}\"`)\n if (explicitEntry) lastLoadedPath = resolvedPath\n return { cache, entryPoint: resolvedPath }\n } catch {\n return null\n }\n}\n\n/**\n * Creates a lazy DS loader that resolves the correct design system per file.\n *\n * In `createOnce`, `context.settings` and `context.filename` throw. When visitors\n * run, they become available. The loader re-resolves when the filename changes,\n * supporting monorepos where different files need different design systems.\n *\n * When a fixed entryPoint is provided (rule option or settings), it's used for all\n * files and cached after first resolution.\n */\nexport function createLazyLoader(context: {\n options?: readonly unknown[]\n settings?: Readonly<Record<string, unknown>>\n filename?: string\n}): () => LoadResult | null {\n let lastFilePath: string | undefined\n let lastResult: LoadResult | null = null\n let fixedEntryResolved = false\n let fixedResult: LoadResult | null = null\n let debugInitialized = false\n\n return () => {\n let entryPoint: string | undefined\n try {\n const opts = context.options?.[0] as { entryPoint?: string } | undefined\n entryPoint = opts?.entryPoint\n } catch {}\n\n let settings: Readonly<Record<string, unknown>> | undefined\n try {\n settings = context.settings\n } catch {}\n\n let filePath: string | undefined\n try {\n filePath = context.filename\n } catch {}\n\n // Initialize debug from settings on first successful access\n if (!debugInitialized && settings) {\n debugInitialized = true\n setDebugEnabled(isDebugEnabled(settings))\n }\n\n // Fixed entry point (rule option or settings) — same for all files\n const settingsEntry = entryPointFromSettings(settings)\n const fixedEntry = entryPoint ?? (typeof settingsEntry === 'string' ? settingsEntry : undefined)\n if (fixedEntry) {\n if (fixedEntryResolved) return fixedResult\n fixedEntryResolved = true\n fixedResult = getLoadedDesignSystem(fixedEntry, settings, filePath)\n if (fixedResult && filePath) {\n debugLog(\n `${relative(process.cwd(), filePath)} → ${relative(process.cwd(), fixedResult.entryPoint)}`,\n )\n }\n return fixedResult\n }\n\n // Array entry point from settings — resolve closest per file\n if (Array.isArray(settingsEntry)) {\n const closest = resolveClosestEntryPoint(settingsEntry, filePath)\n // Re-resolve when the file changes (different file may map to different entry)\n if (filePath && filePath === lastFilePath) return lastResult\n if (filePath) lastFilePath = filePath\n lastResult = getLoadedDesignSystem(closest, settings, filePath)\n if (lastResult && filePath) {\n debugLog(\n `${relative(process.cwd(), filePath)} → ${relative(process.cwd(), lastResult.entryPoint)}`,\n )\n }\n return lastResult\n }\n\n // Auto-detect mode: re-resolve when the file changes\n if (filePath && filePath === lastFilePath) return lastResult\n if (filePath) lastFilePath = filePath\n\n lastResult = getLoadedDesignSystem(undefined, settings, filePath)\n if (lastResult && filePath) {\n debugLog(\n `${relative(process.cwd(), filePath)} → ${relative(process.cwd(), lastResult.entryPoint)}`,\n )\n }\n return lastResult\n }\n}\n\n/**\n * Resets all DS caches (useful for tests).\n */\nexport function resetDesignSystem(): void {\n dsCache.clear()\n autoDetectCache.clear()\n lastLoadedPath = null\n resetDebug()\n}\n","export interface ExtractorExclusions {\n /** Default attribute names to exclude */\n attributes?: string[]\n /** Default callee names to exclude */\n callees?: string[]\n /** Default tag names to exclude */\n tags?: string[]\n /** Default variable pattern regex sources to exclude (matched against RegExp.source) */\n variablePatterns?: string[]\n}\n\nexport interface PluginSettings {\n /** CSS entry point. String for single project, array for monorepos (closest to file wins). */\n entryPoint?: string | string[]\n /** Enable debug logging to stderr (also activable via DEBUG=oxlint-tailwindcss env var) */\n debug?: boolean\n /** Root font size in pixels for px→named conversion (default: 16). Used by enforce-canonical. */\n rootFontSize?: number\n /** Timeout in milliseconds for design system loading (default: 30000) */\n timeout?: number\n /** Additional JSX attribute names to scan for Tailwind classes (added to defaults) */\n attributes?: string[]\n /** Additional function names to scan for Tailwind classes (added to defaults) */\n callees?: string[]\n /** Additional tagged template tag names to scan (added to defaults) */\n tags?: string[]\n /** Additional regex patterns (as strings) for variable names to scan (added to defaults) */\n variablePatterns?: string[]\n /** Remove specific items from the built-in defaults */\n exclude?: ExtractorExclusions\n}\n\nexport interface RuleOptions {\n entryPoint?: string\n}\n\n/**\n * Safely read context.options.\n *\n * In oxlint, `context.options` is `null` inside `createOnce()` — options are\n * only populated when visitors run. Call this lazily (inside `check()` or a\n * visitor) to get the user's configured options.\n *\n * In oxlint <1.31.0 the getter may throw — the try/catch handles that.\n */\nexport function safeOptions<T = Record<string, unknown>>(context: {\n options?: readonly unknown[]\n}): 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.\n *\n * Like `safeOptions`, `context.settings` may not be accessible in `createOnce()`.\n * The try/catch handles that gracefully.\n */\nexport function safeSettings(context: {\n settings?: Readonly<Record<string, unknown>>\n}): Readonly<Record<string, unknown>> | undefined {\n try {\n return context.settings ?? undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * Safely read context.filename.\n *\n * Like `safeSettings`, `context.filename` may not be accessible in `createOnce()`.\n */\nexport function safeFilename(context: { filename?: string }): string | undefined {\n try {\n return context.filename ?? undefined\n } catch {\n return undefined\n }\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\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 messages: {\n deprecated: '\"{{className}}\" is deprecated in Tailwind v4. Use \"{{replacement}}\" instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n const dsResult = getDS()\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for lookup — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n const replacement = DEPRECATED_MAP[bareUtility]\n if (!replacement) continue\n\n // If we have a design system, verify with canonicalize\n if (dsResult) {\n const canonical = dsResult.cache.canonicalize(bareUtility)\n if (canonical !== bareUtility && canonical === replacement) {\n // Confirmed by the design system\n }\n }\n\n const fullReplacement =\n variant +\n (hasImportantPrefix ? '!' : '') +\n replacement +\n (hasImportantSuffix ? '!' : '')\n offending.push({ cls, replacement: fullReplacement })\n }\n\n if (offending.length === 0) continue\n\n const replacements = new Map(offending.map(({ cls, replacement }) => [cls, replacement]))\n const fixedValue = classes.map((cls) => replacements.get(cls) ?? cls).join(' ')\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: 'deprecated',\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: 'deprecated',\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 { findBestSuggestion } from '../utils/levenshtein'\nimport { createLazyLoader } from '../design-system/loader'\nimport { safeOptions } from '../types'\nimport { DEPRECATED_MAP } from './no-deprecated-classes'\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 suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n let _allowlist: Set<string> | null = null\n let _ignorePrefixes: string[] | null = null\n function getLazyOptions() {\n if (_allowlist === null) {\n const opts = safeOptions<Options>(context)\n _allowlist = new Set(opts?.allowlist ?? [])\n _ignorePrefixes = opts?.ignorePrefixes ?? []\n }\n return { allowlist: _allowlist, ignorePrefixes: _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 // Strip ! (important) for validation — prefix or suffix form\n let stripped = className\n if (stripped.startsWith('!')) stripped = stripped.slice(1)\n if (stripped.endsWith('!')) stripped = stripped.slice(0, -1)\n return stripped\n }\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\n if (!ds) return\n const { cache } = ds\n\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n\n for (const cls of classes) {\n if (shouldIgnore(cls)) continue\n\n const stripped = stripModifiers(cls)\n if (cache.isValid(stripped)) continue\n\n // Don't report deprecated classes — no-deprecated-classes handles those\n if (DEPRECATED_MAP[stripped]) continue\n\n const suggestion = findBestSuggestion(stripped, cache.validClasses)\n\n if (suggestion) {\n const fixedValue = classes.map((c) => (c === cls ? suggestion : c)).join(' ')\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","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { extractUtility, getVariantPrefix } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\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 messages: {\n conflict:\n '\"{{classA}}\" and \"{{classB}}\" affect {{properties}}. \"{{winner}}\" takes precedence (appears later).',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\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 let utility = extractUtility(cls)\n // Strip ! (important) for lookup — prefix or suffix\n if (utility.startsWith('!')) utility = utility.slice(1)\n else if (utility.endsWith('!')) utility = utility.slice(0, -1)\n const props = cache.getCssProperties(utility)\n propsMap.set(cls, props)\n }\n\n // Utilities that share a CSS property but are designed to compose.\n // Most composition is detected automatically via CSS custom properties\n // (see isCompositionViaCssVars below). These groups cover cases where\n // the heuristic fails: shared intermediate vars or missing custom props.\n const COMPLEMENTARY_GROUPS = [\n /^(?:from|via|to)-/, // gradient stops (share --tw-gradient-stops)\n /^(?:transition|duration|ease|delay)(?:-|$)/, // transition composition (transition-all has no custom vars)\n /^-?(?:translate|scale|rotate|skew)-/, // transform axis composition (overlap not in cssProps)\n /^prose(?:-|$)/, // prose + prose-sm/lg/xl modifiers\n ]\n // Pairs where one utility sets defaults and the other overrides a specific property\n const COMPOSITION_PAIRS: [RegExp, RegExp][] = [\n [/^text-/, /^leading-/], // text-sm sets line-height, leading-* overrides\n [/^text-/, /^tracking-/], // text-* sets letter-spacing, tracking-* overrides\n [/^border(?:-[0-9]|$)/, /^border-(?:solid|dashed|dotted|double|hidden|none)$/], // border width + style\n [/^divide-/, /^border(?:-[trblxyse])?-/], // divide-* targets children\n [/^prose(?:-|$)/, /^max-w-/], // prose sets max-width, max-w-* overrides\n ]\n\n // Detect composition via CSS custom properties: if both classes use\n // custom properties (--tw-*) but none overlap, they compose into a\n // shared shorthand (e.g. shadow + ring both set box-shadow via different vars).\n function isCompositionViaCssVars(propsA: string[], propsB: string[]): 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 function shouldSkipPair(\n a: string,\n b: string,\n propsA: string[],\n propsB: string[],\n ): boolean {\n // CSS custom property composition (handles shadow/ring, filter, contain, etc.)\n if (isCompositionViaCssVars(propsA, propsB)) return true\n\n let ua = extractUtility(a)\n let ub = extractUtility(b)\n if (ua.startsWith('!')) ua = ua.slice(1)\n else if (ua.endsWith('!')) ua = ua.slice(0, -1)\n if (ub.startsWith('!')) ub = ub.slice(1)\n else if (ub.endsWith('!')) ub = ub.slice(0, -1)\n // Complementary utilities within the same group\n for (const re of COMPLEMENTARY_GROUPS) {\n if (re.test(ua) && re.test(ub)) return true\n }\n // Composition pairs where one sets defaults and the other overrides\n for (const [reA, reB] of COMPOSITION_PAIRS) {\n if ((reA.test(ua) && reB.test(ub)) || (reA.test(ub) && reB.test(ua))) return true\n }\n return false\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 * Persistent canonicalize service using worker_threads + SharedArrayBuffer.\n *\n * Calls `ds.canonicalizeCandidates(classes, { rem })` dynamically via a worker\n * thread. Same pattern as sort-service.ts — loads the DS once, then accepts\n * requests synchronously via Atomics.wait().\n *\n * This enables canonicalization of arbitrary user classes (e.g. `p-[2px]` → `p-0.5`)\n * which can't be precomputed because the input space is infinite.\n */\n\nimport { Worker } from 'node:worker_threads'\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 = 30_000\nconst REQUEST_TIMEOUT = 10_000\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, ${HEADER_INTS});\n const lengthView = new DataView(sharedBuffer, ${HEADER_INTS * 4}, 4);\n const dataArea = new Uint8Array(sharedBuffer, ${DATA_OFFSET});\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 // Signal ready\n Atomics.store(control, 2, 1);\n Atomics.notify(control, 2);\n\n // Request loop\n while (true) {\n Atomics.wait(control, 0, 0);\n\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 const result = ds.canonicalizeCandidates(classes, options);\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\n Atomics.store(control, 1, 1);\n Atomics.notify(control, 1);\n }\n}\nmain();\n`\n\nlet worker: Worker | null = null\nlet controlArray: Int32Array | null = null\nlet lengthView: DataView | null = null\nlet dataArea: Uint8Array | null = null\nlet initialized = false\nlet available = true\nlet currentCssPath: string | null = null\n\nfunction ensureService(cssPath: string): boolean {\n if (initialized && currentCssPath === cssPath) return available\n\n if (initialized) {\n cleanup()\n initialized = false\n available = true\n controlArray = null\n lengthView = null\n dataArea = null\n }\n\n initialized = true\n currentCssPath = cssPath\n\n try {\n const tailwindNodePath = require.resolve('@tailwindcss/node')\n\n const sharedBuffer = new SharedArrayBuffer(BUFFER_SIZE)\n controlArray = new Int32Array(sharedBuffer, 0, HEADER_INTS)\n lengthView = new DataView(sharedBuffer, HEADER_INTS * 4, 4)\n dataArea = new Uint8Array(sharedBuffer, DATA_OFFSET)\n\n worker = new Worker(WORKER_SCRIPT, {\n eval: true,\n workerData: { sharedBuffer, cssPath, tailwindNodePath },\n })\n\n worker.unref()\n\n worker.on('error', () => {\n available = false\n worker = null\n })\n worker.on('exit', () => {\n worker = null\n })\n\n const result = Atomics.wait(controlArray, 2, 0, INIT_TIMEOUT)\n if (result === 'timed-out' || controlArray[2] === -1) {\n available = false\n cleanup()\n return false\n }\n\n // `worker.unref()` handles process exit; no exit listener (see exit-listeners.test.ts).\n return true\n } catch {\n available = false\n cleanup()\n return false\n }\n}\n\nfunction cleanup(): void {\n if (worker) {\n try {\n worker.terminate()\n } catch {}\n worker = null\n }\n}\n\n/**\n * Canonicalize classes using the Tailwind CSS design system via worker thread.\n * Returns the canonicalized class array, or null if the service is unavailable.\n */\nexport function canonicalizeClassesSync(\n cssPath: string,\n classes: string[],\n rem?: number,\n): string[] | null {\n if (!ensureService(cssPath)) return null\n if (!controlArray || !dataArea || !lengthView) return null\n\n try {\n const request = Buffer.from(JSON.stringify({ classes, rem }), 'utf-8')\n if (request.length > BUFFER_SIZE - DATA_OFFSET) return null\n\n dataArea.set(request, 0)\n lengthView.setUint32(0, request.length)\n\n Atomics.store(controlArray, 0, 1)\n Atomics.notify(controlArray, 0)\n\n const result = Atomics.wait(controlArray, 1, 0, REQUEST_TIMEOUT)\n if (result === 'timed-out') {\n available = false\n cleanup()\n return null\n }\n\n const responseLen = lengthView.getUint32(0)\n const responseStr = Buffer.from(dataArea.slice(0, responseLen)).toString('utf-8')\n Atomics.store(controlArray, 1, 0)\n\n return JSON.parse(responseStr)\n } catch {\n available = false\n cleanup()\n return null\n }\n}\n\n/**\n * Reset the canonicalize service (for tests).\n */\nexport function resetCanonicalizeService(): void {\n cleanup()\n initialized = false\n available = true\n currentCssPath = null\n controlArray = null\n lengthView = null\n dataArea = null\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { createLazyLoader, rootFontSizeFromSettings } from '../design-system/loader'\nimport { canonicalizeClassesSync } from '../design-system/canonicalize-service'\nimport { safeSettings } from '../types'\n\n/**\n * Preserve the user's ! position after canonicalization.\n * canonicalizeCandidates always normalizes ! to suffix, but\n * enforce-consistent-important-position handles that separately.\n */\nfunction preserveImportantPosition(original: string, canonicalized: string): string {\n const origHasPrefix = original.startsWith('!') || /^[a-z0-9[\\]*@-]*:!/.test(original)\n const origHasSuffix = original.endsWith('!') && !origHasPrefix\n\n if (!origHasPrefix && !origHasSuffix) {\n // Original has no ! — strip any ! the canonicalizer added\n return canonicalized.replace(/!/g, '')\n }\n\n // Strip ! from canonicalized, then re-add in original position\n const bare = canonicalized.replace(/!/g, '')\n if (origHasPrefix) {\n // Re-add ! after variant prefix (e.g. \"hover:!p-0.5\")\n const variantPrefix = bare.slice(0, bare.length - bare.replace(/^[a-z0-9[\\]*@-]*:/g, '').length)\n return variantPrefix + '!' + bare.slice(variantPrefix.length)\n }\n // Suffix\n return bare + '!'\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 messages: {\n nonCanonical: '\"{{className}}\" can be written as \"{{canonical}}\". Use the canonical form.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\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 const ds = getDS()\n if (!ds) return\n const { cache, entryPoint } = ds\n\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n\n // Try dynamic canonicalization via worker (handles px→named, theme(), var() syntax, etc.)\n const rem = getRem()\n const dynamic = canonicalizeClassesSync(entryPoint, classes, rem)\n\n // Use dynamic results if available, otherwise fall back to precomputed cache\n let canonicals: string[]\n if (dynamic) {\n // Preserve user's ! position — canonicalizeCandidates normalizes to suffix,\n // but enforce-consistent-important-position handles that separately\n canonicals = classes.map((cls, i) => preserveImportantPosition(cls, dynamic[i]))\n } else {\n canonicals = classes.map((cls) => cache.canonicalize(cls))\n }\n\n let firstNonCanonical = true\n\n for (let i = 0; i < classes.length; i++) {\n const cls = classes[i]\n const canonical = canonicals[i]\n if (canonical === cls) continue\n\n if (firstNonCanonical) {\n firstNonCanonical = false\n const fixedValue = canonicals.join(' ')\n context.report({\n node: loc.node,\n messageId: 'nonCanonical',\n data: { className: cls, canonical },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixedValue))\n },\n })\n } else {\n const fixedValue = canonicals.join(' ')\n context.report({\n node: loc.node,\n messageId: 'nonCanonical',\n data: { className: cls, canonical },\n suggest: [\n {\n messageId: 'suggestReplace',\n data: { className: cls, replacement: canonical },\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","/**\n * Persistent sort service using worker_threads + SharedArrayBuffer.\n *\n * The problem: `ds.getClassOrder()` is the only way to get the exact official\n * Tailwind CSS sort order (matching oxfmt/prettier-plugin-tailwindcss), but the\n * design system is async to load and the oxlint plugin API is sync.\n *\n * The solution: spawn a Worker thread that loads the DS once, then accepts sort\n * requests via SharedArrayBuffer + Atomics. The parent uses `Atomics.wait()`\n * (with timeout) for synchronous blocking without risk of infinite hangs.\n *\n * Falls back gracefully if the worker fails to initialize within the timeout.\n */\n\nimport { Worker } from 'node:worker_threads'\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 = 30_000 // 30 s to load DS\nconst REQUEST_TIMEOUT = 10_000 // 10 s per sort request\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, ${HEADER_INTS});\n const lengthView = new DataView(sharedBuffer, ${HEADER_INTS * 4}, 4);\n const dataArea = new Uint8Array(sharedBuffer, ${DATA_OFFSET});\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 // Signal ready\n Atomics.store(control, 2, 1);\n Atomics.notify(control, 2);\n\n // Request loop\n while (true) {\n Atomics.wait(control, 0, 0); // wait for requestSignal !== 0\n\n const len = lengthView.getUint32(0);\n const requestStr = Buffer.from(dataArea.slice(0, len)).toString('utf-8');\n Atomics.store(control, 0, 0); // consume request\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\n Atomics.store(control, 1, 1); // signal response\n Atomics.notify(control, 1);\n }\n}\nmain();\n`\n\nlet worker: Worker | null = null\nlet controlArray: Int32Array | null = null\nlet lengthView: DataView | null = null\nlet dataArea: Uint8Array | null = null\nlet initialized = false\nlet available = true\nlet currentCssPath: string | null = null\n\nfunction ensureService(cssPath: string): boolean {\n // Same path → reuse existing worker\n if (initialized && currentCssPath === cssPath) return available\n\n // Different path → restart worker for the new DS\n if (initialized) {\n cleanup()\n initialized = false\n available = true\n controlArray = null\n lengthView = null\n dataArea = null\n }\n\n initialized = true\n currentCssPath = cssPath\n\n try {\n // Resolve @tailwindcss/node from the parent thread where the plugin's\n // dependencies are available, then pass the resolved path to the worker.\n // This avoids module resolution issues in VS Code's extension host.\n const tailwindNodePath = require.resolve('@tailwindcss/node')\n\n const sharedBuffer = new SharedArrayBuffer(BUFFER_SIZE)\n controlArray = new Int32Array(sharedBuffer, 0, HEADER_INTS)\n lengthView = new DataView(sharedBuffer, HEADER_INTS * 4, 4)\n dataArea = new Uint8Array(sharedBuffer, DATA_OFFSET)\n\n worker = new Worker(WORKER_SCRIPT, {\n eval: true,\n workerData: { sharedBuffer, cssPath, tailwindNodePath },\n })\n\n worker.unref()\n\n worker.on('error', () => {\n available = false\n worker = null\n })\n worker.on('exit', () => {\n worker = null\n })\n\n // Wait for DS to load (with timeout)\n const result = Atomics.wait(controlArray, 2, 0, INIT_TIMEOUT)\n if (result === 'timed-out' || controlArray[2] === -1) {\n available = false\n cleanup()\n return false\n }\n\n // `worker.unref()` handles process exit; no exit listener (see exit-listeners.test.ts).\n return true\n } catch {\n available = false\n cleanup()\n return false\n }\n}\n\nfunction cleanup(): void {\n if (worker) {\n try {\n worker.terminate()\n } catch {}\n worker = null\n }\n}\n\n/**\n * Sort classes using the official Tailwind CSS sort order via worker thread.\n * Returns the sorted class array, or null if the service is unavailable.\n */\nexport function sortClassesSync(cssPath: string, classes: string[]): string[] | null {\n if (!ensureService(cssPath)) return null\n if (!controlArray || !dataArea || !lengthView) return null\n\n try {\n const request = Buffer.from(JSON.stringify(classes), 'utf-8')\n if (request.length > BUFFER_SIZE - DATA_OFFSET) return null // too large\n\n dataArea.set(request, 0)\n lengthView.setUint32(0, request.length)\n\n // Signal request\n Atomics.store(controlArray, 0, 1)\n Atomics.notify(controlArray, 0)\n\n // Wait for response (with timeout)\n const result = Atomics.wait(controlArray, 1, 0, REQUEST_TIMEOUT)\n if (result === 'timed-out') {\n available = false\n cleanup()\n return null\n }\n\n // Read response\n const responseLen = lengthView.getUint32(0)\n const responseStr = Buffer.from(dataArea.slice(0, responseLen)).toString('utf-8')\n Atomics.store(controlArray, 1, 0) // consume response\n\n return JSON.parse(responseStr)\n } catch {\n available = false\n cleanup()\n return null\n }\n}\n\n/**\n * Reset the sort service (for tests).\n */\nexport function resetSortService(): void {\n cleanup()\n initialized = false\n available = true\n currentCssPath = null\n controlArray = null\n lengthView = null\n dataArea = null\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\nimport { sortClassesSync } from '../design-system/sort-service'\nimport { safeOptions } from '../types'\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 messages: {\n unsorted: 'Tailwind classes are not in the recommended order.',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n let _mode: 'default' | 'strict' | null = null\n function getMode(): 'default' | 'strict' {\n if (_mode === null) {\n const opts = safeOptions<Options>(context)\n _mode = opts?.mode ?? 'default'\n }\n return _mode\n }\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\n if (!ds) return\n const { cache, entryPoint } = ds\n const mode = getMode()\n\n function sortDefault(classes: string[]): string[] {\n // Use persistent child process for exact official Tailwind sort order\n const dynamic = sortClassesSync(entryPoint, classes)\n if (dynamic) return dynamic\n\n // Fallback to precomputed heuristic sort.\n // Null-order classes (group/name, peer/name) sort first — matches\n // the behavior of prettier-plugin-tailwindcss and oxfmt.\n const ordered = cache.getClassOrder(classes)\n const sorted = [...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 return sorted.map(([name]) => name)\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 const sortedGroupKeys = [...groups.keys()].sort((a, b) => {\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 classes = splitClasses(loc.value)\n if (classes.length < 2) continue\n\n const sortedNames = mode === 'strict' ? sortStrict(classes) : sortDefault(classes)\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(loc.range, preserveSpaces(loc, sortedNames.join(' ')))\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'\n\nconst VALUE_RE = /^(?:m[trbl]|p[trbl]|[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: [`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 // 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 classes = splitClasses(loc.value)\n if (classes.length < 2) continue\n\n const classSet = new Set(classes)\n\n // Extract all unique values used in the classes\n // Strip ! (prefix or suffix) for regex matching\n const values = new Set<string>()\n for (const cls of classes) {\n const bare = cls.startsWith('!')\n ? cls.slice(1)\n : cls.endsWith('!')\n ? cls.slice(0, -1)\n : cls\n const match = VALUE_RE.exec(bare)\n if (match) values.add(match[1])\n }\n\n for (const value of values) {\n const rules = createShorthandRules(value)\n\n for (const rule of rules) {\n // Check with ! modifier: all parts must share the same modifier\n const hasImportantPrefix = rule.parts.every((p) => classSet.has(`!${p}`))\n const hasImportantSuffix =\n !hasImportantPrefix && rule.parts.every((p) => classSet.has(`${p}!`))\n const hasPlain = rule.parts.every((p) => classSet.has(p))\n\n if (!hasImportantPrefix && !hasImportantSuffix && !hasPlain) continue\n\n const importantStart = hasImportantPrefix ? '!' : ''\n const importantEnd = hasImportantSuffix ? '!' : ''\n const matchParts = rule.parts.map((p) => `${importantStart}${p}${importantEnd}`)\n const remaining = classes.filter((c) => !matchParts.includes(c))\n remaining.push(`${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: `${importantStart}${rule.replacement}${importantEnd}`,\n },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, remaining.join(' ')))\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 { splitUtilityAndVariant } from '../utils/class-parser'\n\n// Mapping of physical properties to logical ones\nexport const PHYSICAL_TO_LOGICAL: Record<string, string> = {\n ml: 'ms',\n mr: 'me',\n pl: 'ps',\n pr: 'pe',\n left: 'start',\n right: 'end',\n 'border-l': 'border-s',\n 'border-r': 'border-e',\n 'rounded-l': 'rounded-s',\n 'rounded-r': 'rounded-e',\n 'rounded-tl': 'rounded-ss',\n 'rounded-tr': 'rounded-se',\n 'rounded-bl': 'rounded-es',\n 'rounded-br': 'rounded-ee',\n 'scroll-ml': 'scroll-ms',\n 'scroll-mr': 'scroll-me',\n 'scroll-pl': 'scroll-ps',\n 'scroll-pr': 'scroll-pe',\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: [],\n hasSuggestions: true,\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 function convertClass(cls: string): string | null {\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for lookup — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n for (const [physical, logical] of Object.entries(PHYSICAL_TO_LOGICAL)) {\n if (bareUtility === physical || bareUtility.startsWith(`${physical}-`)) {\n const suffix = bareUtility.slice(physical.length)\n return `${variant}${hasImportantPrefix ? '!' : ''}${logical}${suffix}${hasImportantSuffix ? '!' : ''}`\n }\n }\n return null\n }\n\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const converted = convertClass(cls)\n if (converted) offending.push({ cls, replacement: converted })\n }\n\n if (offending.length === 0) continue\n\n const replacements = new Map(offending.map(({ cls, replacement }) => [cls, replacement]))\n const fixedValue = classes.map((cls) => replacements.get(cls) ?? cls).join(' ')\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: 'useLogical',\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: 'useLogical',\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 { splitUtilityAndVariant } from '../utils/class-parser'\nimport { PHYSICAL_TO_LOGICAL } from './enforce-logical'\n\n// Invert the mapping: logical → physical\nconst LOGICAL_TO_PHYSICAL: Record<string, string> = {}\nfor (const [physical, logical] of Object.entries(PHYSICAL_TO_LOGICAL)) {\n LOGICAL_TO_PHYSICAL[logical] = physical\n}\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: [],\n hasSuggestions: true,\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 function convertClass(cls: string): string | null {\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for lookup — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n for (const [logical, physical] of Object.entries(LOGICAL_TO_PHYSICAL)) {\n if (bareUtility === logical || bareUtility.startsWith(`${logical}-`)) {\n const suffix = bareUtility.slice(logical.length)\n return `${variant}${hasImportantPrefix ? '!' : ''}${physical}${suffix}${hasImportantSuffix ? '!' : ''}`\n }\n }\n return null\n }\n\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const converted = convertClass(cls)\n if (converted) offending.push({ cls, replacement: converted })\n }\n\n if (offending.length === 0) continue\n\n const replacements = new Map(offending.map(({ cls, replacement }) => [cls, replacement]))\n const fixedValue = classes.map((cls) => replacements.get(cls) ?? cls).join(' ')\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: 'usePhysical',\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: 'usePhysical',\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, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { safeOptions } from '../types'\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 let _max: number | null = null\n function getMax(): number {\n if (_max === null) {\n const options = safeOptions<Options>(context)\n _max = options?.max ?? DEFAULT_MAX\n }\n return _max\n }\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 { safeOptions } from '../types'\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 messages: {\n restricted: '\"{{className}}\" is restricted.',\n restrictedWithMessage: '\"{{className}}\" is restricted: {{message}}',\n },\n },\n createOnce(context) {\n interface CompiledConfig {\n restrictedClasses: Set<string>\n patterns: Array<{ regex: RegExp; message?: string }>\n }\n\n let _config: CompiledConfig | null = null\n function getConfig(): CompiledConfig {\n if (_config === null) {\n const options = safeOptions<Options>(context)\n _config = {\n restrictedClasses: new Set(options?.classes ?? []),\n patterns: (options?.patterns ?? []).map((p) => ({\n regex: new RegExp(p.pattern),\n message: p.message,\n })),\n }\n }\n return _config\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 } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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 messages: {\n noArbitrary:\n '\"{{className}}\" uses an arbitrary value. Use a design token or extend your theme instead.',\n },\n },\n createOnce(context) {\n let _allowPrefixes: string[] | null = null\n function getAllowPrefixes(): string[] {\n if (_allowPrefixes === null) {\n const options = safeOptions<Options>(context)\n _allowPrefixes = options?.allow ?? []\n }\n return _allowPrefixes\n }\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 let utility = extractUtility(cls)\n if (utility.startsWith('!')) utility = utility.slice(1)\n else if (utility.endsWith('!')) utility = utility.slice(0, -1)\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, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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 let _position: 'prefix' | 'suffix' | null = null\n function getPosition(): 'prefix' | 'suffix' {\n if (_position === null) {\n const options = safeOptions<Options>(context)\n _position = options?.position ?? 'suffix'\n }\n return _position\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 for (const loc of locations) {\n const classes = splitClasses(loc.value)\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const { utility, variant } = splitUtilityAndVariant(cls)\n const fixed = fixUtility(utility, variant)\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 = classes.map((cls) => replacements.get(cls) ?? cls).join(' ')\n\n // Report each offending class; attach the fix to the first one\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: position === 'prefix' ? 'usePrefix' : 'useSuffix',\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: position === 'prefix' ? 'usePrefix' : 'useSuffix',\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 { 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 classes = splitClasses(loc.value)\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const fixed = fixClass(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 = classes.map((cls) => replacements.get(cls) ?? cls).join(' ')\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: 'moveNegative',\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: 'moveNegative',\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 { splitUtilityAndVariant } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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\n // Strip ! (important) for regex matching — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n const importantStart = hasImportantPrefix ? '!' : ''\n const importantEnd = hasImportantSuffix ? '!' : ''\n\n if (syntax === 'shorthand') {\n const match = EXPLICIT_VAR_RE.exec(bareUtility)\n if (match) {\n const [, prefix, varName] = match\n return `${variant}${importantStart}${prefix}-(${varName})${importantEnd}`\n }\n } else {\n const match = SHORTHAND_VAR_RE.exec(bareUtility)\n if (match) {\n const [, prefix, varName] = match\n return `${variant}${importantStart}${prefix}-[var(${varName})]${importantEnd}`\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 let _syntax: 'shorthand' | 'explicit' | null = null\n function getSyntax(): 'shorthand' | 'explicit' {\n if (_syntax === null) {\n const options = safeOptions<Options>(context)\n _syntax = options?.syntax ?? 'shorthand'\n }\n return _syntax\n }\n\n function check(locations: ClassLocation[]) {\n const syntax = getSyntax()\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const converted = convertClass(cls, syntax)\n if (converted) offending.push({ cls, replacement: converted })\n }\n\n if (offending.length === 0) continue\n\n const replacements = new Map(offending.map(({ cls, replacement }) => [cls, replacement]))\n const fixedValue = classes.map((cls) => replacements.get(cls) ?? cls).join(' ')\n const messageId = syntax === 'shorthand' ? 'useShorthand' : 'useExplicit'\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,\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,\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, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { extractVariants, extractUtility } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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 = utility\n if (u.startsWith('!')) u = u.slice(1)\n else if (u.endsWith('!')) u = u.slice(0, -1)\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 let _watchedVariants: Set<string> | null = null\n function getWatchedVariants(): Set<string> {\n if (_watchedVariants === null) {\n const options = safeOptions<Options>(context)\n _watchedVariants = new Set(options?.variants ?? DEFAULT_VARIANTS)\n }\n return _watchedVariants\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 { hasArbitraryValue, getArbitraryValue, extractUtility } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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*\\(/\n\nfunction isHardcodedColor(value: string): boolean {\n const trimmed = value.trim()\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 messages: {\n noHardcoded:\n '\"{{className}}\" uses a hardcoded color value. Use a design token from your theme instead.',\n },\n },\n createOnce(context) {\n let _allowlist: Set<string> | null = null\n function getAllowlist(): Set<string> {\n if (_allowlist === null) {\n const options = safeOptions<Options>(context)\n _allowlist = new Set(options?.allow ?? [])\n }\n return _allowlist\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 let utility = extractUtility(cls)\n if (utility.startsWith('!')) utility = utility.slice(1)\n else if (utility.endsWith('!')) utility = utility.slice(0, -1)\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 { splitClasses } from '../utils/class-splitter'\nimport { extractVariants, extractUtility } from '../utils/class-parser'\nimport { safeOptions } from '../types'\nimport { createLazyLoader } from '../design-system/loader'\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 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 interface CompiledConfig {\n priorityMap: Map<string, number>\n fallbackPriority: number\n dsCache: import('../design-system/cache').DesignSystemCache | null\n }\n\n let _config: CompiledConfig | null = null\n function getConfig(): CompiledConfig {\n if (_config === null) {\n const options = safeOptions<Options>(context)\n const dsCache = getDS()?.cache ?? null\n const priorityMap = new Map<string, number>()\n\n if (options?.order) {\n for (let i = 0; i < options.order.length; i++) {\n priorityMap.set(options.order[i], i)\n }\n _config = { priorityMap, fallbackPriority: options.order.length, dsCache }\n } else if (dsCache && dsCache.hasVariantOrder()) {\n for (const variant of DEFAULT_VARIANT_ORDER) {\n const p = dsCache.getVariantPriority(variant)\n if (p !== null) priorityMap.set(variant, p)\n }\n _config = { priorityMap, fallbackPriority: Number.MAX_SAFE_INTEGER, dsCache }\n } else {\n for (let i = 0; i < DEFAULT_VARIANT_ORDER.length; i++) {\n priorityMap.set(DEFAULT_VARIANT_ORDER[i], i)\n }\n _config = { priorityMap, fallbackPriority: DEFAULT_VARIANT_ORDER.length, dsCache }\n }\n }\n return _config\n }\n\n function getVariantPriority(variant: string): number {\n const { priorityMap, fallbackPriority, dsCache } = getConfig()\n const priority = priorityMap.get(variant)\n if (priority !== undefined) return priority\n\n if (dsCache && dsCache.hasVariantOrder()) {\n const dsPriority = dsCache.getVariantPriority(variant)\n if (dsPriority !== null) return dsPriority\n }\n\n return fallbackPriority\n }\n\n function reorderClass(cls: string): string | null {\n const variants = extractVariants(cls)\n if (variants.length < 2) return null\n\n const sorted = [...variants].sort((a, b) => getVariantPriority(a) - getVariantPriority(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(cls)\n return final.join(':') + ':' + utility\n }\n\n function check(locations: ClassLocation[]) {\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\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 = classes.map((cls) => replacements.get(cls) ?? cls).join(' ')\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 { safeOptions } from '../types'\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 let _printWidth: number | null = null\n function getPrintWidth(): number {\n if (_printWidth === null) {\n const options = safeOptions<Options>(context)\n _printWidth = options?.printWidth ?? DEFAULT_PRINT_WIDTH\n }\n return _printWidth\n }\n\n let _classesPerLine: number | undefined | null = null\n function getClassesPerLine(): number | undefined {\n if (_classesPerLine === null) {\n const options = safeOptions<Options>(context)\n _classesPerLine = options?.classesPerLine ?? undefined\n }\n return _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, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { hasArbitraryValue, splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\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 messages: {\n unnecessaryArbitrary:\n '\"{{className}}\" can be written as \"{{replacement}}\". Use the named class instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\n if (!ds) return\n const { cache } = ds\n for (const loc of locations) {\n const classes = splitClasses(loc.value)\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n if (!hasArbitraryValue(cls)) continue\n\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for lookup — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n const named = cache.getNamedEquivalent(bareUtility)\n if (!named) continue\n\n offending.push({\n cls,\n replacement:\n variant + (hasImportantPrefix ? '!' : '') + named + (hasImportantSuffix ? '!' : ''),\n })\n }\n\n if (offending.length === 0) continue\n\n const replacements = new Map(offending.map(({ cls, replacement }) => [cls, replacement]))\n const fixedValue = classes.map((cls) => replacements.get(cls) ?? cls).join(' ')\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: 'unnecessaryArbitrary',\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: 'unnecessaryArbitrary',\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 { 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'\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 },\n})\n\nexport default plugin\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,SAAgB,eAAe,KAAoB,OAAuB;AACxE,KAAI,IAAI,wBAAwB,CAAC,MAAM,WAAW,IAAI,CAAE,SAAQ,IAAI;AACpE,KAAI,IAAI,yBAAyB,CAAC,MAAM,SAAS,IAAI,CAAE,SAAQ,GAAG,MAAM;AACxE,QAAO;;AAYT,MAAa,2BAA4C;CACvD,YAAY,CAAC,aAAa,QAAQ;CAClC,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;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RIPT","worker","controlArray","lengthView","dataArea","initialized","available","currentCssPath","ensureService","cleanup"],"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/floating-point.ts","../src/utils/class-parser.ts","../src/design-system/cache.ts","../src/design-system/sync-loader.ts","../src/design-system/auto-detect.ts","../src/design-system/debug.ts","../src/design-system/loader.ts","../src/types.ts","../src/rules/no-deprecated-classes.ts","../src/rules/no-unknown-classes.ts","../src/rules/no-conflicting-classes.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/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\nlet _cachedConfig: ExtractorConfig | null = null\nlet _settingsResolved = false\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, merging defaults with user settings from\n * `settings.tailwindcss`. Caches after the first successful settings read.\n * Falls back to DEFAULT_EXTRACTOR_CONFIG if settings are unavailable.\n */\nexport function getExtractorConfig(context: {\n settings?: Readonly<Record<string, unknown>>\n}): ExtractorConfig {\n if (_settingsResolved) return _cachedConfig!\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 _settingsResolved = true\n } catch {\n // createOnce — settings not available yet, return defaults without caching\n return DEFAULT_EXTRACTOR_CONFIG\n }\n\n if (!tw) {\n _cachedConfig = DEFAULT_EXTRACTOR_CONFIG\n return _cachedConfig\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 _cachedConfig = {\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 return _cachedConfig\n}\n\n/** Reset cached config — for test isolation */\nexport function resetExtractorConfig(): void {\n _cachedConfig = null\n _settingsResolved = false\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 results.push(...extractFromExpression(arg))\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 results.push(...extractFromExpression(prop.value))\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 results.push(...extractFromExpression(arg))\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 results.push(...extractFromExpression(arg))\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 results.push(...extractFromExpression(variant.value))\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 results.push(...extractFromExpression(prop.value))\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 results.push(...extractFromExpression(arg))\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 results.push(...extractFromExpression(prop.value))\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 results.push(...extractFromExpression(slot.value))\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 results.push(...extractFromExpression(slotProp.value))\n }\n }\n } else {\n results.push(...extractFromExpression(variant.value))\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 results.push(...extractFromExpression(prop.value))\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 results.push(...extractFromExpression(prop.value))\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\nfunction extractFromExpression(node: ESTree.Node): ClassLocation[] {\n if (node.type === 'Literal' && typeof node.value === 'string') {\n return [\n {\n value: node.value,\n node,\n range: [node.range[0] + 1, node.range[1] - 1],\n },\n ]\n }\n\n if (node.type === 'TemplateLiteral') {\n return extractFromTemplateLiteral(node as ESTree.TemplateLiteral)\n }\n\n if (node.type === 'ConditionalExpression') {\n return [\n ...extractFromExpression((node as ESTree.ConditionalExpression).consequent),\n ...extractFromExpression((node as ESTree.ConditionalExpression).alternate),\n ]\n }\n\n if (node.type === 'LogicalExpression') {\n return extractFromExpression((node as ESTree.LogicalExpression).right)\n }\n\n // Objects: cn({ \"bg-red-500\": isError }) — extract the keys\n if (node.type === 'ObjectExpression') {\n const results: ClassLocation[] = []\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 results.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 results\n }\n\n return []\n}\n\nfunction extractFromTemplateLiteral(node: ESTree.TemplateLiteral): ClassLocation[] {\n const results: 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 results.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 results\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 * 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","/**\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 * 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","import { type PrecomputedData } from './sync-loader'\nimport { roundRemValue } from '../utils/floating-point'\nimport { extractUtility, extractVariants, hasArbitraryValue } from '../utils/class-parser'\n\n/** Strip `!` modifier from start or end: `!flex` → `flex`, `flex!` → `flex` */\nfunction stripImportant(cls: string): { bare: string; important: boolean } {\n if (cls.startsWith('!')) return { bare: cls.slice(1), important: true }\n if (cls.endsWith('!')) return { bare: cls.slice(0, -1), important: true }\n return { bare: cls, important: false }\n}\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\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 }\n }\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 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, important } = stripImportant(utility)\n if (important) {\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 const isPrefix = utility.startsWith('!')\n return isPrefix ? variantPrefix + '!' + canonicalBare : 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 /** 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 // Find first matching class in the order map\n for (const [cls, order] of this.orderMap) {\n if (cls.startsWith(prefix) && order != null) return order\n }\n return undefined\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 } = stripImportant(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 getOrder(className: string): bigint | null {\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, important } = stripImportant(utility)\n if (important) {\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, important } = stripImportant(base)\n if (important) {\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 = stripImportant(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 = stripImportant(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 = stripImportant(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, important } = stripImportant(className)\n if (important) 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, important } = stripImportant(className)\n if (important) return this.arbitraryEquivMap.get(bare) ?? null\n return null\n }\n}\n","/**\n * Synchronous design system loader using execFileSync.\n *\n * The problem: __unstable__loadDesignSystem is async, but oxlint's createOnce is sync.\n * The solution: spawn a child process that loads the design system, pre-computes all\n * data we need, and returns it as JSON via stdout. This runs ONCE at plugin init time.\n *\n * For arbitrary values (bg-[#123]) that aren't in the class list, we use heuristics.\n */\n\nimport { execFileSync } from 'node:child_process'\nimport { createHash } from 'node:crypto'\nimport { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'\nimport { dirname, join, resolve } from 'node:path'\nimport { tmpdir } from 'node:os'\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\nconst PRECOMPUTE_SCRIPT = `\n// Resolve @tailwindcss/node via an absolute path passed in by the parent\n// process — bare-specifier lookup from this child's cwd fails under pnpm\n// strict workspaces (the module lives under node_modules/.pnpm/... which\n// is not on the resolution path from the consumer's project root).\nconst { __unstable__loadDesignSystem } = require(process.env.TAILWIND_NODE_PATH);\nconst { readFileSync } = 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 = process.env.TAILWIND_CSS_PATH;\n const css = readFileSync(cssPath, 'utf-8');\n const base = dirname(cssPath);\n const ds = await __unstable__loadDesignSystem(css, { base });\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\n const cssResults = ds.candidatesToCss(classNames);\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);\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([cls]);\n if (result[0] && result[0] !== cls) {\n canonical[cls] = result[0];\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);\n for (const [name, val] of orderResults) {\n if (val !== null) order[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 const props = extractRootCssProps(cssResults[i], 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 componentClasses.push(acm[1]);\n }\n }\n }\n\n // Arbitrary equivalents: map arbitrary forms to named equivalents\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 const lastDash = cls.lastIndexOf('-');\n if (lastDash <= 0) continue;\n const prefix = cls.slice(0, lastDash);\n candidates.push({ arbitraryForm: prefix + '-[' + value + ']', namedCls: cls, namedCss: cssText });\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 const arbResults = ds.candidatesToCss(arbForms);\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 process.stdout.write(JSON.stringify({ validClasses, canonical, order, cssProps, variantOrder, componentClasses, arbitraryEquivalents }));\n}\nmain().catch(e => { process.stderr.write(e.message); process.exit(1); });\n`\n\nconst CACHE_DIR = join(tmpdir(), 'oxlint-tailwindcss')\n\n// Bump this when precompute logic changes to invalidate disk cache\nconst CACHE_VERSION = 11\n\n/**\n * Two-level disk cache for monorepo deduplication:\n *\n * Level 1 — mtime index (.idx): maps path+mtime → content hash (fast-path, avoids reading CSS)\n * Level 2 — content cache (.json): maps content hash → precomputed data (shared across packages)\n *\n * In monorepos, multiple packages with identical CSS (e.g. `@import 'tailwindcss'`) at different\n * paths share a single content cache entry, avoiding redundant child process spawns.\n */\n\nfunction getMtimeIndexPath(cssPath: string, mtime: number): string {\n const hash = createHash('md5').update(`v${CACHE_VERSION}:${cssPath}:${mtime}`).digest('hex')\n return join(CACHE_DIR, `${hash}.idx`)\n}\n\nfunction computeContentHash(content: string): string {\n return createHash('md5').update(`v${CACHE_VERSION}:${content}`).digest('hex')\n}\n\nfunction getContentCachePath(contentHash: string): string {\n return join(CACHE_DIR, `${contentHash}.json`)\n}\n\nfunction tryReadCache(cachePath: string): PrecomputedData | null {\n try {\n return JSON.parse(readFileSync(cachePath, 'utf-8')) as PrecomputedData\n } catch {\n return null\n }\n}\n\nfunction writeCacheFiles(\n contentCachePath: string,\n mtimeIndexPath: string,\n contentHash: string,\n data: string,\n): void {\n try {\n mkdirSync(CACHE_DIR, { recursive: true })\n writeFileSync(contentCachePath, data)\n writeFileSync(mtimeIndexPath, contentHash)\n } catch {\n // Non-fatal — cache is optional\n }\n}\n\nexport function loadDesignSystemSync(cssPath: string, timeout?: number): PrecomputedData | null {\n const resolvedPath = resolve(cssPath)\n\n try {\n const mtime = statSync(resolvedPath).mtimeMs\n const mtimeIndexPath = getMtimeIndexPath(resolvedPath, mtime)\n\n // Fast path: mtime index exists → read content hash → look up content cache\n if (existsSync(mtimeIndexPath)) {\n try {\n const contentHash = readFileSync(mtimeIndexPath, 'utf-8').trim()\n const contentCachePath = getContentCachePath(contentHash)\n const cached = tryReadCache(contentCachePath)\n if (cached) return cached\n } catch {\n // Index corrupted, fall through\n }\n }\n\n // Slow path: read CSS content, compute content hash\n const content = readFileSync(resolvedPath, 'utf-8')\n const contentHash = computeContentHash(content)\n const contentCachePath = getContentCachePath(contentHash)\n\n // Check content cache — another package with identical CSS may have already computed this\n const cached = tryReadCache(contentCachePath)\n if (cached) {\n // Content cache hit (monorepo deduplication) — just write the mtime index\n try {\n mkdirSync(CACHE_DIR, { recursive: true })\n writeFileSync(mtimeIndexPath, contentHash)\n } catch {\n // Non-fatal\n }\n return cached\n }\n\n // Resolve @tailwindcss/node from the plugin's own location and pass it to\n // the child via env. Bare-specifier resolution from the child's cwd would\n // fail under pnpm strict workspaces where the consumer's project root has\n // no direct access to the plugin's transitive deps.\n const tailwindNodePath = require.resolve('@tailwindcss/node')\n\n // Full computation: spawn child process\n const stdout = execFileSync(process.execPath, ['-e', PRECOMPUTE_SCRIPT], {\n encoding: 'utf-8',\n timeout: timeout ?? 30_000,\n maxBuffer: 50 * 1024 * 1024,\n env: {\n ...process.env,\n TAILWIND_CSS_PATH: resolvedPath,\n TAILWIND_NODE_PATH: tailwindNodePath,\n },\n cwd: dirname(resolvedPath),\n })\n\n // Write both cache levels\n writeCacheFiles(contentCachePath, mtimeIndexPath, contentHash, stdout)\n\n return JSON.parse(stdout) as PrecomputedData\n } catch (error) {\n const msg = error instanceof Error ? error.message : String(error)\n // Surface the pnpm/npm hoisting failure mode with an actionable hint\n // instead of a raw \"Cannot find module '@tailwindcss/node'\" stack.\n if (msg.includes(\"Cannot find module '@tailwindcss/node'\")) {\n console.error(\n `[oxlint-tailwindcss] Could not resolve '@tailwindcss/node' for \"${resolvedPath}\". ` +\n `If you are using pnpm with strict hoisting, add '@tailwindcss/node' as a direct devDependency, ` +\n `or upgrade oxlint-tailwindcss to >= 0.7.0 which resolves it from the plugin's own install location. ` +\n `DS-dependent rules will be skipped for this file.`,\n )\n } else {\n console.error(\n `[oxlint-tailwindcss] Failed to load design system from \"${resolvedPath}\":`,\n msg,\n )\n }\n return null\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","import { existsSync, readFileSync } from 'node:fs'\nimport { dirname, join, resolve } from 'node:path'\n\nconst IMPORT_RE = /@import\\s+['\"]([^'\"]+)['\"]/g\n\n/**\n * Resolves a CSS @import specifier to an absolute path.\n * Handles relative paths and package imports (walks up to node_modules).\n */\nfunction resolveImport(specifier: string, baseDir: string): string | null {\n if (specifier.startsWith('.')) return resolve(baseDir, specifier)\n\n // Package import — walk up looking for node_modules\n let dir = baseDir\n while (true) {\n const candidate = join(dir, 'node_modules', specifier)\n if (existsSync(candidate)) return candidate\n const parent = dirname(dir)\n if (parent === dir) break\n dir = parent\n }\n return null\n}\n\n/**\n * Checks if any @import in the CSS content points to a file containing a Tailwind signal.\n * Only follows ONE level of imports — no recursion.\n */\nfunction hasTailwindSignalInImports(content: string, baseDir: string, signals: string[]): boolean {\n IMPORT_RE.lastIndex = 0\n let match\n while ((match = IMPORT_RE.exec(content)) !== null) {\n const specifier = match[1]\n if (specifier === 'tailwindcss') continue\n\n const resolved = resolveImport(specifier, baseDir)\n if (!resolved) continue\n\n try {\n const imported = readFileSync(resolved, 'utf-8')\n if (signals.some((signal) => imported.includes(signal))) return true\n } catch {\n continue\n }\n }\n return false\n}\n\nexport const CANDIDATE_DIRS = [\n 'src',\n '.',\n 'app',\n 'styles',\n 'style',\n 'css',\n 'assets',\n 'assets/css',\n 'resources/css',\n]\nexport const CANDIDATE_NAMES = [\n 'app',\n 'globals',\n 'global',\n 'style',\n 'styles',\n 'index',\n 'main',\n 'tailwind',\n 'tailwindcss',\n]\n\nconst CANDIDATE_PATHS = CANDIDATE_DIRS.flatMap((dir) =>\n CANDIDATE_NAMES.map((name) => (dir === '.' ? `${name}.css` : `${dir}/${name}.css`)),\n)\n\nconst TAILWIND_SIGNALS = [\n '@import \"tailwindcss\"',\n \"@import 'tailwindcss'\",\n '@tailwind base',\n '@import tailwindcss',\n]\n\n/**\n * Searches for the Tailwind CSS entry point by walking UP from the file\n * being linted. Monorepo-aware: stops at package.json boundaries.\n */\nexport function autoDetectEntryPoint(filePath?: string): string | null {\n const startDir = filePath ? dirname(resolve(filePath)) : process.cwd()\n let currentDir = startDir\n\n for (let depth = 0; depth < 20; depth++) {\n for (const candidate of CANDIDATE_PATHS) {\n const fullPath = join(currentDir, candidate)\n if (!existsSync(fullPath)) continue\n\n try {\n const content = readFileSync(fullPath, 'utf-8')\n if (TAILWIND_SIGNALS.some((signal) => content.includes(signal))) {\n return fullPath\n }\n if (hasTailwindSignalInImports(content, dirname(fullPath), TAILWIND_SIGNALS)) {\n return fullPath\n }\n } catch {\n continue\n }\n }\n\n // If current directory has package.json, we've reached the package root — stop\n if (existsSync(join(currentDir, 'package.json'))) break\n\n const parentDir = dirname(currentDir)\n if (parentDir === currentDir) break\n\n currentDir = parentDir\n }\n\n return null\n}\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","import { DesignSystemCache } from './cache'\nimport { loadDesignSystemSync } from './sync-loader'\nimport { autoDetectEntryPoint } from './auto-detect'\nimport { debugLog, isDebugEnabled, setDebugEnabled, resetDebug } from './debug'\nimport { statSync } from 'node:fs'\nimport { dirname, resolve, relative } from 'node:path'\n\nexport interface LoadResult {\n cache: DesignSystemCache\n entryPoint: string\n}\n\n// Per-entry-point DS cache — supports multiple design systems in monorepos\nconst dsCache = new Map<string, { cache: DesignSystemCache; mtime: number }>()\n\n// Auto-detect result cache by directory — avoids repeated filesystem walks\nconst autoDetectCache = new Map<string, string | null>()\n\n// Fallback path — only set by explicit entryPoint calls (tests, rule options),\n// never by auto-detect. Prevents cross-package contamination in monorepos.\nlet lastLoadedPath: string | null = null\n\n/**\n * Extracts `entryPoint` from `context.settings.tailwindcss`.\n * Supports both `string` and `string[]` (for monorepos).\n */\nfunction entryPointFromSettings(\n settings?: Readonly<Record<string, unknown>>,\n): string | string[] | undefined {\n const tw = settings?.tailwindcss\n if (tw && typeof tw === 'object' && 'entryPoint' in tw) {\n const ep = (tw as Record<string, unknown>).entryPoint\n if (typeof ep === 'string') return ep\n if (Array.isArray(ep) && ep.length > 0 && ep.every((e) => typeof e === 'string')) {\n return ep as string[]\n }\n }\n return undefined\n}\n\n/**\n * Given an array of entry points and a file path, pick the one that shares\n * the longest common directory prefix with the file. Falls back to first entry.\n */\nfunction resolveClosestEntryPoint(entryPoints: string[], filePath?: string): string {\n if (entryPoints.length === 1 || !filePath) return entryPoints[0]\n\n const fileDir = dirname(resolve(filePath))\n let best = entryPoints[0]\n let bestLen = 0\n\n for (const ep of entryPoints) {\n const epDir = dirname(resolve(ep))\n // Count shared path prefix length\n const len = commonPrefixLength(fileDir, epDir)\n if (len > bestLen) {\n bestLen = len\n best = ep\n }\n }\n\n return best\n}\n\nfunction commonPrefixLength(a: string, b: string): number {\n const len = Math.min(a.length, b.length)\n let i = 0\n while (i < len && a[i] === b[i]) i++\n return i\n}\n\n/**\n * Extracts `rootFontSize` from `context.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\n/**\n * Extracts `timeout` from `context.settings.tailwindcss`.\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 * Cached auto-detect: caches by directory since all files in the same directory\n * resolve to the same entry point. Avoids repeated filesystem walks.\n */\nfunction cachedAutoDetect(filePath?: string): string | null {\n if (!filePath) return autoDetectEntryPoint(filePath)\n const dir = dirname(resolve(filePath))\n const cached = autoDetectCache.get(dir)\n if (cached !== undefined) return cached\n const result = autoDetectEntryPoint(filePath)\n autoDetectCache.set(dir, result)\n return result\n}\n\n/**\n * Returns the design system cache, loading synchronously on first call.\n * Uses execFileSync internally to bridge the async Tailwind API.\n *\n * Supports multiple design systems: each unique CSS entry point gets its own cache.\n * In monorepos, files in different packages auto-detect to different entry points\n * and each gets the correct DS.\n *\n * Resolution order: rule option `entryPoint` > `settings.tailwindcss.entryPoint` > auto-detect.\n */\nexport function getLoadedDesignSystem(\n entryPoint?: string,\n settings?: Readonly<Record<string, unknown>>,\n filePath?: string,\n): LoadResult | null {\n // Explicit entry points (rule option or settings) update the fallback path.\n // Auto-detect results do NOT — this prevents cross-package contamination in monorepos.\n const settingsEntry = entryPointFromSettings(settings)\n const explicitEntry =\n entryPoint ??\n (Array.isArray(settingsEntry)\n ? resolveClosestEntryPoint(settingsEntry, filePath)\n : settingsEntry)\n const cssPath = explicitEntry ?? cachedAutoDetect(filePath) ?? lastLoadedPath\n if (!cssPath) return null\n\n const resolvedPath = resolve(cssPath)\n\n try {\n const mtime = statSync(resolvedPath).mtimeMs\n const cached = dsCache.get(resolvedPath)\n if (cached && cached.mtime === mtime) {\n if (explicitEntry) lastLoadedPath = resolvedPath\n return { cache: cached.cache, entryPoint: resolvedPath }\n }\n\n const data = loadDesignSystemSync(resolvedPath, timeoutFromSettings(settings))\n if (!data) return null\n\n const cache = DesignSystemCache.fromPrecomputed(data)\n dsCache.set(resolvedPath, { cache, mtime })\n debugLog(`Loaded design system from \"${resolvedPath}\"`)\n if (explicitEntry) lastLoadedPath = resolvedPath\n return { cache, entryPoint: resolvedPath }\n } catch {\n return null\n }\n}\n\n/**\n * Creates a lazy DS loader that resolves the correct design system per file.\n *\n * In `createOnce`, `context.settings` and `context.filename` throw. When visitors\n * run, they become available. The loader re-resolves when the filename changes,\n * supporting monorepos where different files need different design systems.\n *\n * When a fixed entryPoint is provided (rule option or settings), it's used for all\n * files and cached after first resolution.\n */\nexport function createLazyLoader(context: {\n options?: readonly unknown[]\n settings?: Readonly<Record<string, unknown>>\n filename?: string\n}): () => LoadResult | null {\n let lastFilePath: string | undefined\n let lastResult: LoadResult | null = null\n let fixedEntryResolved = false\n let fixedResult: LoadResult | null = null\n let debugInitialized = false\n\n return () => {\n let entryPoint: string | undefined\n try {\n const opts = context.options?.[0] as { entryPoint?: string } | undefined\n entryPoint = opts?.entryPoint\n } catch {}\n\n let settings: Readonly<Record<string, unknown>> | undefined\n try {\n settings = context.settings\n } catch {}\n\n let filePath: string | undefined\n try {\n filePath = context.filename\n } catch {}\n\n // Initialize debug from settings on first successful access\n if (!debugInitialized && settings) {\n debugInitialized = true\n setDebugEnabled(isDebugEnabled(settings))\n }\n\n // Fixed entry point (rule option or settings) — same for all files\n const settingsEntry = entryPointFromSettings(settings)\n const fixedEntry = entryPoint ?? (typeof settingsEntry === 'string' ? settingsEntry : undefined)\n if (fixedEntry) {\n if (fixedEntryResolved) return fixedResult\n fixedEntryResolved = true\n fixedResult = getLoadedDesignSystem(fixedEntry, settings, filePath)\n if (fixedResult && filePath) {\n debugLog(\n `${relative(process.cwd(), filePath)} → ${relative(process.cwd(), fixedResult.entryPoint)}`,\n )\n }\n return fixedResult\n }\n\n // Array entry point from settings — resolve closest per file\n if (Array.isArray(settingsEntry)) {\n const closest = resolveClosestEntryPoint(settingsEntry, filePath)\n // Re-resolve when the file changes (different file may map to different entry)\n if (filePath && filePath === lastFilePath) return lastResult\n if (filePath) lastFilePath = filePath\n lastResult = getLoadedDesignSystem(closest, settings, filePath)\n if (lastResult && filePath) {\n debugLog(\n `${relative(process.cwd(), filePath)} → ${relative(process.cwd(), lastResult.entryPoint)}`,\n )\n }\n return lastResult\n }\n\n // Auto-detect mode: re-resolve when the file changes\n if (filePath && filePath === lastFilePath) return lastResult\n if (filePath) lastFilePath = filePath\n\n lastResult = getLoadedDesignSystem(undefined, settings, filePath)\n if (lastResult && filePath) {\n debugLog(\n `${relative(process.cwd(), filePath)} → ${relative(process.cwd(), lastResult.entryPoint)}`,\n )\n }\n return lastResult\n }\n}\n\n/**\n * Resets all DS caches (useful for tests).\n */\nexport function resetDesignSystem(): void {\n dsCache.clear()\n autoDetectCache.clear()\n lastLoadedPath = null\n resetDebug()\n}\n","export interface ExtractorExclusions {\n /** Default attribute names to exclude */\n attributes?: string[]\n /** Default callee names to exclude */\n callees?: string[]\n /** Default tag names to exclude */\n tags?: string[]\n /** Default variable pattern regex sources to exclude (matched against RegExp.source) */\n variablePatterns?: string[]\n}\n\nexport interface PluginSettings {\n /** CSS entry point. String for single project, array for monorepos (closest to file wins). */\n entryPoint?: string | string[]\n /** Enable debug logging to stderr (also activable via DEBUG=oxlint-tailwindcss env var) */\n debug?: boolean\n /** Root font size in pixels for px→named conversion (default: 16). Used by enforce-canonical. */\n rootFontSize?: number\n /** Timeout in milliseconds for design system loading (default: 30000) */\n timeout?: number\n /** Additional JSX attribute names to scan for Tailwind classes (added to defaults) */\n attributes?: string[]\n /** Additional function names to scan for Tailwind classes (added to defaults) */\n callees?: string[]\n /** Additional tagged template tag names to scan (added to defaults) */\n tags?: string[]\n /** Additional regex patterns (as strings) for variable names to scan (added to defaults) */\n variablePatterns?: string[]\n /** Remove specific items from the built-in defaults */\n exclude?: ExtractorExclusions\n}\n\nexport interface RuleOptions {\n entryPoint?: string\n}\n\n/**\n * Safely read context.options.\n *\n * In oxlint, `context.options` is `null` inside `createOnce()` — options are\n * only populated when visitors run. Call this lazily (inside `check()` or a\n * visitor) to get the user's configured options.\n *\n * In oxlint <1.31.0 the getter may throw — the try/catch handles that.\n */\nexport function safeOptions<T = Record<string, unknown>>(context: {\n options?: readonly unknown[]\n}): 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.\n *\n * Like `safeOptions`, `context.settings` may not be accessible in `createOnce()`.\n * The try/catch handles that gracefully.\n */\nexport function safeSettings(context: {\n settings?: Readonly<Record<string, unknown>>\n}): Readonly<Record<string, unknown>> | undefined {\n try {\n return context.settings ?? undefined\n } catch {\n return undefined\n }\n}\n\n/**\n * Safely read context.filename.\n *\n * Like `safeSettings`, `context.filename` may not be accessible in `createOnce()`.\n */\nexport function safeFilename(context: { filename?: string }): string | undefined {\n try {\n return context.filename ?? undefined\n } catch {\n return undefined\n }\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'\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 messages: {\n deprecated: '\"{{className}}\" is deprecated in Tailwind v4. Use \"{{replacement}}\" instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n const dsResult = getDS()\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 { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for lookup — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n const replacement = DEPRECATED_MAP[bareUtility]\n if (!replacement) continue\n\n // If we have a design system, verify with canonicalize\n if (dsResult) {\n const canonical = dsResult.cache.canonicalize(bareUtility)\n if (canonical !== bareUtility && canonical === replacement) {\n // Confirmed by the design system\n }\n }\n\n const fullReplacement =\n variant +\n (hasImportantPrefix ? '!' : '') +\n replacement +\n (hasImportantSuffix ? '!' : '')\n offending.push({ cls, replacement: fullReplacement })\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: 'deprecated',\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: 'deprecated',\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 { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { findBestSuggestion } from '../utils/levenshtein'\nimport { createLazyLoader } from '../design-system/loader'\nimport { safeOptions } from '../types'\nimport { DEPRECATED_MAP } from './no-deprecated-classes'\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 suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n let _allowlist: Set<string> | null = null\n let _ignorePrefixes: string[] | null = null\n function getLazyOptions() {\n if (_allowlist === null) {\n const opts = safeOptions<Options>(context)\n _allowlist = new Set(opts?.allowlist ?? [])\n _ignorePrefixes = opts?.ignorePrefixes ?? []\n }\n return { allowlist: _allowlist, ignorePrefixes: _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 // Strip ! (important) for validation — prefix or suffix form\n let stripped = className\n if (stripped.startsWith('!')) stripped = stripped.slice(1)\n if (stripped.endsWith('!')) stripped = stripped.slice(0, -1)\n return stripped\n }\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\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 stripped = stripModifiers(cls)\n if (cache.isValid(stripped)) continue\n\n // Don't report deprecated classes — no-deprecated-classes handles those\n if (DEPRECATED_MAP[stripped]) continue\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","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { extractUtility, getVariantPrefix } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\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 messages: {\n conflict:\n '\"{{classA}}\" and \"{{classB}}\" affect {{properties}}. \"{{winner}}\" takes precedence (appears later).',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\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 let utility = extractUtility(cls)\n // Strip ! (important) for lookup — prefix or suffix\n if (utility.startsWith('!')) utility = utility.slice(1)\n else if (utility.endsWith('!')) utility = utility.slice(0, -1)\n const props = cache.getCssProperties(utility)\n propsMap.set(cls, props)\n }\n\n // Utilities that share a CSS property but are designed to compose.\n // Most composition is detected automatically via CSS custom properties\n // (see isCompositionViaCssVars below). These groups cover cases where\n // the heuristic fails: shared intermediate vars or missing custom props.\n const COMPLEMENTARY_GROUPS = [\n /^(?:from|via|to)-/, // gradient stops (share --tw-gradient-stops)\n /^(?:transition|duration|ease|delay)(?:-|$)/, // transition composition (transition-all has no custom vars)\n /^-?(?:translate|scale|rotate|skew)-/, // transform axis composition (overlap not in cssProps)\n /^prose(?:-|$)/, // prose + prose-sm/lg/xl modifiers\n ]\n // Pairs where one utility sets defaults and the other overrides a specific property\n const COMPOSITION_PAIRS: [RegExp, RegExp][] = [\n [/^text-/, /^leading-/], // text-sm sets line-height, leading-* overrides\n [/^text-/, /^tracking-/], // text-* sets letter-spacing, tracking-* overrides\n [/^border(?:-[0-9]|$)/, /^border-(?:solid|dashed|dotted|double|hidden|none)$/], // border width + style\n [/^divide-/, /^border(?:-[trblxyse])?-/], // divide-* targets children\n [/^prose(?:-|$)/, /^max-w-/], // prose sets max-width, max-w-* overrides\n ]\n\n // Detect composition via CSS custom properties: if both classes use\n // custom properties (--tw-*) but none overlap, they compose into a\n // shared shorthand (e.g. shadow + ring both set box-shadow via different vars).\n function isCompositionViaCssVars(propsA: string[], propsB: string[]): 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 function shouldSkipPair(\n a: string,\n b: string,\n propsA: string[],\n propsB: string[],\n ): boolean {\n // CSS custom property composition (handles shadow/ring, filter, contain, etc.)\n if (isCompositionViaCssVars(propsA, propsB)) return true\n\n let ua = extractUtility(a)\n let ub = extractUtility(b)\n if (ua.startsWith('!')) ua = ua.slice(1)\n else if (ua.endsWith('!')) ua = ua.slice(0, -1)\n if (ub.startsWith('!')) ub = ub.slice(1)\n else if (ub.endsWith('!')) ub = ub.slice(0, -1)\n // Complementary utilities within the same group\n for (const re of COMPLEMENTARY_GROUPS) {\n if (re.test(ua) && re.test(ub)) return true\n }\n // Composition pairs where one sets defaults and the other overrides\n for (const [reA, reB] of COMPOSITION_PAIRS) {\n if ((reA.test(ua) && reB.test(ub)) || (reA.test(ub) && reB.test(ua))) return true\n }\n return false\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 * Persistent canonicalize service using worker_threads + SharedArrayBuffer.\n *\n * Calls `ds.canonicalizeCandidates([cls], { rem })` dynamically via a worker\n * thread. Same pattern as sort-service.ts — loads the DS once, then accepts\n * requests synchronously via Atomics.wait().\n *\n * This enables canonicalization of arbitrary user classes (e.g. `p-[2px]` → `p-0.5`)\n * which can't be precomputed because the input space is infinite.\n *\n * ## Per-class cache (process-wide)\n *\n * Results are cached by `cssPath\\0rem\\0class`. The worker is invoked only for\n * cache misses. In practice the cache converges quickly — after the first few\n * files any given class has been seen, and every subsequent lookup is O(1).\n *\n * ## Per-class worker calls\n *\n * `ds.canonicalizeCandidates` deduplicates its input (see sync-loader.ts note),\n * so the worker MUST call it one class at a time to preserve input order/length.\n * The cache amortizes the per-call overhead.\n */\n\nimport { Worker } from 'node:worker_threads'\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 = 30_000\nconst REQUEST_TIMEOUT = 10_000\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, ${HEADER_INTS});\n const lengthView = new DataView(sharedBuffer, ${HEADER_INTS * 4}, 4);\n const dataArea = new Uint8Array(sharedBuffer, ${DATA_OFFSET});\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 // Signal ready\n Atomics.store(control, 2, 1);\n Atomics.notify(control, 2);\n\n // Request loop\n while (true) {\n Atomics.wait(control, 0, 0);\n\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\n Atomics.store(control, 1, 1);\n Atomics.notify(control, 1);\n }\n}\nmain();\n`\n\nlet worker: Worker | null = null\nlet controlArray: Int32Array | null = null\nlet lengthView: DataView | null = null\nlet dataArea: Uint8Array | null = null\nlet initialized = false\nlet available = true\nlet currentCssPath: string | null = null\n\n// Process-wide cache of canonicalized classes.\n// Key: `${cssPath}\\0${rem}\\0${className}` — isolates monorepos (multiple DSs)\n// and different rem settings. Value: canonicalized class string.\nconst canonCache = new Map<string, string>()\n\nfunction ensureService(cssPath: string): boolean {\n if (initialized && currentCssPath === cssPath) return available\n\n if (initialized) {\n cleanup()\n initialized = false\n available = true\n controlArray = null\n lengthView = null\n dataArea = null\n }\n\n initialized = true\n currentCssPath = cssPath\n\n try {\n const tailwindNodePath = require.resolve('@tailwindcss/node')\n\n const sharedBuffer = new SharedArrayBuffer(BUFFER_SIZE)\n controlArray = new Int32Array(sharedBuffer, 0, HEADER_INTS)\n lengthView = new DataView(sharedBuffer, HEADER_INTS * 4, 4)\n dataArea = new Uint8Array(sharedBuffer, DATA_OFFSET)\n\n worker = new Worker(WORKER_SCRIPT, {\n eval: true,\n workerData: { sharedBuffer, cssPath, tailwindNodePath },\n })\n\n worker.unref()\n\n worker.on('error', () => {\n available = false\n worker = null\n })\n worker.on('exit', () => {\n worker = null\n })\n\n const result = Atomics.wait(controlArray, 2, 0, INIT_TIMEOUT)\n if (result === 'timed-out' || controlArray[2] === -1) {\n available = false\n cleanup()\n return false\n }\n\n // `worker.unref()` handles process exit; no exit listener (see exit-listeners.test.ts).\n return true\n } catch {\n available = false\n cleanup()\n return false\n }\n}\n\nfunction cleanup(): void {\n if (worker) {\n try {\n worker.terminate()\n } catch {}\n worker = null\n }\n}\n\n/**\n * Round-trip raw worker call for a batch of classes (no caching).\n * Returns the canonicalized class array (same length/order as input),\n * or null if the service is unavailable.\n */\nfunction callWorker(classes: string[], rem?: number): string[] | null {\n if (!controlArray || !dataArea || !lengthView) return null\n\n try {\n const request = Buffer.from(JSON.stringify({ classes, rem }), 'utf-8')\n if (request.length > BUFFER_SIZE - DATA_OFFSET) return null\n\n dataArea.set(request, 0)\n lengthView.setUint32(0, request.length)\n\n Atomics.store(controlArray, 0, 1)\n Atomics.notify(controlArray, 0)\n\n const result = Atomics.wait(controlArray, 1, 0, REQUEST_TIMEOUT)\n if (result === 'timed-out') {\n available = false\n cleanup()\n return null\n }\n\n const responseLen = lengthView.getUint32(0)\n const responseStr = Buffer.from(dataArea.slice(0, responseLen)).toString('utf-8')\n Atomics.store(controlArray, 1, 0)\n\n return JSON.parse(responseStr)\n } catch {\n available = false\n cleanup()\n return null\n }\n}\n\n/**\n * Canonicalize classes using the Tailwind CSS design system via worker thread.\n * Returns the canonicalized class array (same length/order as input), or null\n * if the service is unavailable.\n *\n * Uses a 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[] | null {\n if (!ensureService(cssPath)) return null\n\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 don't\n // need to canonicalize it twice. The per-class cache serves repeats in\n // subsequent calls, but within a single call the cache is still cold.\n const uniqueMissing = [...new Set(missing)]\n const fresh = callWorker(uniqueMissing, rem)\n if (!fresh || fresh.length !== uniqueMissing.length) return null\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/**\n * Reset the canonicalize service (for tests).\n */\nexport function resetCanonicalizeService(): void {\n cleanup()\n initialized = false\n available = true\n currentCssPath = null\n controlArray = null\n lengthView = null\n dataArea = null\n canonCache.clear()\n}\n","import { defineRule } from '@oxlint/plugins'\nimport { createExtractorVisitors, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { utilityHasDynamicValue } from '../utils/class-parser'\nimport { createLazyLoader, rootFontSizeFromSettings } from '../design-system/loader'\nimport { canonicalizeClassesSync } from '../design-system/canonicalize-service'\nimport { safeSettings } from '../types'\n\n/**\n * Preserve the user's ! position after canonicalization.\n * canonicalizeCandidates always normalizes ! to suffix, but\n * enforce-consistent-important-position handles that separately.\n */\nfunction preserveImportantPosition(original: string, canonicalized: string): string {\n const origHasPrefix = original.startsWith('!') || /^[a-z0-9[\\]*@-]*:!/.test(original)\n const origHasSuffix = original.endsWith('!') && !origHasPrefix\n\n if (!origHasPrefix && !origHasSuffix) {\n // Original has no ! — strip any ! the canonicalizer added\n return canonicalized.replace(/!/g, '')\n }\n\n // Strip ! from canonicalized, then re-add in original position\n const bare = canonicalized.replace(/!/g, '')\n if (origHasPrefix) {\n // Re-add ! after variant prefix (e.g. \"hover:!p-0.5\")\n const variantPrefix = bare.slice(0, bare.length - bare.replace(/^[a-z0-9[\\]*@-]*:/g, '').length)\n return variantPrefix + '!' + bare.slice(variantPrefix.length)\n }\n // Suffix\n return bare + '!'\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 messages: {\n nonCanonical: '\"{{className}}\" can be written as \"{{canonical}}\". Use the canonical form.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\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 const ds = getDS()\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 const dynamic = canonicalizeClassesSync(entryPoint, arbitrary, rem)\n if (dynamic) {\n for (let k = 0; k < arbitrary.length; k++) {\n canonicals[arbitraryIdx[k]] = preserveImportantPosition(arbitrary[k], dynamic[k])\n }\n } else {\n for (let k = 0; k < arbitrary.length; k++) {\n canonicals[arbitraryIdx[k]] = cache.canonicalize(arbitrary[k])\n }\n }\n }\n\n let firstNonCanonical = true\n\n for (let i = 0; i < classes.length; i++) {\n const cls = classes[i]\n const canonical = canonicals[i]\n if (canonical === cls) continue\n\n if (firstNonCanonical) {\n firstNonCanonical = false\n const fixedValue = rebuildClassString(split, canonicals)\n context.report({\n node: loc.node,\n messageId: 'nonCanonical',\n data: { className: cls, canonical },\n fix(fixer) {\n return fixer.replaceTextRange(loc.range, preserveSpaces(loc, fixedValue))\n },\n })\n } else {\n const fixedValue = rebuildClassString(split, canonicals)\n context.report({\n node: loc.node,\n messageId: 'nonCanonical',\n data: { className: cls, canonical },\n suggest: [\n {\n messageId: 'suggestReplace',\n data: { className: cls, replacement: canonical },\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","/**\n * Persistent sort service using worker_threads + SharedArrayBuffer.\n *\n * The problem: `ds.getClassOrder()` is the only way to get the exact official\n * Tailwind CSS sort order (matching oxfmt/prettier-plugin-tailwindcss), but the\n * design system is async to load and the oxlint plugin API is sync.\n *\n * The solution: spawn a Worker thread that loads the DS once, then accepts sort\n * requests via SharedArrayBuffer + Atomics. The parent uses `Atomics.wait()`\n * (with timeout) for synchronous blocking without risk of infinite hangs.\n *\n * Falls back gracefully if the worker fails to initialize within the timeout.\n */\n\nimport { Worker } from 'node:worker_threads'\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 = 30_000 // 30 s to load DS\nconst REQUEST_TIMEOUT = 10_000 // 10 s per sort request\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, ${HEADER_INTS});\n const lengthView = new DataView(sharedBuffer, ${HEADER_INTS * 4}, 4);\n const dataArea = new Uint8Array(sharedBuffer, ${DATA_OFFSET});\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 // Signal ready\n Atomics.store(control, 2, 1);\n Atomics.notify(control, 2);\n\n // Request loop\n while (true) {\n Atomics.wait(control, 0, 0); // wait for requestSignal !== 0\n\n const len = lengthView.getUint32(0);\n const requestStr = Buffer.from(dataArea.slice(0, len)).toString('utf-8');\n Atomics.store(control, 0, 0); // consume request\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\n Atomics.store(control, 1, 1); // signal response\n Atomics.notify(control, 1);\n }\n}\nmain();\n`\n\nlet worker: Worker | null = null\nlet controlArray: Int32Array | null = null\nlet lengthView: DataView | null = null\nlet dataArea: Uint8Array | null = null\nlet initialized = false\nlet available = true\nlet currentCssPath: string | null = null\n\nfunction ensureService(cssPath: string): boolean {\n // Same path → reuse existing worker\n if (initialized && currentCssPath === cssPath) return available\n\n // Different path → restart worker for the new DS\n if (initialized) {\n cleanup()\n initialized = false\n available = true\n controlArray = null\n lengthView = null\n dataArea = null\n }\n\n initialized = true\n currentCssPath = cssPath\n\n try {\n // Resolve @tailwindcss/node from the parent thread where the plugin's\n // dependencies are available, then pass the resolved path to the worker.\n // This avoids module resolution issues in VS Code's extension host.\n const tailwindNodePath = require.resolve('@tailwindcss/node')\n\n const sharedBuffer = new SharedArrayBuffer(BUFFER_SIZE)\n controlArray = new Int32Array(sharedBuffer, 0, HEADER_INTS)\n lengthView = new DataView(sharedBuffer, HEADER_INTS * 4, 4)\n dataArea = new Uint8Array(sharedBuffer, DATA_OFFSET)\n\n worker = new Worker(WORKER_SCRIPT, {\n eval: true,\n workerData: { sharedBuffer, cssPath, tailwindNodePath },\n })\n\n worker.unref()\n\n worker.on('error', () => {\n available = false\n worker = null\n })\n worker.on('exit', () => {\n worker = null\n })\n\n // Wait for DS to load (with timeout)\n const result = Atomics.wait(controlArray, 2, 0, INIT_TIMEOUT)\n if (result === 'timed-out' || controlArray[2] === -1) {\n available = false\n cleanup()\n return false\n }\n\n // `worker.unref()` handles process exit; no exit listener (see exit-listeners.test.ts).\n return true\n } catch {\n available = false\n cleanup()\n return false\n }\n}\n\nfunction cleanup(): void {\n if (worker) {\n try {\n worker.terminate()\n } catch {}\n worker = null\n }\n}\n\n/**\n * Sort classes using the official Tailwind CSS sort order via worker thread.\n * Returns the sorted class array, or null if the service is unavailable.\n */\nexport function sortClassesSync(cssPath: string, classes: string[]): string[] | null {\n if (!ensureService(cssPath)) return null\n if (!controlArray || !dataArea || !lengthView) return null\n\n try {\n const request = Buffer.from(JSON.stringify(classes), 'utf-8')\n if (request.length > BUFFER_SIZE - DATA_OFFSET) return null // too large\n\n dataArea.set(request, 0)\n lengthView.setUint32(0, request.length)\n\n // Signal request\n Atomics.store(controlArray, 0, 1)\n Atomics.notify(controlArray, 0)\n\n // Wait for response (with timeout)\n const result = Atomics.wait(controlArray, 1, 0, REQUEST_TIMEOUT)\n if (result === 'timed-out') {\n available = false\n cleanup()\n return null\n }\n\n // Read response\n const responseLen = lengthView.getUint32(0)\n const responseStr = Buffer.from(dataArea.slice(0, responseLen)).toString('utf-8')\n Atomics.store(controlArray, 1, 0) // consume response\n\n return JSON.parse(responseStr)\n } catch {\n available = false\n cleanup()\n return null\n }\n}\n\n/**\n * Reset the sort service (for tests).\n */\nexport function resetSortService(): void {\n cleanup()\n initialized = false\n available = true\n currentCssPath = null\n controlArray = null\n lengthView = null\n dataArea = null\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 { safeOptions } from '../types'\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 messages: {\n unsorted: 'Tailwind classes are not in the recommended order.',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n let _mode: 'default' | 'strict' | null = null\n function getMode(): 'default' | 'strict' {\n if (_mode === null) {\n const opts = safeOptions<Options>(context)\n _mode = opts?.mode ?? 'default'\n }\n return _mode\n }\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\n if (!ds) return\n const { cache, entryPoint } = ds\n const mode = getMode()\n\n function sortDefault(classes: string[]): string[] {\n // Use persistent child process for exact official Tailwind sort order\n const dynamic = sortClassesSync(entryPoint, classes)\n if (dynamic) return dynamic\n\n // Fallback to precomputed heuristic sort.\n // Null-order classes (group/name, peer/name) sort first — matches\n // the behavior of prettier-plugin-tailwindcss and oxfmt.\n const ordered = cache.getClassOrder(classes)\n const sorted = [...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 return sorted.map(([name]) => name)\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 const sortedGroupKeys = [...groups.keys()].sort((a, b) => {\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 = mode === 'strict' ? sortStrict(classes) : sortDefault(classes)\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'\n\nconst VALUE_RE = /^(?:m[trbl]|p[trbl]|[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: [`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 // 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 all unique values used in the classes\n // Strip ! (prefix or suffix) for regex matching\n const values = new Set<string>()\n for (const cls of classes) {\n const bare = cls.startsWith('!')\n ? cls.slice(1)\n : cls.endsWith('!')\n ? cls.slice(0, -1)\n : cls\n const match = VALUE_RE.exec(bare)\n if (match) values.add(match[1])\n }\n\n for (const value of values) {\n const rules = createShorthandRules(value)\n\n for (const rule of rules) {\n // Check with ! modifier: all parts must share the same modifier\n const hasImportantPrefix = rule.parts.every((p) => classSet.has(`!${p}`))\n const hasImportantSuffix =\n !hasImportantPrefix && rule.parts.every((p) => classSet.has(`${p}!`))\n const hasPlain = rule.parts.every((p) => classSet.has(p))\n\n if (!hasImportantPrefix && !hasImportantSuffix && !hasPlain) continue\n\n const importantStart = hasImportantPrefix ? '!' : ''\n const importantEnd = hasImportantSuffix ? '!' : ''\n const matchParts = rule.parts.map((p) => `${importantStart}${p}${importantEnd}`)\n const remaining = classes.filter((c) => !matchParts.includes(c))\n remaining.push(`${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: `${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","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'\n\n// Mapping of physical properties to logical ones\nexport const PHYSICAL_TO_LOGICAL: Record<string, string> = {\n ml: 'ms',\n mr: 'me',\n pl: 'ps',\n pr: 'pe',\n left: 'start',\n right: 'end',\n 'border-l': 'border-s',\n 'border-r': 'border-e',\n 'rounded-l': 'rounded-s',\n 'rounded-r': 'rounded-e',\n 'rounded-tl': 'rounded-ss',\n 'rounded-tr': 'rounded-se',\n 'rounded-bl': 'rounded-es',\n 'rounded-br': 'rounded-ee',\n 'scroll-ml': 'scroll-ms',\n 'scroll-mr': 'scroll-me',\n 'scroll-pl': 'scroll-ps',\n 'scroll-pr': 'scroll-pe',\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: [],\n hasSuggestions: true,\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 function convertClass(cls: string): string | null {\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for lookup — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n for (const [physical, logical] of Object.entries(PHYSICAL_TO_LOGICAL)) {\n if (bareUtility === physical || bareUtility.startsWith(`${physical}-`)) {\n const suffix = bareUtility.slice(physical.length)\n return `${variant}${hasImportantPrefix ? '!' : ''}${logical}${suffix}${hasImportantSuffix ? '!' : ''}`\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 classes = split.classes\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const converted = convertClass(cls)\n if (converted) offending.push({ cls, replacement: converted })\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: 'useLogical',\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: 'useLogical',\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 { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { PHYSICAL_TO_LOGICAL } from './enforce-logical'\n\n// Invert the mapping: logical → physical\nconst LOGICAL_TO_PHYSICAL: Record<string, string> = {}\nfor (const [physical, logical] of Object.entries(PHYSICAL_TO_LOGICAL)) {\n LOGICAL_TO_PHYSICAL[logical] = physical\n}\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: [],\n hasSuggestions: true,\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 function convertClass(cls: string): string | null {\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for lookup — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n for (const [logical, physical] of Object.entries(LOGICAL_TO_PHYSICAL)) {\n if (bareUtility === logical || bareUtility.startsWith(`${logical}-`)) {\n const suffix = bareUtility.slice(logical.length)\n return `${variant}${hasImportantPrefix ? '!' : ''}${physical}${suffix}${hasImportantSuffix ? '!' : ''}`\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 classes = split.classes\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const converted = convertClass(cls)\n if (converted) offending.push({ cls, replacement: converted })\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: 'usePhysical',\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: 'usePhysical',\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, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { safeOptions } from '../types'\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 let _max: number | null = null\n function getMax(): number {\n if (_max === null) {\n const options = safeOptions<Options>(context)\n _max = options?.max ?? DEFAULT_MAX\n }\n return _max\n }\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 { safeOptions } from '../types'\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 messages: {\n restricted: '\"{{className}}\" is restricted.',\n restrictedWithMessage: '\"{{className}}\" is restricted: {{message}}',\n },\n },\n createOnce(context) {\n interface CompiledConfig {\n restrictedClasses: Set<string>\n patterns: Array<{ regex: RegExp; message?: string }>\n }\n\n let _config: CompiledConfig | null = null\n function getConfig(): CompiledConfig {\n if (_config === null) {\n const options = safeOptions<Options>(context)\n _config = {\n restrictedClasses: new Set(options?.classes ?? []),\n patterns: (options?.patterns ?? []).map((p) => ({\n regex: new RegExp(p.pattern),\n message: p.message,\n })),\n }\n }\n return _config\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 } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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 messages: {\n noArbitrary:\n '\"{{className}}\" uses an arbitrary value. Use a design token or extend your theme instead.',\n },\n },\n createOnce(context) {\n let _allowPrefixes: string[] | null = null\n function getAllowPrefixes(): string[] {\n if (_allowPrefixes === null) {\n const options = safeOptions<Options>(context)\n _allowPrefixes = options?.allow ?? []\n }\n return _allowPrefixes\n }\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 let utility = extractUtility(cls)\n if (utility.startsWith('!')) utility = utility.slice(1)\n else if (utility.endsWith('!')) utility = utility.slice(0, -1)\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, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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 let _position: 'prefix' | 'suffix' | null = null\n function getPosition(): 'prefix' | 'suffix' {\n if (_position === null) {\n const options = safeOptions<Options>(context)\n _position = options?.position ?? 'suffix'\n }\n return _position\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 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 { utility, variant } = splitUtilityAndVariant(cls)\n const fixed = fixUtility(utility, variant)\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 // Report each offending class; attach the fix to the first one\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: position === 'prefix' ? 'usePrefix' : 'useSuffix',\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: position === 'prefix' ? 'usePrefix' : 'useSuffix',\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 { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\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 classes = split.classes\n const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const fixed = fixClass(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: 'moveNegative',\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: 'moveNegative',\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 { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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\n // Strip ! (important) for regex matching — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n const importantStart = hasImportantPrefix ? '!' : ''\n const importantEnd = hasImportantSuffix ? '!' : ''\n\n if (syntax === 'shorthand') {\n const match = EXPLICIT_VAR_RE.exec(bareUtility)\n if (match) {\n const [, prefix, varName] = match\n return `${variant}${importantStart}${prefix}-(${varName})${importantEnd}`\n }\n } else {\n const match = SHORTHAND_VAR_RE.exec(bareUtility)\n if (match) {\n const [, prefix, varName] = match\n return `${variant}${importantStart}${prefix}-[var(${varName})]${importantEnd}`\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 let _syntax: 'shorthand' | 'explicit' | null = null\n function getSyntax(): 'shorthand' | 'explicit' {\n if (_syntax === null) {\n const options = safeOptions<Options>(context)\n _syntax = options?.syntax ?? 'shorthand'\n }\n return _syntax\n }\n\n function check(locations: ClassLocation[]) {\n const syntax = getSyntax()\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 converted = convertClass(cls, syntax)\n if (converted) offending.push({ cls, replacement: converted })\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 const messageId = syntax === 'shorthand' ? 'useShorthand' : 'useExplicit'\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,\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,\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, type ClassLocation } from '../utils/extractors'\nimport { splitClasses } from '../utils/class-splitter'\nimport { extractVariants, extractUtility } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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 = utility\n if (u.startsWith('!')) u = u.slice(1)\n else if (u.endsWith('!')) u = u.slice(0, -1)\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 let _watchedVariants: Set<string> | null = null\n function getWatchedVariants(): Set<string> {\n if (_watchedVariants === null) {\n const options = safeOptions<Options>(context)\n _watchedVariants = new Set(options?.variants ?? DEFAULT_VARIANTS)\n }\n return _watchedVariants\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 { hasArbitraryValue, getArbitraryValue, extractUtility } from '../utils/class-parser'\nimport { safeOptions } from '../types'\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*\\(/\n\nfunction isHardcodedColor(value: string): boolean {\n const trimmed = value.trim()\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 messages: {\n noHardcoded:\n '\"{{className}}\" uses a hardcoded color value. Use a design token from your theme instead.',\n },\n },\n createOnce(context) {\n let _allowlist: Set<string> | null = null\n function getAllowlist(): Set<string> {\n if (_allowlist === null) {\n const options = safeOptions<Options>(context)\n _allowlist = new Set(options?.allow ?? [])\n }\n return _allowlist\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 let utility = extractUtility(cls)\n if (utility.startsWith('!')) utility = utility.slice(1)\n else if (utility.endsWith('!')) utility = utility.slice(0, -1)\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 { safeOptions } from '../types'\nimport { createLazyLoader } from '../design-system/loader'\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 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 interface CompiledConfig {\n priorityMap: Map<string, number>\n fallbackPriority: number\n dsCache: import('../design-system/cache').DesignSystemCache | null\n }\n\n let _config: CompiledConfig | null = null\n function getConfig(): CompiledConfig {\n if (_config === null) {\n const options = safeOptions<Options>(context)\n const dsCache = getDS()?.cache ?? null\n const priorityMap = new Map<string, number>()\n\n if (options?.order) {\n for (let i = 0; i < options.order.length; i++) {\n priorityMap.set(options.order[i], i)\n }\n _config = { priorityMap, fallbackPriority: options.order.length, dsCache }\n } else if (dsCache && dsCache.hasVariantOrder()) {\n for (const variant of DEFAULT_VARIANT_ORDER) {\n const p = dsCache.getVariantPriority(variant)\n if (p !== null) priorityMap.set(variant, p)\n }\n _config = { priorityMap, fallbackPriority: Number.MAX_SAFE_INTEGER, dsCache }\n } else {\n for (let i = 0; i < DEFAULT_VARIANT_ORDER.length; i++) {\n priorityMap.set(DEFAULT_VARIANT_ORDER[i], i)\n }\n _config = { priorityMap, fallbackPriority: DEFAULT_VARIANT_ORDER.length, dsCache }\n }\n }\n return _config\n }\n\n function getVariantPriority(variant: string): number {\n const { priorityMap, fallbackPriority, dsCache } = getConfig()\n const priority = priorityMap.get(variant)\n if (priority !== undefined) return priority\n\n if (dsCache && dsCache.hasVariantOrder()) {\n const dsPriority = dsCache.getVariantPriority(variant)\n if (dsPriority !== null) return dsPriority\n }\n\n return fallbackPriority\n }\n\n function reorderClass(cls: string): string | null {\n const variants = extractVariants(cls)\n if (variants.length < 2) return null\n\n const sorted = [...variants].sort((a, b) => getVariantPriority(a) - getVariantPriority(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(cls)\n return 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 { safeOptions } from '../types'\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 let _printWidth: number | null = null\n function getPrintWidth(): number {\n if (_printWidth === null) {\n const options = safeOptions<Options>(context)\n _printWidth = options?.printWidth ?? DEFAULT_PRINT_WIDTH\n }\n return _printWidth\n }\n\n let _classesPerLine: number | undefined | null = null\n function getClassesPerLine(): number | undefined {\n if (_classesPerLine === null) {\n const options = safeOptions<Options>(context)\n _classesPerLine = options?.classesPerLine ?? undefined\n }\n return _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, preserveSpaces, type ClassLocation } from '../utils/extractors'\nimport { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { hasArbitraryValue, splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\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 messages: {\n unnecessaryArbitrary:\n '\"{{className}}\" can be written as \"{{replacement}}\". Use the named class instead.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\n if (!ds) return\n const { cache } = ds\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 if (!hasArbitraryValue(cls)) continue\n\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) for lookup — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n const named = cache.getNamedEquivalent(bareUtility)\n if (!named) continue\n\n offending.push({\n cls,\n replacement:\n variant + (hasImportantPrefix ? '!' : '') + named + (hasImportantSuffix ? '!' : ''),\n })\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: 'unnecessaryArbitrary',\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: 'unnecessaryArbitrary',\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 { rebuildClassString, splitClassesWithSeparators } from '../utils/class-splitter'\nimport { splitUtilityAndVariant } from '../utils/class-parser'\nimport { createLazyLoader } from '../design-system/loader'\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 messages: {\n preferNamed:\n '\"{{className}}\" can be written as \"{{replacement}}\". Use the named theme token.',\n suggestReplace: 'Replace \"{{className}}\" with \"{{replacement}}\".',\n },\n },\n createOnce(context) {\n const getDS = createLazyLoader(context)\n\n function check(locations: ClassLocation[]) {\n const ds = getDS()\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 const offending: Array<{ cls: string; replacement: string }> = []\n\n for (const cls of classes) {\n const { utility, variant } = splitUtilityAndVariant(cls)\n\n // Strip ! (important) — prefix or suffix\n const hasImportantPrefix = utility.startsWith('!')\n const hasImportantSuffix = !hasImportantPrefix && utility.endsWith('!')\n const bareUtility = hasImportantPrefix\n ? utility.slice(1)\n : hasImportantSuffix\n ? utility.slice(0, -1)\n : utility\n\n const match = detectRawVariable(bareUtility)\n if (!match) continue\n\n const candidate = `${match.prefix}-${match.varName}${match.modifier}`\n if (!cache.isValid(candidate)) continue\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 (CSS-equivalent fix). This rule\n // only reports the heuristic-only cases.\n const namedEquivalent = cache.getNamedEquivalent(bareUtility)\n if (namedEquivalent && namedEquivalent === `${match.prefix}-${match.varName}`) continue\n\n const replacement =\n variant + (hasImportantPrefix ? '!' : '') + candidate + (hasImportantSuffix ? '!' : '')\n\n offending.push({ cls, replacement })\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: 'preferNamed',\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: 'preferNamed',\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 { 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;AACxE,KAAI,IAAI,wBAAwB,CAAC,MAAM,WAAW,IAAI,CAAE,SAAQ,IAAI;AACpE,KAAI,IAAI,yBAAyB,CAAC,MAAM,SAAS,IAAI,CAAE,SAAQ,GAAG,MAAM;AACxE,QAAO;;AAYT,MAAa,2BAA4C;CACvD,YAAY,CAAC,aAAa,QAAQ;CAClC,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD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