@pragmatiks/lint 0.3.4 → 0.5.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/eslint-config/options.ts","../../../src/eslint-config/index.ts","../../../src/eslint-config/next/frontend/css-declarations.ts","../../../src/eslint-config/next/frontend/design-system.ts","../../../src/eslint-config/next/frontend/class-group-declarations.ts","../../../src/eslint-config/next/frontend/ast.ts","../../../src/eslint-config/next/frontend/collect.ts","../../../src/eslint-config/next/frontend/concepts/motion.ts","../../../src/eslint-config/next/frontend/report.ts","../../../src/eslint-config/next/frontend/rules/animated-properties.ts","../../../src/eslint-config/next/frontend/concepts/color.ts","../../../src/eslint-config/next/frontend/rules/color-tokens.ts","../../../src/eslint-config/next/frontend/rules/css-animated-properties.ts","../../../src/eslint-config/next/frontend/rules/css-color-tokens.ts","../../../src/eslint-config/next/frontend/concepts/focus.ts","../../../src/eslint-config/next/frontend/rules/css-focus-styling.ts","../../../src/eslint-config/next/frontend/rules/css-no-apply.ts","../../../src/eslint-config/next/frontend/rules/css-parsed-fully.ts","../../../src/eslint-config/next/frontend/concepts/viewport.ts","../../../src/eslint-config/next/frontend/css-declaration-rule.ts","../../../src/eslint-config/next/frontend/rules/css-viewport-units.ts","../../../src/eslint-config/next/frontend/concepts/z-index.ts","../../../src/eslint-config/next/frontend/rules/css-z-index.ts","../../../src/eslint-config/next/frontend/rules/focus-styling.ts","../../../src/eslint-config/next/frontend/rules/form-control-has-label.ts","../../../src/eslint-config/next/frontend/rules/no-embedded-style.ts","../../../src/eslint-config/next/frontend/declaration-rule.ts","../../../src/eslint-config/next/frontend/rules/viewport-units.ts","../../../src/eslint-config/next/frontend/rules/z-index.ts","../../../src/eslint-config/next/frontend/plugin.ts","../../../src/eslint-config/next/index.ts"],"names":["path","css","fileURLToPath","property","describeProperty","lexer","channels","parse","checkClassGroup","checkStyleLeaf"],"mappings":";;;;;;;;;;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UNCTION_OPTS = {\n max: 50,\n skipBlankLines: true,\n skipComments: true,\n};\n\nexport const MAX_STATEMENTS_OPTS = 15;\n\nexport const MAX_DEPTH_OPTS = 4;\n\nexport const MAX_PARAMS_OPTS = 4;\n\nexport const PREVENT_ABBREVIATIONS_OPTS = {\n allowList: {\n id: true,\n url: true,\n uri: true,\n api: true,\n cli: true,\n sdk: true,\n os: true,\n io: true,\n ip: true,\n tls: true,\n ssl: true,\n jwt: true,\n json: true,\n yaml: true,\n html: true,\n css: true,\n dom: true,\n ast: true,\n gpu: true,\n cpu: true,\n ram: true,\n vm: true,\n props: true,\n ref: true,\n e: true,\n },\n};\n\n/**\n * `unicorn/filename-case` options for Next apps: kebab-case modules, PascalCase components and\n * camelCase hooks and utilities are all allowed.\n */\nexport const FILENAME_CASE_OPTIONS = {\n cases: {\n kebabCase: true,\n pascalCase: true,\n camelCase: true,\n },\n};\n\n/**\n * `unicorn/no-useless-undefined` options for React: explicit resets such as\n * `setState(undefined)` are meaningful arguments, so arguments are not checked.\n */\nexport const NO_USELESS_UNDEFINED_OPTIONS = { checkArguments: false };\n","import { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { type Config, defineConfig, globalIgnores } from \"eslint/config\";\nimport sonarjs from \"eslint-plugin-sonarjs\";\nimport unicorn from \"eslint-plugin-unicorn\";\nimport tseslint from \"typescript-eslint\";\n\nimport {\n COMPLEXITY_OPTS,\n MAX_DEPTH_OPTS,\n MAX_LINES_PER_FUNCTION_OPTS,\n MAX_PARAMS_OPTS,\n MAX_STATEMENTS_OPTS,\n PREVENT_ABBREVIATIONS_OPTS,\n} from \"./options.js\";\n\n/**\n * The files every Pragmatiks config object applies to: JavaScript and TypeScript, JSX included.\n */\nexport const PRAGMATIKS_LINT_FILES = [\"**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}\"];\n\n/**\n * Finds the nearest directory at or above `start` that contains a `package.json`.\n *\n * @param start - The directory to start from.\n * @returns The first directory, walking up, that contains a `package.json`.\n * @throws Error when no directory up to the filesystem root contains one.\n */\nexport function findPackageRoot(start: string): string {\n let current = start;\n for (;;) {\n if (existsSync(path.join(current, \"package.json\"))) {\n return current;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n throw new Error(`package.json not found above ${start}`);\n }\n current = parent;\n }\n}\n\n/**\n * Locates the Semgrep rules shipped with this package.\n *\n * @returns The absolute path of the package's `src/semgrep-rules` directory.\n * @throws Error when the package root cannot be found above this module.\n */\nexport function semgrepRulesDirectory(): string {\n const here = path.dirname(fileURLToPath(import.meta.url));\n return path.join(findPackageRoot(here), \"src\", \"semgrep-rules\");\n}\n\n/**\n * Reads a plugin's recommended flat config and scopes it to `PRAGMATIKS_LINT_FILES`.\n *\n * @param plugin - An ESLint plugin that ships flat configs.\n * @param peer - The plugin's package name and the peer range this package supports, used in the\n * error message.\n * @returns The recommended config with its `files` replaced by `PRAGMATIKS_LINT_FILES`, so it never\n * applies to CSS or other languages composed alongside it.\n * @throws Error when the plugin has no `recommended` flat config, which means an unsupported major.\n */\nfunction recommendedOrThrow(\n plugin: { configs?: Record<string, unknown> },\n peer: { name: string; range: string },\n): Config {\n const recommended = plugin.configs?.recommended;\n if (!recommended) {\n throw new Error(\n `@pragmatiks/lint: ${peer.name} has no recommended flat-config preset (peer dependency major mismatch). To fix it, install ${peer.name} ${peer.range}.`,\n );\n }\n return { ...(recommended as Config), files: PRAGMATIKS_LINT_FILES };\n}\n\n/**\n * Builds the Pragmatiks base flat config for JavaScript and TypeScript files.\n *\n * Every object except the global ignores, the sonarjs and unicorn recommended presets included,\n * applies only to `PRAGMATIKS_LINT_FILES`, so the config composes with configs for other\n * languages such as CSS.\n *\n * @returns The flat config: the typescript-eslint parser, the sonarjs and unicorn recommended\n * presets, the Pragmatiks size and naming rules, and global ignores for build output.\n * @throws Error when the package root cannot be found, or when sonarjs or unicorn has no\n * recommended flat config.\n */\nexport function pragmatiksConfig() {\n return defineConfig([\n {\n files: PRAGMATIKS_LINT_FILES,\n languageOptions: {\n parser: tseslint.parser,\n parserOptions: {\n ecmaVersion: \"latest\",\n sourceType: \"module\",\n },\n },\n settings: {\n pragmatiksLint: {\n semgrepRulesDirectory: semgrepRulesDirectory(),\n },\n },\n },\n recommendedOrThrow(sonarjs, {\n name: \"eslint-plugin-sonarjs\",\n range: \"^4.0.0\",\n }),\n recommendedOrThrow(unicorn, {\n name: \"eslint-plugin-unicorn\",\n range: \"^64.0.0\",\n }),\n {\n files: PRAGMATIKS_LINT_FILES,\n rules: {\n complexity: [\"error\", COMPLEXITY_OPTS],\n \"max-lines-per-function\": [\"error\", MAX_LINES_PER_FUNCTION_OPTS],\n \"max-statements\": [\"error\", MAX_STATEMENTS_OPTS],\n \"max-depth\": [\"error\", MAX_DEPTH_OPTS],\n \"max-params\": [\"error\", MAX_PARAMS_OPTS],\n \"unicorn/prevent-abbreviations\": [\"error\", PREVENT_ABBREVIATIONS_OPTS],\n },\n },\n globalIgnores([\"dist/**\", \"node_modules/**\", \".next/**\", \".turbo/**\"]),\n ]);\n}\n\nexport default pragmatiksConfig;\n","/**\n * Parses CSS from class tokens, inline styles and project stylesheets into one declaration shape,\n * and provides the value helpers the frontend concepts share.\n *\n * @packageDocumentation\n */\nimport {\n type AtrulePlain,\n type CssNodePlain,\n type DeclarationPlain,\n type FunctionNodePlain,\n generate,\n lexer,\n parse,\n type RulePlain,\n type StyleSheetPlain,\n toPlainObject,\n type ValuePlain,\n} from \"@eslint/css-tree\";\n\n/**\n * One CSS declaration from a compiled class token, an inline style leaf or a project stylesheet.\n */\nexport interface Declaration {\n /** The property name, lowercased unless it is a custom property. */\n readonly property: string;\n /** The parsed value. */\n readonly value: ValuePlain;\n /** The value text. */\n readonly text: string;\n /** Whether the declaration is `!important`. */\n readonly important: boolean;\n /** The enclosing rule preludes, outermost first. */\n readonly selectors: readonly string[];\n /** The dotted `@layer` path, or `undefined` outside any layer. */\n readonly layer: string | undefined;\n /** Whether the declaration sits inside `@keyframes`. */\n readonly inKeyframes: boolean;\n /** Whether the declaration sits inside `@theme`. */\n readonly inTheme: boolean;\n /**\n * The nearest enclosing rule or `@variant focus*` block, or `undefined` for inline declarations\n * and top-level ones.\n */\n readonly block: RulePlain | AtrulePlain | undefined;\n /** The source declaration node, or `undefined` for inline declarations. */\n readonly node: CssNodePlain | undefined;\n}\n\n/**\n * The context a stylesheet walk carries down to the declarations it reaches.\n */\ninterface DeclarationContext {\n readonly selectors: readonly string[];\n readonly layer: string | undefined;\n readonly inKeyframes: boolean;\n readonly inTheme: boolean;\n readonly block: RulePlain | AtrulePlain | undefined;\n}\n\n/**\n * The CSS-wide keywords, such as `inherit` and `unset`.\n */\nexport const CSS_WIDE_KEYWORDS: ReadonlySet<string> = new Set(\n lexer.cssWideKeywords,\n);\n\nconst TOP_CONTEXT: DeclarationContext = {\n selectors: [],\n layer: undefined,\n inKeyframes: false,\n inTheme: false,\n block: undefined,\n};\nconst FOCUS_VARIANTS = new Set([\"focus\", \"focus-visible\", \"focus-within\"]);\nconst stylesheetDeclarations = new WeakMap<\n StyleSheetPlain,\n readonly Declaration[]\n>();\n\n/**\n * Parses a CSS value, including custom property values, into a plain css-tree node.\n *\n * @param text - The value text without the property name.\n * @returns The parsed value; a value css-tree cannot parse, such as a custom property holding a\n * `{}` block, comes back as a single `Raw` node, which no concept treats as a finding.\n */\nexport function parseValue(text: string): ValuePlain {\n let parsed: CssNodePlain;\n try {\n parsed = toPlainObject(\n parse(text, { context: \"value\", parseCustomProperty: true }),\n );\n } catch {\n return { type: \"Value\", children: [{ type: \"Raw\", value: text }] };\n }\n if (parsed.type === \"Value\") {\n return parsed;\n }\n return { type: \"Value\", children: [parsed] };\n}\n\n/**\n * Lowercases a property name unless it is a custom property.\n *\n * @param property - A property name as written.\n * @returns The normalized name.\n */\nfunction normalizeProperty(property: string): string {\n return property.startsWith(\"--\") ? property : property.toLowerCase();\n}\n\n/**\n * Builds a declaration from a stylesheet node and its context.\n *\n * @param node - A declaration node.\n * @param context - The enclosing context.\n * @returns The declaration with its value re-parsed.\n */\nfunction buildDeclaration(\n node: DeclarationPlain,\n context: DeclarationContext,\n): Declaration {\n const text =\n node.value.type === \"Raw\" ? node.value.value.trim() : generate(node.value);\n return {\n property: normalizeProperty(node.property),\n value: parseValue(text),\n text,\n important: Boolean(node.important),\n ...context,\n node,\n };\n}\n\n/**\n * Reads the layer name an `@layer` at-rule opens.\n *\n * @param node - An `@layer` at-rule.\n * @returns The layer name, or an empty string for an anonymous layer.\n */\nfunction layerName(node: AtrulePlain): string {\n if (!node.prelude) {\n return \"\";\n }\n if (node.prelude.type === \"Raw\") {\n return node.prelude.value.trim();\n }\n const [first] = node.prelude.children;\n return first?.type === \"Layer\" ? first.name : generate(node.prelude);\n}\n\n/**\n * Reads the focus variant an `@variant` at-rule applies.\n *\n * @param node - Any at-rule.\n * @returns `focus`, `focus-visible` or `focus-within` for such an `@variant`; `undefined` otherwise.\n */\nexport function focusVariant(node: AtrulePlain): string | undefined {\n if (node.name.toLowerCase() !== \"variant\" || !node.prelude) {\n return undefined;\n }\n const variant = generate(node.prelude).trim();\n return FOCUS_VARIANTS.has(variant) ? variant : undefined;\n}\n\n/**\n * Computes the context inside an at-rule block.\n *\n * @param node - An at-rule with a block.\n * @param context - The context around the at-rule.\n * @returns The context with the layer, keyframes, `@theme` or focus variant the at-rule adds; a\n * focus variant also becomes the declarations' block.\n */\nfunction atruleContext(\n node: AtrulePlain,\n context: DeclarationContext,\n): DeclarationContext {\n const name = node.name.toLowerCase();\n if (name === \"layer\") {\n const nested = layerName(node);\n return {\n ...context,\n layer:\n context.layer === undefined ? nested : `${context.layer}.${nested}`,\n };\n }\n if (name.endsWith(\"keyframes\")) {\n return { ...context, inKeyframes: true };\n }\n if (name === \"theme\") {\n return { ...context, inTheme: true };\n }\n const variant = focusVariant(node);\n if (variant === undefined) {\n return context;\n }\n return {\n ...context,\n selectors: [...context.selectors, `&:${variant}`],\n block: node,\n };\n}\n\n/**\n * Appends the declarations of a list of stylesheet nodes, recursing into rules and at-rules.\n *\n * @param nodes - The nodes to walk.\n * @param context - The context of the nodes.\n * @param output - The list to append to.\n * @returns `output`.\n */\nfunction collectDeclarations(\n nodes: readonly CssNodePlain[],\n context: DeclarationContext,\n output: Declaration[],\n): Declaration[] {\n for (const node of nodes) {\n if (node.type === \"Declaration\") {\n output.push(buildDeclaration(node, context));\n } else if (node.type === \"Rule\") {\n const selectors = [...context.selectors, generate(node.prelude)];\n collectDeclarations(\n node.block.children,\n { ...context, selectors, block: node },\n output,\n );\n } else if (node.type === \"Atrule\" && node.block) {\n collectDeclarations(\n node.block.children,\n atruleContext(node, context),\n output,\n );\n }\n }\n return output;\n}\n\n/**\n * Lists every declaration in a stylesheet with its enclosing block, selectors, layer, keyframes and\n * `@theme` context.\n *\n * Selectors and at-rules are not interpreted, so nested and flattened output shapes produce the\n * same declarations, with two exceptions: `@variant focus`, `@variant focus-visible` and\n * `@variant focus-within` add `&:<variant>` to the selectors and become the block of the\n * declarations inside them, and `@property` descriptors are listed like declarations. Values are\n * re-parsed with custom-property parsing, so `var()` fallbacks are parsed rather than left raw.\n * Repeated calls for the same stylesheet return the same list.\n *\n * @param stylesheet - A plain css-tree stylesheet, such as the AST `@eslint/css` provides.\n * @returns The declarations in source order.\n */\nexport function collectStylesheetDeclarations(\n stylesheet: StyleSheetPlain,\n): readonly Declaration[] {\n const cached = stylesheetDeclarations.get(stylesheet);\n if (cached) {\n return cached;\n }\n const declarations = collectDeclarations(\n stylesheet.children,\n TOP_CONTEXT,\n [],\n );\n stylesheetDeclarations.set(stylesheet, declarations);\n return declarations;\n}\n\n/**\n * Parses CSS text and lists its declarations.\n *\n * @param css - Stylesheet text, such as the output Tailwind compiles for one class token.\n * @returns The declarations in source order.\n */\nexport function parseStylesheetDeclarations(\n css: string,\n): readonly Declaration[] {\n const stylesheet = toPlainObject(\n parse(css, { parseCustomProperty: true }),\n ) as StyleSheetPlain;\n return collectStylesheetDeclarations(stylesheet);\n}\n\n/**\n * Parses an inline style leaf as a declaration.\n *\n * @param leaf - The CSS property name in kebab case and the value text, as a style leaf holds them.\n * @returns The declaration, outside any selector, layer, keyframes or `@theme`; `undefined` when\n * the value is not statically known.\n */\nexport function parseStyleLeaf(leaf: {\n readonly property: string;\n readonly text: string | undefined;\n}): Declaration | undefined {\n const { property, text } = leaf;\n if (text === undefined) {\n return undefined;\n }\n return {\n property: normalizeProperty(property),\n value: parseValue(text),\n text,\n important: false,\n ...TOP_CONTEXT,\n node: undefined,\n };\n}\n\n/**\n * Lists a value node and every node nested inside it, depth first.\n *\n * @param node - A plain css-tree node, usually a `Value`.\n * @returns The node followed by all of its descendants.\n */\nexport function listValueNodes(node: CssNodePlain): CssNodePlain[] {\n return [\n node,\n ...listCssChildren(node).flatMap((child) => listValueNodes(child)),\n ];\n}\n\n/**\n * Lists the direct children of a css-tree node.\n *\n * @param node - A plain css-tree node.\n * @returns The children, or an empty list for a leaf node.\n */\nexport function listCssChildren(node: CssNodePlain): CssNodePlain[] {\n return \"children\" in node && Array.isArray(node.children)\n ? (node.children as CssNodePlain[])\n : [];\n}\n\n/**\n * Splits a node list at its top-level commas.\n *\n * @param nodes - The children of a value or function.\n * @returns One list per comma-separated segment; a single empty list for no nodes.\n */\nexport function splitOnCommas(\n nodes: readonly CssNodePlain[],\n): CssNodePlain[][] {\n const segments: CssNodePlain[][] = [[]];\n for (const node of nodes) {\n if (node.type === \"Operator\" && node.value === \",\") {\n segments.push([]);\n } else {\n segments.at(-1)?.push(node);\n }\n }\n return segments;\n}\n\n/**\n * Tells whether a node is a `var()` call, in any letter case.\n *\n * @param node - A plain css-tree node.\n * @returns `true` for a `var()` function.\n */\nexport function isVariableReference(\n node: CssNodePlain | undefined,\n): node is FunctionNodePlain {\n return node?.type === \"Function\" && node.name.toLowerCase() === \"var\";\n}\n\n/**\n * Reads the identifier a CSS function takes as its first argument.\n *\n * @param node - A plain css-tree node.\n * @returns The identifier name, such as `--color-red-500` in `var(--color-red-500)`, or\n * `undefined` when the node is not a function or its first argument is not an identifier.\n */\nexport function firstIdentifierArgument(\n node: CssNodePlain | undefined,\n): string | undefined {\n const [first] = node?.type === \"Function\" ? node.children : [];\n return first?.type === \"Identifier\" ? first.name : undefined;\n}\n\n/**\n * Reads the custom property a `var()` call references.\n *\n * @param node - A plain css-tree node.\n * @returns The referenced name, or `undefined` when the node is not a `var()` call.\n */\nexport function referencedVariable(\n node: CssNodePlain | undefined,\n): string | undefined {\n return isVariableReference(node) ? firstIdentifierArgument(node) : undefined;\n}\n","/**\n * Loads the project's Tailwind design system and exposes the read-only view the frontend rules\n * use.\n *\n * @packageDocumentation\n */\nimport { readFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport {\n type Declaration,\n parseStylesheetDeclarations,\n} from \"./css-declarations.js\";\n\n/**\n * One parse of a Tailwind class token, reduced to the fields the frontend rules read.\n *\n * Tailwind can parse one token several ways (`outline-hidden` is both a static utility and\n * `outline` with the value `hidden`), so `DesignSystemView.candidatesOf` returns one entry per parse.\n */\nexport interface ClassCandidate {\n /** The utility root, such as `ring` in `ring-2`, or the property of an arbitrary property. */\n readonly utility: string;\n /** Whether the token is an arbitrary property such as `[--tw-shadow:none]`. */\n readonly arbitraryProperty: boolean;\n /** The printed variants, such as `focus-visible`, outermost first. */\n readonly variants: readonly string[];\n /** Whether the token carries `!`. */\n readonly important: boolean;\n /** Whether the value is a theme name, an arbitrary `[...]` value, or absent. */\n readonly valueKind: \"named\" | \"arbitrary\" | \"none\";\n /** The value text, or `undefined` when there is none. */\n readonly value: string | undefined;\n /** Whether the `/modifier` is a theme name, an arbitrary `[...]` value, or absent. */\n readonly modifierKind: \"named\" | \"arbitrary\" | \"none\";\n /** The authored text of the arbitrary value and arbitrary modifier, in that order. */\n readonly arbitraryInputs: readonly string[];\n}\n\n/**\n * Read-only view of the project's Tailwind design system, injected into every frontend rule.\n */\nexport interface DesignSystemView {\n /**\n * Compiles one class token with the project's stylesheet.\n *\n * @param token - A single class token, variants included.\n * @returns The compiled declarations, or `undefined` when the token is not a class.\n */\n declarationsOf(token: string): readonly Declaration[] | undefined;\n\n /**\n * Parses one class token.\n *\n * @param token - A single class token, variants included.\n * @returns One entry per way Tailwind parses the token; empty when it is not a class.\n */\n candidatesOf(token: string): readonly ClassCandidate[];\n\n /**\n * Looks up a keyframes block defined in the project theme.\n *\n * @param name - The keyframes name.\n * @returns The properties the keyframes animate, or `undefined` when the theme does not define it.\n */\n keyframeProperties(name: string): readonly string[] | undefined;\n\n /**\n * Tells whether a theme variable comes from Tailwind's default theme rather than the project.\n *\n * @param variableName - A custom property name such as `--color-amber-500`.\n * @returns `true` when Tailwind's default theme defines the variable and the project does not\n * override it; `false` for project-defined or unknown variables.\n */\n isDefaultThemeVariable(variableName: string): boolean;\n\n /**\n * Resolves a theme variable to its value.\n *\n * @param variableName - A custom property name such as `--animate-spin`.\n * @returns The theme value, or `undefined` when the theme does not define it.\n */\n themeValue(variableName: string): string | undefined;\n}\n\n/**\n * Where the project's Tailwind entry stylesheet lives.\n */\nexport interface DesignSystemSource {\n /** Absolute path of the project root. */\n readonly rootDir: string;\n /** Path of the Tailwind entry stylesheet relative to `rootDir`. */\n readonly tailwindStylesheet: string;\n}\n\n/**\n * A variant as Tailwind's parser returns it.\n */\ninterface TailwindVariant {\n readonly kind: string;\n}\n\n/**\n * One parse of a class token as Tailwind's parser returns it.\n */\ninterface TailwindCandidate {\n readonly kind: \"static\" | \"functional\" | \"arbitrary\";\n readonly root?: string;\n readonly property?: string;\n readonly value?: unknown;\n readonly modifier?: {\n readonly kind: \"named\" | \"arbitrary\";\n readonly value: string;\n } | null;\n readonly variants: readonly TailwindVariant[];\n readonly important: boolean;\n}\n\n/**\n * A node of Tailwind's CSS AST, such as a keyframes block or a declaration.\n */\ninterface TailwindAstNode {\n readonly kind: string;\n readonly name?: string;\n readonly params?: string;\n readonly property?: string;\n readonly nodes?: readonly TailwindAstNode[];\n}\n\n/**\n * The part of Tailwind's unstable design system API this module uses.\n */\ninterface TailwindDesignSystem {\n readonly theme: {\n getOptions(variableName: string): number;\n getKeyframes(): readonly TailwindAstNode[];\n };\n parseCandidate(token: string): readonly TailwindCandidate[];\n printVariant(variant: TailwindVariant): string;\n candidatesToCss(tokens: string[]): (string | null)[];\n resolveThemeValue(variableName: string): string | undefined;\n}\n\n/**\n * The fields of a `package.json` this module reads.\n */\ninterface PackageManifest {\n readonly name?: string;\n readonly version?: string;\n}\n\nconst DEFAULT_THEME_OPTION = 4;\nconst CACHE_LIMIT = 10_000;\nconst SUPPORTED_TAILWIND_RANGE = \"~4.1.17\";\nconst VERSION_RECOVERY = `pin tailwindcss, @tailwindcss/postcss and @tailwindcss/node to the same ${SUPPORTED_TAILWIND_RANGE} version`;\n\nconst CANARY_EXPECTATIONS: readonly {\n token: string;\n property: string;\n value: string;\n}[] = [\n { token: \"z-60\", property: \"z-index\", value: \"60\" },\n { token: \"h-screen\", property: \"height\", value: \"100vh\" },\n { token: \"transition-all\", property: \"transition-property\", value: \"all\" },\n { token: \"bg-[#fff]\", property: \"background-color\", value: \"#fff\" },\n {\n token: \"focus-visible:outline-hidden\",\n property: \"outline-style\",\n value: \"none\",\n },\n];\n\n/**\n * Reads the `package.json` in a directory.\n *\n * @param directory - The directory to read from.\n * @returns The manifest, or `undefined` when it is missing or not JSON.\n */\nfunction loadManifest(directory: string): PackageManifest | undefined {\n try {\n return JSON.parse(\n readFileSync(path.join(directory, \"package.json\"), \"utf8\"),\n ) as PackageManifest;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Finds the manifest of a named package at or above a directory.\n *\n * @param start - The directory to start from, such as the directory of the package's entry file.\n * @param name - The package name.\n * @returns The first manifest, walking up, whose `name` is `name`.\n * @throws Error when no directory up to the filesystem root holds that package's manifest.\n */\nfunction findPackageManifest(start: string, name: string): PackageManifest {\n let current = start;\n for (;;) {\n const manifest = loadManifest(current);\n if (manifest?.name === name) {\n return manifest;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n throw new Error(\n `@pragmatiks/lint: no package.json of ${name} above ${start}. To fix it, reinstall ${name}.`,\n );\n }\n current = parent;\n }\n}\n\n/**\n * Resolves the entry file of a package as seen from a file.\n *\n * @param fromFile - The file the package is resolved from.\n * @param name - The package name.\n * @returns The absolute path of the package's entry file.\n * @throws Error when the package is not installed where `fromFile` can resolve it.\n */\nfunction resolvePackageEntry(fromFile: string, name: string): string {\n try {\n return createRequire(fromFile).resolve(name);\n } catch {\n throw new Error(\n `@pragmatiks/lint: ${name} cannot be resolved from ${path.dirname(fromFile)}. To fix it, install ${name} at ${SUPPORTED_TAILWIND_RANGE} in the app root.`,\n );\n }\n}\n\n/**\n * Reads the installed version of a package as resolved from a file.\n *\n * @param fromFile - The file the package is resolved from.\n * @param name - The package name.\n * @returns The version in the package's `package.json`.\n * @throws Error when the package cannot be resolved, its `package.json` cannot be found, or it has\n * no version.\n */\nfunction readPackageVersion(fromFile: string, name: string): string {\n const entry = resolvePackageEntry(fromFile, name);\n const version = findPackageManifest(path.dirname(entry), name).version;\n if (!version) {\n throw new Error(\n `@pragmatiks/lint: the package.json of ${name} has no version. To fix it, reinstall ${name}.`,\n );\n }\n return version;\n}\n\n/**\n * Reduces a Tailwind parse's value to its kind and text.\n *\n * @param candidate - One Tailwind parse.\n * @returns The value kind and text.\n */\nfunction buildCandidateValue(\n candidate: TailwindCandidate,\n): Pick<ClassCandidate, \"valueKind\" | \"value\"> {\n const value = candidate.value as\n | { kind?: string; value?: string }\n | string\n | null\n | undefined;\n if (typeof value === \"string\") {\n return { valueKind: \"arbitrary\", value };\n }\n if (!value?.kind) {\n return { valueKind: \"none\", value: undefined };\n }\n return {\n valueKind: value.kind === \"arbitrary\" ? \"arbitrary\" : \"named\",\n value: value.value,\n };\n}\n\n/**\n * Lists the authored arbitrary value and arbitrary modifier of a parse.\n *\n * @param candidate - One Tailwind parse.\n * @param value - Its reduced value.\n * @returns The arbitrary value text, then the arbitrary modifier text, where present.\n */\nfunction buildArbitraryInputs(\n candidate: TailwindCandidate,\n value: Pick<ClassCandidate, \"valueKind\" | \"value\">,\n): string[] {\n const inputs: string[] = [];\n if (value.valueKind === \"arbitrary\" && value.value !== undefined) {\n inputs.push(value.value);\n }\n if (candidate.modifier?.kind === \"arbitrary\") {\n inputs.push(candidate.modifier.value);\n }\n return inputs;\n}\n\n/**\n * Reduces a Tailwind parse to a class candidate.\n *\n * @param designSystem - The design system, which prints variants.\n * @param candidate - One Tailwind parse.\n * @returns The class candidate.\n */\nfunction buildClassCandidate(\n designSystem: TailwindDesignSystem,\n candidate: TailwindCandidate,\n): ClassCandidate {\n const value = buildCandidateValue(candidate);\n return {\n utility:\n candidate.kind === \"arbitrary\"\n ? (candidate.property ?? \"\")\n : (candidate.root ?? \"\"),\n arbitraryProperty: candidate.kind === \"arbitrary\",\n variants: candidate.variants.map((variant) =>\n designSystem.printVariant(variant),\n ),\n important: candidate.important,\n ...value,\n modifierKind: candidate.modifier?.kind ?? \"none\",\n arbitraryInputs: buildArbitraryInputs(candidate, value),\n };\n}\n\n/**\n * Adds every declared property in a Tailwind AST to a set.\n *\n * @param nodes - The nodes to walk.\n * @param output - The set to add to.\n * @returns `output`.\n */\nfunction collectProperties(\n nodes: readonly TailwindAstNode[] | undefined,\n output: Set<string>,\n): Set<string> {\n for (const node of nodes ?? []) {\n if (node.kind === \"declaration\" && node.property) {\n output.add(node.property);\n }\n collectProperties(node.nodes, output);\n }\n return output;\n}\n\n/**\n * Wraps a function of a string in a least-recently-used cache of `CACHE_LIMIT` entries.\n *\n * @param compute - The function to cache.\n * @returns A function that returns the cached result for a key it has seen.\n */\nfunction memoize<Result>(\n compute: (key: string) => Result,\n): (key: string) => Result {\n const cache = new Map<string, Result>();\n return (key) => {\n const result = cache.has(key) ? (cache.get(key) as Result) : compute(key);\n cache.delete(key);\n cache.set(key, result);\n if (cache.size > CACHE_LIMIT) {\n cache.delete(cache.keys().next().value as string);\n }\n return result;\n };\n}\n\n/**\n * Builds the view over a loaded Tailwind design system.\n *\n * @param tailwind - The loaded design system.\n * @returns The view.\n */\nfunction createDesignSystemView(\n tailwind: TailwindDesignSystem,\n): DesignSystemView {\n const keyframes = new Map<string, readonly string[]>();\n for (const block of tailwind.theme.getKeyframes()) {\n if (block.params) {\n keyframes.set(block.params, [\n ...collectProperties(block.nodes, new Set()),\n ]);\n }\n }\n return {\n declarationsOf: memoize((token) => {\n const css = tailwind.candidatesToCss([token])[0];\n return css ? parseStylesheetDeclarations(css) : undefined;\n }),\n candidatesOf: memoize((token) =>\n tailwind\n .parseCandidate(token)\n .map((candidate) => buildClassCandidate(tailwind, candidate)),\n ),\n keyframeProperties: (name) => keyframes.get(name),\n isDefaultThemeVariable: (variableName) =>\n (tailwind.theme.getOptions(variableName) & DEFAULT_THEME_OPTION) !== 0,\n themeValue: (variableName) => tailwind.resolveThemeValue(variableName),\n };\n}\n\n/**\n * Checks that the project's Tailwind packages share one version.\n *\n * @param rootDirectory - The project root.\n * @throws Error when `tailwindcss`, `@tailwindcss/postcss` or `@tailwindcss/node` is missing or\n * their versions differ.\n */\nfunction assertMatchingVersions(rootDirectory: string): void {\n const projectManifest = path.join(rootDirectory, \"package.json\");\n const versions = {\n tailwindcss: readPackageVersion(projectManifest, \"tailwindcss\"),\n \"@tailwindcss/postcss\": readPackageVersion(\n projectManifest,\n \"@tailwindcss/postcss\",\n ),\n \"@tailwindcss/node\": readPackageVersion(\n fileURLToPath(import.meta.url),\n \"@tailwindcss/node\",\n ),\n };\n if (new Set(Object.values(versions)).size !== 1) {\n throw new Error(\n `@pragmatiks/lint: tailwindcss, @tailwindcss/postcss and @tailwindcss/node need one Tailwind version; found ${JSON.stringify(versions)}. To fix it, ${VERSION_RECOVERY}.`,\n );\n }\n}\n\n/**\n * Checks that the loaded design system has the API shape this module reads.\n *\n * @param designSystem - The loaded design system.\n * @throws Error when a method or a parse field is missing.\n */\nfunction assertTailwindApi(designSystem: TailwindDesignSystem): void {\n const [candidate] = designSystem.parseCandidate(\n \"focus-visible:outline-hidden\",\n );\n const usable =\n typeof designSystem.theme.getOptions === \"function\" &&\n typeof designSystem.theme.getKeyframes === \"function\" &&\n typeof designSystem.printVariant === \"function\" &&\n typeof designSystem.resolveThemeValue === \"function\" &&\n Array.isArray(candidate?.variants) &&\n typeof candidate.important === \"boolean\" &&\n typeof candidate.root === \"string\";\n if (!usable) {\n throw new Error(\n `@pragmatiks/lint: the canary found that the Tailwind design system API changed shape. To fix it, ${VERSION_RECOVERY}, the range @pragmatiks/lint supports.`,\n );\n }\n}\n\n/**\n * Checks that known tokens still compile to the declarations the rules rely on.\n *\n * @param view - The design system view.\n * @throws Error when a canary token compiles to something else.\n */\nfunction assertCanary(view: DesignSystemView): void {\n for (const expected of CANARY_EXPECTATIONS) {\n const found = view\n .declarationsOf(expected.token)\n ?.some(\n (declaration) =>\n declaration.property === expected.property &&\n declaration.text === expected.value,\n );\n if (!found) {\n throw new Error(\n `@pragmatiks/lint: the canary found that ${expected.token} no longer compiles to ${expected.property}: ${expected.value}. To fix it, ${VERSION_RECOVERY}, the range @pragmatiks/lint supports.`,\n );\n }\n }\n}\n\n/**\n * Loads the project's Tailwind design system from its entry stylesheet.\n *\n * @param source - The project root and the stylesheet path relative to it.\n * @returns The design system view.\n * @throws Error when tailwindcss, @tailwindcss/postcss or @tailwindcss/node is missing or their\n * versions differ, when the stylesheet cannot be read, or when the Tailwind API or canary check\n * fails.\n */\nexport async function loadDesignSystem(\n source: DesignSystemSource,\n): Promise<DesignSystemView> {\n assertMatchingVersions(source.rootDir);\n const { __unstable__loadDesignSystem } = await import(\"@tailwindcss/node\");\n const stylesheetPath = path.resolve(\n source.rootDir,\n source.tailwindStylesheet,\n );\n const stylesheet = readFileSync(stylesheetPath, \"utf8\");\n const loaded = await __unstable__loadDesignSystem(stylesheet, {\n base: path.dirname(stylesheetPath),\n });\n const designSystem = loaded as unknown as TailwindDesignSystem;\n assertTailwindApi(designSystem);\n const view = createDesignSystemView(designSystem);\n assertCanary(view);\n return view;\n}\n","/**\n * Compiles class groups into the declarations of their tokens.\n *\n * @packageDocumentation\n */\nimport type { ClassGroup } from \"./collect.js\";\nimport type { Declaration } from \"./css-declarations.js\";\nimport type { DesignSystemView } from \"./design-system.js\";\n\n/**\n * The compiled declarations of one class token.\n */\nexport interface TokenDeclarations {\n /** The class token. */\n readonly token: string;\n /** The declarations the token compiles to. */\n readonly declarations: readonly Declaration[];\n}\n\n/**\n * Compiles every token of a class group, skipping words that are not Tailwind classes.\n *\n * @param group - One class group.\n * @param view - The project design system.\n * @returns One entry per token that compiles.\n */\nexport function compileClassGroup(\n group: ClassGroup,\n view: DesignSystemView,\n): TokenDeclarations[] {\n return group.tokens.flatMap((token) => {\n const declarations = view.declarationsOf(token);\n return declarations ? [{ token, declarations }] : [];\n });\n}\n","/**\n * Parser-independent access to JavaScript and JSX AST nodes for the frontend rules.\n *\n * @packageDocumentation\n */\nimport type { Rule, Scope } from \"eslint\";\n\n/**\n * A JavaScript AST node as the frontend rules read it, independent of the parser in use.\n */\nexport interface AstNode {\n readonly type: string;\n readonly parent?: AstNode;\n readonly range?: readonly [number, number];\n readonly [field: string]: unknown;\n}\n\n/**\n * AST node types of function declarations and expressions.\n */\nexport const FUNCTION_TYPES: ReadonlySet<string> = new Set([\n \"ArrowFunctionExpression\",\n \"FunctionExpression\",\n \"FunctionDeclaration\",\n]);\n\n/**\n * Presents an AST node as the node type ESLint's APIs expect.\n *\n * @param node - An AST node of the file being linted.\n * @returns The same node, typed for ESLint.\n */\nexport function toRuleNode(node: AstNode): Rule.Node {\n return node as unknown as Rule.Node;\n}\n\n/**\n * Presents a node from ESLint's APIs as the node type the frontend rules read.\n *\n * @param node - A node ESLint hands over, such as a visitor argument, a scope definition node or\n * the program root.\n * @returns The same node, typed as an `AstNode`.\n */\nexport function toAstNode(node: Pick<Rule.Node, \"type\">): AstNode {\n return node as unknown as AstNode;\n}\n\n/**\n * Reads a child node off an AST node.\n *\n * @param node - The parent node.\n * @param name - The field name, such as `expression`.\n * @returns The child node, or `undefined` when the field is missing or not a node.\n */\nexport function childNode(\n node: AstNode | undefined,\n name: string,\n): AstNode | undefined {\n const value = node?.[name];\n return value && typeof value === \"object\" && \"type\" in value\n ? (value as AstNode)\n : undefined;\n}\n\n/**\n * Reads a list of child nodes off an AST node.\n *\n * @param node - The parent node.\n * @param name - The field name, such as `attributes`.\n * @returns The child nodes, or an empty list when the field is not an array.\n */\nexport function childNodes(node: AstNode | undefined, name: string): AstNode[] {\n const value = node?.[name];\n return Array.isArray(value) ? (value as AstNode[]) : [];\n}\n\n/**\n * Reads a string field off an AST node.\n *\n * @param node - The node.\n * @param name - The field name, such as `name`.\n * @returns The string, or `undefined` when the field is missing or not a string.\n */\nexport function childString(\n node: AstNode | undefined,\n name: string,\n): string | undefined {\n const value = node?.[name];\n return typeof value === \"string\" ? value : undefined;\n}\n\n/**\n * Tells whether a template element value carries cooked text.\n *\n * @param value - The `value` field of a `TemplateElement`.\n * @returns `true` when the value has a string `cooked` field.\n */\nfunction hasCookedText(value: unknown): value is { cooked: string } {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"cooked\" in value &&\n typeof value.cooked === \"string\"\n );\n}\n\n/**\n * Reads the cooked text of a template element.\n *\n * @param quasi - A `TemplateElement`.\n * @returns The cooked text, or an empty string when there is none.\n */\nexport function cookedText(quasi: AstNode | undefined): string {\n const value = quasi?.value;\n return hasCookedText(value) ? value.cooked : \"\";\n}\n\n/**\n * Reads the static name of an object property key.\n *\n * @param property - A `Property`.\n * @returns The non-computed identifier key or any string-literal key (computed included), or\n * `undefined` otherwise.\n */\nexport function keyName(property: AstNode): string | undefined {\n const key = childNode(property, \"key\");\n if (!property.computed && key?.type === \"Identifier\") {\n return childString(key, \"name\");\n }\n return key?.type === \"Literal\" ? childString(key, \"value\") : undefined;\n}\n\n/**\n * Reads the name of a JSX attribute.\n *\n * @param attribute - A `JSXAttribute`.\n * @returns The plain attribute name, or `undefined` for a namespaced name.\n */\nexport function attributeName(attribute: AstNode): string | undefined {\n return childString(childNode(attribute, \"name\"), \"name\");\n}\n\n/**\n * Reads the expression inside a JSX attribute's `{}`.\n *\n * @param attribute - A `JSXAttribute`.\n * @returns The expression, or `undefined` when the value is not an expression container.\n */\nexport function attributeExpression(attribute: AstNode): AstNode | undefined {\n const value = childNode(attribute, \"value\");\n return value?.type === \"JSXExpressionContainer\"\n ? childNode(value, \"expression\")\n : undefined;\n}\n\n/**\n * Reads the tag name of a JSX opening element.\n *\n * @param opening - A `JSXOpeningElement`.\n * @returns The name of a plain identifier tag such as `input` or `Label`; `undefined` for member\n * and namespaced tags.\n */\nexport function jsxElementName(opening: AstNode): string | undefined {\n const name = childNode(opening, \"name\");\n return name?.type === \"JSXIdentifier\" ? childString(name, \"name\") : undefined;\n}\n\n/**\n * Finds a named attribute on a JSX opening element.\n *\n * @param opening - A `JSXOpeningElement`.\n * @param name - The attribute name, such as `htmlFor`.\n * @returns The `JSXAttribute`, or `undefined` when the element does not set it by name.\n */\nexport function findJsxAttribute(\n opening: AstNode,\n name: string,\n): AstNode | undefined {\n return childNodes(opening, \"attributes\").find(\n (attribute) =>\n attribute.type === \"JSXAttribute\" && attributeName(attribute) === name,\n );\n}\n\n/**\n * Reads the value of a JSX attribute.\n *\n * @param attribute - A `JSXAttribute`.\n * @returns The expression inside `{}`, the string literal, or `undefined` for a valueless attribute.\n */\nexport function jsxAttributeValue(attribute: AstNode): AstNode | undefined {\n return attributeExpression(attribute) ?? childNode(attribute, \"value\");\n}\n\n/**\n * Reads the text of a string or number literal, or of a template literal without `${}`.\n *\n * @param value - Any expression.\n * @returns The literal text, or `undefined` when the value is not a static literal.\n */\nexport function staticText(value: AstNode | undefined): string | undefined {\n if (\n value?.type === \"Literal\" &&\n (typeof value.value === \"string\" || typeof value.value === \"number\")\n ) {\n return String(value.value);\n }\n if (\n value?.type === \"TemplateLiteral\" &&\n childNodes(value, \"expressions\").length === 0\n ) {\n return cookedText(childNodes(value, \"quasis\")[0]);\n }\n return undefined;\n}\n\n/**\n * Looks a name up through a scope and its enclosing scopes.\n *\n * @param scope - The innermost scope to search.\n * @param name - The variable name.\n * @returns The variable the name refers to (configured globals included, with no definitions), or\n * `undefined` for undeclared names.\n */\nexport function findVariable(\n scope: Scope.Scope | null,\n name: string,\n): Scope.Variable | undefined {\n for (let current = scope; current; current = current.upper) {\n const variable = current.set.get(name);\n if (variable) {\n return variable;\n }\n }\n return undefined;\n}\n\n/**\n * Tells whether one node lies within another's source range.\n *\n * @param outer - The enclosing candidate.\n * @param inner - The node to locate.\n * @returns `true` when `inner`'s range is inside `outer`'s, or equal to it.\n */\nexport function containsNode(outer: AstNode, inner: AstNode): boolean {\n const [outerStart, outerEnd] = outer.range ?? [0, -1];\n const [innerStart, innerEnd] = inner.range ?? [0, -1];\n return innerStart >= outerStart && innerEnd <= outerEnd;\n}\n","/**\n * Collects the class groups, inline styles, motion keys, style assignments and element handlers of\n * one JavaScript or TypeScript file for the frontend rules.\n *\n * @packageDocumentation\n */\nimport type { Scope, SourceCode } from \"eslint\";\n\nimport {\n type AstNode,\n attributeExpression,\n attributeName,\n childNode,\n childNodes,\n childString,\n containsNode,\n cookedText,\n findVariable,\n FUNCTION_TYPES,\n keyName,\n staticText,\n toAstNode,\n toRuleNode,\n} from \"./ast.js\";\n\n/**\n * Whitespace-separated class tokens from one string or template literal.\n */\nexport interface ClassGroup {\n /** The string or template literal. */\n readonly node: AstNode;\n /** The class tokens in source order. */\n readonly tokens: readonly string[];\n /** The JSX opening element whose attribute holds the literal, or `undefined` outside JSX. */\n readonly element: AstNode | undefined;\n}\n\n/**\n * One key of an inline `style` object, once per statically known value.\n */\nexport interface StyleLeaf {\n /** The object property. */\n readonly node: AstNode;\n /** The kebab-case CSS property name. */\n readonly property: string;\n /** The value text, or `undefined` when no branch of the value is statically known. */\n readonly text: string | undefined;\n /** The JSX opening element that carries the `style` attribute. */\n readonly element: AstNode | undefined;\n}\n\n/**\n * One key of an inline motion object (`initial`, `animate`, `exit`, `while*`, or a `variants`\n * entry), once per statically known value.\n */\nexport interface MotionKey {\n /** The object property. */\n readonly node: AstNode;\n /** The kebab-case CSS property name. */\n readonly property: string;\n /** The value text, or `undefined` when no branch of the value is statically known. */\n readonly text: string | undefined;\n /** The JSX opening element that carries the motion attribute. */\n readonly element: AstNode | undefined;\n /** The motion attribute name, such as `whileFocus`, or `variants` for a `variants` entry. */\n readonly attributeName: string;\n /** The label of the `variants` entry that holds the key, or `undefined` outside `variants`. */\n readonly variantLabel: string | undefined;\n}\n\n/**\n * An assignment to `<expression>.style.<property>`.\n */\nexport interface StyleAssignment {\n /** The assignment expression. */\n readonly node: AstNode;\n /** The kebab-case CSS property name. */\n readonly property: string;\n}\n\n/**\n * An `on*` JSX attribute whose handler function is known in this module.\n */\nexport interface ElementHandler {\n /** The JSX opening element that carries the attribute. */\n readonly element: AstNode;\n /** The attribute name, such as `onFocus`. */\n readonly attributeName: string;\n /** The `JSXAttribute`. */\n readonly attribute: AstNode;\n /**\n * The style assignments inside the function the attribute resolves to; a handler function whose\n * body is a single call to a named function also covers that function's style assignments,\n * followed transitively.\n */\n readonly styleAssignments: readonly StyleAssignment[];\n}\n\n/**\n * Everything the frontend JS rules read from one file.\n */\nexport interface FrontendModel {\n /** Every class group in the file. */\n readonly classGroups: readonly ClassGroup[];\n /** Every inline style leaf in the file. */\n readonly styleLeaves: readonly StyleLeaf[];\n /** Every inline motion key in the file. */\n readonly motionKeys: readonly MotionKey[];\n /** Every style assignment in the file. */\n readonly styleAssignments: readonly StyleAssignment[];\n /** Every element handler whose function is known in the file. */\n readonly handlers: readonly ElementHandler[];\n}\n\n/**\n * An element handler before the walk ends and its style assignments are known.\n */\ninterface PendingHandler extends Omit<ElementHandler, \"styleAssignments\"> {\n /** The function the attribute resolves to, then each named function it only delegates to. */\n readonly handlerFunctions: readonly AstNode[];\n}\n\n/**\n * The model while the walk fills it; handlers get their style assignments once the walk ends.\n */\ninterface MutableModel {\n classGroups: ClassGroup[];\n styleLeaves: StyleLeaf[];\n motionKeys: MotionKey[];\n styleAssignments: StyleAssignment[];\n pendingHandlers: PendingHandler[];\n}\n\n/**\n * A statically named key of an object literal.\n */\ninterface ObjectKey {\n /** The `Property` node. */\n readonly property: AstNode;\n /** The key name. */\n readonly key: string;\n}\n\n/**\n * The keys of one motion object, with the `variants` label it sits under.\n */\ninterface MotionKeyGroup {\n /** The keys of the motion object. */\n readonly keys: readonly ObjectKey[];\n /** The label of the `variants` entry, or `undefined` outside `variants`. */\n readonly variantLabel: string | undefined;\n}\n\nconst MOTION_ATTRIBUTE = /^(?:initial|animate|exit|variants|while[A-Z]\\w*)$/;\nconst EVENT_ATTRIBUTE = /^on[A-Z]/;\nconst CLASS_ATTRIBUTE = /class(?:name)?s?$/i;\nconst EXPRESSION_WRAPPERS = new Set([\n \"TSAsExpression\",\n \"TSSatisfiesExpression\",\n \"TSNonNullExpression\",\n \"ParenthesizedExpression\",\n]);\nconst CLASS_SOURCE_BOUNDARIES = new Set([\n \"CallExpression\",\n \"TaggedTemplateExpression\",\n \"JSXElement\",\n \"JSXFragment\",\n ...FUNCTION_TYPES,\n]);\nconst SOURCE_PARENTS = new Set([\n \"ImportDeclaration\",\n \"ExportNamedDeclaration\",\n \"ExportAllDeclaration\",\n \"ImportExpression\",\n]);\nconst TEMPLATE_BOUNDARY = \"\\u0000\";\nconst models = new WeakMap<object, FrontendModel>();\n\n/**\n * Maps a React style key to its CSS property name.\n *\n * @param key - A camelCase key such as `zIndex` or `WebkitTransition`, or a custom property.\n * @returns The kebab-case CSS name, with vendor prefixes restored.\n */\nexport function computeCssPropertyName(key: string): string {\n if (key.startsWith(\"--\")) {\n return key;\n }\n const kebab = key.replaceAll(\n /[A-Z]/g,\n (letter) => `-${letter.toLowerCase()}`,\n );\n return kebab.startsWith(\"ms-\") ? `-${kebab}` : kebab;\n}\n\n/**\n * Tells whether a property belongs to an object literal passed straight to a call, such as\n * `cn({ \"outline-none\": on })`.\n *\n * @param parent - The parent of a literal.\n * @returns `true` when the parent is such a property.\n */\nfunction isClassHelperKey(parent: AstNode): boolean {\n const object = parent.parent;\n const call = object?.parent;\n return (\n parent.type === \"Property\" &&\n object?.type === \"ObjectExpression\" &&\n call?.type === \"CallExpression\" &&\n childNodes(call, \"arguments\").includes(object)\n );\n}\n\n/**\n * Tells whether a literal is the value of a JSX attribute that does not hold classes, with no call,\n * JSX element or function between them.\n *\n * @param node - A string or template literal.\n * @returns `true` when the literal sits in such an attribute.\n */\nfunction isNonClassAttributeValue(node: AstNode): boolean {\n for (let current = node.parent; current; current = current.parent) {\n if (current.type === \"JSXAttribute\") {\n return !CLASS_ATTRIBUTE.test(attributeName(current) ?? \"\");\n }\n if (CLASS_SOURCE_BOUNDARIES.has(current.type)) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Tells whether a literal is not a class group: a module source, a directive, a property key, a\n * literal type, or a non-class attribute value.\n *\n * @param node - A string or template literal.\n * @returns `true` when the literal is excluded.\n */\nfunction isExcludedLiteral(node: AstNode): boolean {\n const parent = node.parent;\n if (!parent) {\n return true;\n }\n return (\n (SOURCE_PARENTS.has(parent.type) && parent.source === node) ||\n (parent.type === \"ExpressionStatement\" &&\n typeof parent.directive === \"string\") ||\n (parent.key === node && !parent.computed && !isClassHelperKey(parent)) ||\n parent.type === \"TSLiteralType\" ||\n isNonClassAttributeValue(node)\n );\n}\n\n/**\n * Finds the JSX opening element whose attribute holds a node.\n *\n * @param node - Any node.\n * @returns The opening element, or `undefined` outside a JSX attribute.\n */\nfunction enclosingElement(node: AstNode): AstNode | undefined {\n for (let current = node.parent; current; current = current.parent) {\n if (current.type === \"JSXAttribute\") {\n return current.parent;\n }\n }\n return undefined;\n}\n\n/**\n * Splits a template literal into class tokens, dropping tokens that touch a `${}`.\n *\n * @param node - A `TemplateLiteral`.\n * @returns The static tokens in source order.\n */\nfunction templateTokens(node: AstNode): string[] {\n const text = childNodes(node, \"quasis\")\n .map((quasi) => cookedText(quasi))\n .join(TEMPLATE_BOUNDARY);\n return text\n .split(/\\s+/)\n .filter((token) => token !== \"\" && !token.includes(TEMPLATE_BOUNDARY));\n}\n\n/**\n * Adds a literal to the model as a class group unless it is excluded or holds no tokens.\n *\n * @param node - A string or template literal.\n * @param model - The model to fill.\n */\nfunction collectClassGroup(node: AstNode, model: MutableModel): void {\n if (isExcludedLiteral(node)) {\n return;\n }\n const tokens =\n node.type === \"Literal\"\n ? String(node.value).split(/\\s+/).filter(Boolean)\n : templateTokens(node);\n if (tokens.length > 0) {\n model.classGroups.push({ node, tokens, element: enclosingElement(node) });\n }\n}\n\n/**\n * Strips `as`, `satisfies`, non-null and parenthesis wrappers off an expression.\n *\n * @param node - Any expression.\n * @returns The innermost wrapped expression.\n */\nfunction unwrapExpression(node: AstNode | undefined): AstNode | undefined {\n let current = node;\n while (current && EXPRESSION_WRAPPERS.has(current.type)) {\n current = childNode(current, \"expression\");\n }\n return current;\n}\n\n/**\n * Lists the values an expression can take through `?:`, `&&` and `||`.\n *\n * @param node - Any expression.\n * @returns The unwrapped leaf expressions.\n */\nexport function listBranches(node: AstNode | undefined): AstNode[] {\n const expression = unwrapExpression(node);\n if (expression?.type === \"ConditionalExpression\") {\n return [\n ...listBranches(childNode(expression, \"consequent\")),\n ...listBranches(childNode(expression, \"alternate\")),\n ];\n }\n if (expression?.type === \"LogicalExpression\") {\n return [\n ...listBranches(childNode(expression, \"left\")),\n ...listBranches(childNode(expression, \"right\")),\n ];\n }\n return expression ? [expression] : [];\n}\n\n/**\n * Lists the statically named keys of every object literal an expression can take.\n *\n * @param expression - Any expression.\n * @returns The keys in source order.\n */\nfunction listObjectKeys(expression: AstNode | undefined): ObjectKey[] {\n return listBranches(expression)\n .filter((branch) => branch.type === \"ObjectExpression\")\n .flatMap((object) => childNodes(object, \"properties\"))\n .flatMap((property) => {\n const key = property.type === \"Property\" ? keyName(property) : undefined;\n return key === undefined ? [] : [{ property, key }];\n });\n}\n\n/**\n * Lists the static texts an expression can take.\n *\n * @param value - Any expression.\n * @returns The literal texts of its branches.\n */\nexport function listStaticTexts(value: AstNode | undefined): string[] {\n return listBranches(value).flatMap((branch) => {\n const text = staticText(branch);\n return text === undefined ? [] : [text];\n });\n}\n\n/**\n * Lists one entry per key and statically known value of the given object keys.\n *\n * @param keys - The object keys.\n * @param element - The JSX opening element that carries the attribute holding the keys.\n * @returns One entry per key and static value text, or one entry with an `undefined` text for a\n * key whose value has no static branch, in source order.\n */\nfunction listKeyValues(\n keys: readonly ObjectKey[],\n element: AstNode | undefined,\n): StyleLeaf[] {\n return keys.flatMap(({ property, key }) => {\n const texts = listStaticTexts(childNode(property, \"value\"));\n const values = texts.length > 0 ? texts : [undefined];\n return values.map((text) => ({\n node: property,\n property: computeCssPropertyName(key),\n text,\n element,\n }));\n });\n}\n\n/**\n * Adds one style leaf per key and statically known value of a `style` attribute.\n *\n * @param attribute - A `style` `JSXAttribute`.\n * @param model - The model to fill.\n */\nfunction collectStyleLeaves(attribute: AstNode, model: MutableModel): void {\n const keys = listObjectKeys(attributeExpression(attribute));\n model.styleLeaves.push(...listKeyValues(keys, attribute.parent));\n}\n\n/**\n * Lists the key group of each entry of a `variants` object.\n *\n * @param entries - The keys of the `variants` object.\n * @returns One group per entry, holding the keys of the entry's object literal under its label.\n */\nfunction listVariantGroups(entries: readonly ObjectKey[]): MotionKeyGroup[] {\n return entries.map(({ property, key }) => ({\n keys: listObjectKeys(childNode(property, \"value\")),\n variantLabel: key,\n }));\n}\n\n/**\n * Adds one motion key per key and statically known value of a motion attribute, or of each\n * `variants` entry.\n *\n * @param attribute - A motion `JSXAttribute`.\n * @param name - The attribute name.\n * @param model - The model to fill.\n */\nfunction collectMotionKeys(\n attribute: AstNode,\n name: string,\n model: MutableModel,\n): void {\n const keys = listObjectKeys(attributeExpression(attribute));\n const groups: MotionKeyGroup[] =\n name === \"variants\"\n ? listVariantGroups(keys)\n : [{ keys, variantLabel: undefined }];\n const motionKeys = groups.flatMap((group) =>\n listKeyValues(group.keys, attribute.parent).map((leaf) => ({\n ...leaf,\n attributeName: name,\n variantLabel: group.variantLabel,\n })),\n );\n model.motionKeys.push(...motionKeys);\n}\n\n/**\n * Tells whether a callee is `useCallback` or `<object>.useCallback`.\n *\n * @param callee - A call's callee.\n * @returns `true` for `useCallback`.\n */\nfunction isUseCallback(callee: AstNode | undefined): boolean {\n if (callee?.type === \"Identifier\") {\n return callee.name === \"useCallback\";\n }\n return (\n callee?.type === \"MemberExpression\" &&\n childString(childNode(callee, \"property\"), \"name\") === \"useCallback\"\n );\n}\n\n/**\n * Reads the one expression a function body evaluates.\n *\n * @param body - A function's body.\n * @returns An expression body itself, the expression of a block holding one expression statement,\n * or `undefined` for any other block.\n */\nfunction bodyExpression(body: AstNode | undefined): AstNode | undefined {\n if (body?.type !== \"BlockStatement\") {\n return body;\n }\n const statements = childNodes(body, \"body\");\n const [only] = statements;\n return statements.length === 1 && only?.type === \"ExpressionStatement\"\n ? childNode(only, \"expression\")\n : undefined;\n}\n\n/**\n * Finds the named function a handler only delegates to.\n *\n * @param handler - A function node.\n * @returns The callee identifier when the body is a single call to a named function.\n */\nfunction delegateCallee(handler: AstNode): AstNode | undefined {\n const call = bodyExpression(childNode(handler, \"body\"));\n const callee =\n call?.type === \"CallExpression\" ? childNode(call, \"callee\") : undefined;\n return callee?.type === \"Identifier\" ? callee : undefined;\n}\n\n/**\n * Reads the function or `const` initializer a variable definition binds.\n *\n * @param definition - The variable's first definition.\n * @returns The function declaration or `const` initializer, or `undefined` for other definitions.\n */\nfunction definitionExpression(\n definition: Scope.Definition | undefined,\n): AstNode | undefined {\n if (definition?.type === \"FunctionName\") {\n return toAstNode(definition.node);\n }\n return definition?.type === \"Variable\" && definition.parent.kind === \"const\"\n ? childNode(toAstNode(definition.node), \"init\")\n : undefined;\n}\n\n/**\n * Resolves a handler expression to the functions it runs.\n *\n * @param expression - The attribute expression.\n * @param sourceCode - The ESLint source code of the file.\n * @param seen - Expressions already visited, to stop on cycles.\n * @returns The function the expression resolves to, then each named function it only delegates\n * to; empty when the handler is not known in this module.\n */\nfunction resolveHandlerFunctions(\n expression: AstNode | undefined,\n sourceCode: SourceCode,\n seen: Set<AstNode>,\n): AstNode[] {\n if (!expression || seen.has(expression)) {\n return [];\n }\n seen.add(expression);\n if (FUNCTION_TYPES.has(expression.type)) {\n const delegates = resolveHandlerFunctions(\n delegateCallee(expression),\n sourceCode,\n seen,\n );\n return [expression, ...delegates];\n }\n if (\n expression.type === \"CallExpression\" &&\n isUseCallback(childNode(expression, \"callee\"))\n ) {\n return resolveHandlerFunctions(\n childNodes(expression, \"arguments\")[0],\n sourceCode,\n seen,\n );\n }\n if (expression.type !== \"Identifier\") {\n return [];\n }\n const scope = sourceCode.getScope(toRuleNode(expression));\n const definition = findVariable(scope, String(expression.name))?.defs[0];\n return resolveHandlerFunctions(\n definitionExpression(definition),\n sourceCode,\n seen,\n );\n}\n\n/**\n * Tells whether a node is a `style` or motion JSX attribute, whose value the walk does not search\n * for class groups.\n *\n * @param node - Any node.\n * @returns `true` for such an attribute.\n */\nfunction isOpaqueAttribute(node: AstNode): boolean {\n if (node.type !== \"JSXAttribute\") {\n return false;\n }\n const name = attributeName(node) ?? \"\";\n return name === \"style\" || MOTION_ATTRIBUTE.test(name);\n}\n\n/**\n * Adds a JSX attribute's style leaves, motion keys or handler to the model.\n *\n * @param attribute - A `JSXAttribute`.\n * @param model - The model to fill.\n * @param sourceCode - The ESLint source code of the file.\n */\nfunction collectAttribute(\n attribute: AstNode,\n model: MutableModel,\n sourceCode: SourceCode,\n): void {\n const name = attributeName(attribute) ?? \"\";\n if (name === \"style\") {\n collectStyleLeaves(attribute, model);\n return;\n }\n if (MOTION_ATTRIBUTE.test(name)) {\n collectMotionKeys(attribute, name, model);\n return;\n }\n if (!EVENT_ATTRIBUTE.test(name) || !attribute.parent) {\n return;\n }\n const handlerFunctions = resolveHandlerFunctions(\n attributeExpression(attribute),\n sourceCode,\n new Set(),\n );\n if (handlerFunctions.length > 0) {\n model.pendingHandlers.push({\n element: attribute.parent,\n attributeName: name,\n attribute,\n handlerFunctions,\n });\n }\n}\n\n/**\n * Adds an assignment to `<expression>.style.<property>` to the model.\n *\n * @param node - An `AssignmentExpression`.\n * @param model - The model to fill.\n */\nfunction collectStyleAssignment(node: AstNode, model: MutableModel): void {\n const target = childNode(node, \"left\");\n const object = childNode(target, \"object\");\n const isStyle =\n target?.type === \"MemberExpression\" &&\n object?.type === \"MemberExpression\" &&\n !object.computed &&\n childString(childNode(object, \"property\"), \"name\") === \"style\";\n if (!isStyle || !target) {\n return;\n }\n const property = childNode(target, \"property\");\n const name = target.computed\n ? childString(property, \"value\")\n : childString(property, \"name\");\n if (name !== undefined) {\n model.styleAssignments.push({\n node,\n property: computeCssPropertyName(name),\n });\n }\n}\n\n/**\n * Adds whatever one node contributes to the model.\n *\n * @param node - Any node.\n * @param model - The model to fill.\n * @param sourceCode - The ESLint source code of the file.\n */\nfunction collectNode(\n node: AstNode,\n model: MutableModel,\n sourceCode: SourceCode,\n): void {\n if (node.type === \"JSXAttribute\") {\n collectAttribute(node, model, sourceCode);\n } else if (\n (node.type === \"Literal\" && typeof node.value === \"string\") ||\n node.type === \"TemplateLiteral\"\n ) {\n collectClassGroup(node, model);\n } else if (node.type === \"AssignmentExpression\") {\n collectStyleAssignment(node, model);\n }\n}\n\n/**\n * Walks a subtree depth first.\n *\n * @param node - The root of the subtree.\n * @param keys - The parser's visitor keys.\n * @param visit - Called on each node; returning `false` skips its children.\n */\nfunction traverse(\n node: AstNode,\n keys: SourceCode.VisitorKeys,\n visit: (node: AstNode) => boolean,\n): void {\n if (!visit(node)) {\n return;\n }\n for (const key of keys[node.type] ?? []) {\n const child = node[key];\n const children = Array.isArray(child) ? (child as unknown[]) : [child];\n for (const item of children) {\n if (item && typeof item === \"object\" && \"type\" in item) {\n traverse(item as AstNode, keys, visit);\n }\n }\n }\n}\n\n/**\n * Lists the style assignments inside any of the given functions.\n *\n * @param functions - Function nodes.\n * @param assignments - Every style assignment in the file.\n * @returns The contained assignments, in source order.\n */\nfunction selectContainedAssignments(\n functions: readonly AstNode[],\n assignments: readonly StyleAssignment[],\n): StyleAssignment[] {\n return assignments.filter((assignment) =>\n functions.some((container) => containsNode(container, assignment.node)),\n );\n}\n\n/**\n * Walks one file once and returns everything the frontend JS rules check.\n *\n * Class groups are every string literal and every template literal (tokens touching `${}` are\n * dropped), except import and export sources, directives, property keys, literal types, and\n * values of JSX attributes other than `class`/`className`-style ones, unless a call, tagged\n * template, JSX element or function sits between the attribute and the literal. String keys of an\n * object passed straight to a call, such as `cn({ \"outline-none\": on })`, are class groups.\n * Inline `style` objects and motion objects, including branches of `?:`/`&&`/`||` and\n * `as`/`satisfies` wrappers, give style leaves and motion keys instead of class groups. Handlers\n * resolve through names, `const` aliases and `useCallback`; a handler function whose body is a\n * single call to a named function also covers that function's style assignments, followed\n * transitively. Repeated calls for the same file return the same model.\n *\n * @param sourceCode - The ESLint source code of the file.\n * @returns The collected model.\n */\nexport function collectFrontendModel(sourceCode: SourceCode): FrontendModel {\n const cached = models.get(sourceCode.ast);\n if (cached) {\n return cached;\n }\n const model: MutableModel = {\n classGroups: [],\n styleLeaves: [],\n motionKeys: [],\n styleAssignments: [],\n pendingHandlers: [],\n };\n traverse(toAstNode(sourceCode.ast), sourceCode.visitorKeys, (node) => {\n collectNode(node, model, sourceCode);\n return !isOpaqueAttribute(node);\n });\n const { pendingHandlers, ...collected } = model;\n const handlers = pendingHandlers.map(({ handlerFunctions, ...handler }) => ({\n ...handler,\n styleAssignments: selectContainedAssignments(\n handlerFunctions,\n collected.styleAssignments,\n ),\n }));\n const result: FrontendModel = { ...collected, handlers };\n models.set(sourceCode.ast, result);\n return result;\n}\n","/**\n * The motion concept: transitions and animations that animate every property or a layout\n * property.\n *\n * @packageDocumentation\n */\nimport {\n type CssNodePlain,\n lexer,\n property as describeProperty,\n type ValuePlain,\n} from \"@eslint/css-tree\";\n\nimport {\n CSS_WIDE_KEYWORDS,\n type Declaration,\n isVariableReference,\n parseValue,\n referencedVariable,\n splitOnCommas,\n} from \"../css-declarations.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\n\n/**\n * Why one transition layer, property or animated property is not allowed.\n *\n * `all` and `implicitAll` animate every property, `layout` animates a property that reflows the\n * page, and `unverifiable` means the property is unknown, the layer does not parse as a\n * transition, or the property hides behind `var()`.\n */\nexport interface MotionFinding {\n /** The reason the motion is not allowed. */\n readonly kind: \"all\" | \"implicitAll\" | \"layout\" | \"unverifiable\";\n /** The offending property, or `undefined` when it is not known. */\n readonly property: string | undefined;\n}\n\n/**\n * One motion diagnostic at a node of any AST.\n */\nexport interface MotionReport<Node> {\n /** The node to report at. */\n readonly node: Node;\n /** The finding kind, used as the message ID. */\n readonly messageId: MotionFinding[\"kind\"];\n /** The `source` and `property` placeholder values. */\n readonly data: Readonly<Record<string, string>>;\n}\n\n/**\n * Report messages for motion findings, keyed by finding kind, with `source` and `property`\n * placeholders.\n */\nexport const MOTION_MESSAGES: Readonly<Record<MotionFinding[\"kind\"], string>> =\n {\n all: \"{{source}} transitions all properties; list the properties it animates, such as transform, opacity or filter.\",\n implicitAll:\n \"{{source}} has a transition layer without a property, which animates all properties; name the property.\",\n layout:\n \"{{source}} animates the layout property {{property}}; animate transform, opacity or filter instead.\",\n unverifiable:\n \"{{source}} animates a property that cannot be verified statically; name a known property.\",\n };\n\n/**\n * Properties whose change reflows layout. Animating them is flagged.\n */\nexport const LAYOUT_PROPERTIES: ReadonlySet<string> = new Set([\n \"width\",\n \"height\",\n \"min-width\",\n \"min-height\",\n \"max-width\",\n \"max-height\",\n \"block-size\",\n \"inline-size\",\n \"min-block-size\",\n \"min-inline-size\",\n \"max-block-size\",\n \"max-inline-size\",\n \"aspect-ratio\",\n \"contain-intrinsic-size\",\n \"contain-intrinsic-width\",\n \"contain-intrinsic-height\",\n \"contain-intrinsic-block-size\",\n \"contain-intrinsic-inline-size\",\n \"inset\",\n \"inset-block\",\n \"inset-block-start\",\n \"inset-block-end\",\n \"inset-inline\",\n \"inset-inline-start\",\n \"inset-inline-end\",\n \"top\",\n \"right\",\n \"bottom\",\n \"left\",\n \"margin\",\n \"margin-top\",\n \"margin-right\",\n \"margin-bottom\",\n \"margin-left\",\n \"margin-block\",\n \"margin-block-start\",\n \"margin-block-end\",\n \"margin-inline\",\n \"margin-inline-start\",\n \"margin-inline-end\",\n \"margin-trim\",\n \"padding\",\n \"padding-top\",\n \"padding-right\",\n \"padding-bottom\",\n \"padding-left\",\n \"padding-block\",\n \"padding-block-start\",\n \"padding-block-end\",\n \"padding-inline\",\n \"padding-inline-start\",\n \"padding-inline-end\",\n \"border\",\n \"border-width\",\n \"border-top\",\n \"border-right\",\n \"border-bottom\",\n \"border-left\",\n \"border-top-width\",\n \"border-right-width\",\n \"border-bottom-width\",\n \"border-left-width\",\n \"border-block\",\n \"border-block-width\",\n \"border-block-start\",\n \"border-block-start-width\",\n \"border-block-end\",\n \"border-block-end-width\",\n \"border-inline\",\n \"border-inline-width\",\n \"border-inline-start\",\n \"border-inline-start-width\",\n \"border-inline-end\",\n \"border-inline-end-width\",\n \"border-spacing\",\n \"gap\",\n \"row-gap\",\n \"column-gap\",\n \"grid-gap\",\n \"grid-row-gap\",\n \"grid-column-gap\",\n \"grid\",\n \"grid-area\",\n \"grid-auto-columns\",\n \"grid-auto-flow\",\n \"grid-auto-rows\",\n \"grid-column\",\n \"grid-column-start\",\n \"grid-column-end\",\n \"grid-row\",\n \"grid-row-start\",\n \"grid-row-end\",\n \"grid-template\",\n \"grid-template-areas\",\n \"grid-template-columns\",\n \"grid-template-rows\",\n \"flex\",\n \"flex-basis\",\n \"flex-direction\",\n \"flex-flow\",\n \"flex-grow\",\n \"flex-line-count\",\n \"flex-shrink\",\n \"flex-wrap\",\n \"order\",\n \"columns\",\n \"column-count\",\n \"column-fill\",\n \"column-height\",\n \"column-span\",\n \"column-width\",\n \"column-wrap\",\n \"font\",\n \"font-family\",\n \"font-feature-settings\",\n \"font-kerning\",\n \"font-language-override\",\n \"font-optical-sizing\",\n \"font-size\",\n \"font-size-adjust\",\n \"font-stretch\",\n \"font-style\",\n \"font-synthesis\",\n \"font-synthesis-position\",\n \"font-synthesis-small-caps\",\n \"font-synthesis-style\",\n \"font-synthesis-weight\",\n \"font-variant\",\n \"font-variant-alternates\",\n \"font-variant-caps\",\n \"font-variant-east-asian\",\n \"font-variant-emoji\",\n \"font-variant-ligatures\",\n \"font-variant-numeric\",\n \"font-variant-position\",\n \"font-variation-settings\",\n \"font-weight\",\n \"font-width\",\n \"line-height\",\n \"letter-spacing\",\n \"word-spacing\",\n \"text-indent\",\n \"tab-size\",\n \"vertical-align\",\n \"scrollbar-width\",\n \"zoom\",\n]);\n\nconst TRANSITION_KEYWORDS = new Set([\n \"ease\",\n \"ease-in\",\n \"ease-out\",\n \"ease-in-out\",\n \"linear\",\n \"step-start\",\n \"step-end\",\n \"normal\",\n \"allow-discrete\",\n]);\nconst THEME_ANIMATION = /^--animate-/;\n\n/**\n * Tells whether animating a property reflows layout.\n *\n * @param property - A CSS property name, vendor prefix allowed.\n * @returns `true` for properties in `LAYOUT_PROPERTIES`.\n */\nexport function isLayoutProperty(property: string): boolean {\n return LAYOUT_PROPERTIES.has(describeProperty(property).basename);\n}\n\n/**\n * Classifies one transitioned property name.\n *\n * @param name - A property name as written.\n * @returns An `all`, `unverifiable` or `layout` finding, or `undefined` for `none`, custom\n * properties, CSS-wide keywords and non-layout properties.\n */\nfunction classifyPropertyName(name: string): MotionFinding | undefined {\n const lower = name.toLowerCase();\n if (\n name.startsWith(\"--\") ||\n lower === \"none\" ||\n CSS_WIDE_KEYWORDS.has(lower)\n ) {\n return undefined;\n }\n if (lower === \"all\") {\n return { kind: \"all\", property: lower };\n }\n if (lexer.checkPropertyName(lower) !== undefined) {\n return { kind: \"unverifiable\", property: lower };\n }\n return isLayoutProperty(lower)\n ? { kind: \"layout\", property: lower }\n : undefined;\n}\n\n/**\n * Classifies one layer of a `transition` shorthand.\n *\n * @param layer - The nodes of one comma-separated layer.\n * @returns A finding for the layer's property, `implicitAll` when it names none, or\n * `unverifiable` when it does not parse or its property is behind `var()`.\n */\nfunction classifyTransitionLayer(\n layer: readonly CssNodePlain[],\n): MotionFinding | undefined {\n const rest = layer.filter((node) => !isVariableReference(node));\n const stripped = rest.length !== layer.length;\n if (\n rest.length > 0 &&\n lexer.matchProperty(\"transition\", { type: \"Value\", children: rest }).error\n ) {\n return { kind: \"unverifiable\", property: undefined };\n }\n const names = rest.flatMap((node) =>\n node.type === \"Identifier\" &&\n !TRANSITION_KEYWORDS.has(node.name.toLowerCase())\n ? [node.name]\n : [],\n );\n const [name] = names;\n if (name === undefined) {\n return stripped\n ? { kind: \"unverifiable\", property: undefined }\n : { kind: \"implicitAll\", property: undefined };\n }\n return classifyPropertyName(name);\n}\n\n/**\n * Classifies one item of a `transition-property` list.\n *\n * @param item - The nodes of one comma-separated item.\n * @returns A finding for the property, or `unverifiable` when the item is not one identifier.\n */\nfunction classifyPropertyItem(\n item: readonly CssNodePlain[],\n): MotionFinding | undefined {\n const [only, ...rest] = item;\n if (rest.length > 0 || only?.type !== \"Identifier\") {\n return { kind: \"unverifiable\", property: undefined };\n }\n return classifyPropertyName(only.name);\n}\n\n/**\n * Tells whether a whole value is one CSS-wide keyword.\n *\n * @param value - A parsed declaration value.\n * @returns `true` for a value such as `inherit`.\n */\nfunction isCssWideKeywordValue(value: ValuePlain): boolean {\n const [only, ...rest] = value.children;\n return (\n rest.length === 0 &&\n only?.type === \"Identifier\" &&\n CSS_WIDE_KEYWORDS.has(only.name.toLowerCase())\n );\n}\n\n/**\n * Tells whether a finding exists.\n *\n * @param finding - A finding or `undefined`.\n * @returns `true` when `finding` is defined.\n */\nfunction isPresent(\n finding: MotionFinding | undefined,\n): finding is MotionFinding {\n return finding !== undefined;\n}\n\n/**\n * Checks a `transition` or `transition-property` declaration.\n *\n * Flags layers and items that animate all properties, a layout property, or a property that\n * cannot be verified. `none`, custom properties and a whole-value CSS-wide keyword pass.\n *\n * @param declaration - Any declaration; other properties yield no findings.\n * @returns One finding per offending layer or list item.\n */\nexport function evaluateTransition(declaration: Declaration): MotionFinding[] {\n const basename = describeProperty(declaration.property).basename;\n if (\n (basename !== \"transition\" && basename !== \"transition-property\") ||\n isCssWideKeywordValue(declaration.value)\n ) {\n return [];\n }\n const layers = splitOnCommas(declaration.value.children);\n const classify =\n basename === \"transition\" ? classifyTransitionLayer : classifyPropertyItem;\n return layers\n .map((layer) => classify(layer))\n .filter((finding) => isPresent(finding));\n}\n\n/**\n * Checks a declaration written inside `@keyframes`.\n *\n * @param declaration - A declaration from a project stylesheet.\n * @returns A `layout` finding when a keyframe animates a layout property.\n */\nexport function evaluateKeyframeDeclaration(\n declaration: Declaration,\n): MotionFinding[] {\n return declaration.inKeyframes && isLayoutProperty(declaration.property)\n ? [{ kind: \"layout\", property: declaration.property }]\n : [];\n}\n\n/**\n * Resolves the `var(--animate-*)` references of an animation value through the theme.\n *\n * @param value - An `animation` or `animation-name` value.\n * @param view - The project design system.\n * @returns The parsed theme values of the references the theme defines.\n */\nfunction resolveThemeAnimationValues(\n value: ValuePlain,\n view: DesignSystemView,\n): ValuePlain[] {\n return value.children.flatMap((node) => {\n const name = referencedVariable(node);\n if (name === undefined || !THEME_ANIMATION.test(name)) {\n return [];\n }\n const resolved = view.themeValue(name);\n return resolved === undefined ? [] : [parseValue(resolved)];\n });\n}\n\n/**\n * Checks an `animation` or `animation-name` declaration against the theme keyframes it names.\n *\n * Names may be identifiers or quoted strings, and `var(--animate-*)` is resolved through the\n * theme. Names the theme does not define are skipped; keyframes in project stylesheets are\n * checked where they are defined.\n *\n * @param declaration - Any declaration; other properties yield no findings.\n * @param view - The project design system.\n * @returns One `layout` finding per layout property the named keyframes animate.\n */\nexport function evaluateAnimation(\n declaration: Declaration,\n view: DesignSystemView,\n): MotionFinding[] {\n const basename = describeProperty(declaration.property).basename;\n if (basename !== \"animation\" && basename !== \"animation-name\") {\n return [];\n }\n const values = [\n declaration.value,\n ...resolveThemeAnimationValues(declaration.value, view),\n ];\n const properties = values\n .flatMap((value) => value.children)\n .flatMap((node) => {\n const name = animationName(node);\n return name === undefined ? [] : (view.keyframeProperties(name) ?? []);\n });\n return [...new Set(properties)]\n .filter((property) => isLayoutProperty(property))\n .map((property) => ({ kind: \"layout\", property }));\n}\n\n/**\n * Reads the keyframes name a node of an animation value can be.\n *\n * @param node - A top-level node of an animation value.\n * @returns The identifier or string text, or `undefined` for other nodes.\n */\nfunction animationName(node: CssNodePlain): string | undefined {\n if (node.type === \"Identifier\") {\n return node.name;\n }\n return node.type === \"String\" ? node.value : undefined;\n}\n\n/**\n * Checks a motion prop key such as `animate={{ height: 0 }}`.\n *\n * @param property - The key mapped to its CSS property name.\n * @returns A `layout` finding when the key is a layout property.\n */\nexport function evaluateMotionKey(property: string): MotionFinding[] {\n return isLayoutProperty(property) ? [{ kind: \"layout\", property }] : [];\n}\n\n/**\n * Reports each motion finding at one node, naming the source that caused it.\n *\n * @param report - The function that emits one diagnostic.\n * @param node - The node to report at.\n * @param source - The class token, style key or property the findings belong to.\n * @param findings - The findings to report.\n */\nexport function reportMotionFindings<Node>(\n report: (motionReport: MotionReport<Node>) => void,\n node: Node,\n source: string,\n findings: readonly MotionFinding[],\n): void {\n for (const finding of findings) {\n report({\n node,\n messageId: finding.kind,\n data: { source, property: finding.property ?? \"\" },\n });\n }\n}\n","/**\n * Reports diagnostics for nodes from the frontend model.\n *\n * @packageDocumentation\n */\nimport type { Rule } from \"eslint\";\n\nimport { type AstNode, toRuleNode } from \"./ast.js\";\n\n/**\n * One diagnostic for a node from the frontend model.\n */\nexport interface FrontendReport {\n /** The node to report at. */\n readonly node: AstNode;\n /** The rule's message ID. */\n readonly messageId: string;\n /** The message placeholder values. */\n readonly data?: Readonly<Record<string, string>>;\n}\n\n/**\n * Reports one diagnostic.\n */\nexport type Reporter = (report: FrontendReport) => void;\n\n/**\n * Builds a reporter that reports each node, message and data combination once per rule run, so a\n * style key with several model entries (one per branch of a conditional value) yields one\n * diagnostic.\n *\n * @param context - The rule context to report to.\n * @returns A function that reports a diagnostic unless the same one was already reported.\n */\nexport function createUniqueReporter(context: Rule.RuleContext): Reporter {\n const reported = new Map<AstNode, Set<string>>();\n return ({ node, messageId, data }) => {\n const key = JSON.stringify([messageId, data ?? {}]);\n const keys = reported.get(node) ?? new Set<string>();\n if (keys.has(key)) {\n return;\n }\n keys.add(key);\n reported.set(node, keys);\n context.report({ node: toRuleNode(node), messageId, data });\n };\n}\n","/**\n * The `animated-properties` rule: transitions and animations in classes, inline styles and motion\n * props may animate paint properties only.\n *\n * @packageDocumentation\n */\nimport type { Rule } from \"eslint\";\n\nimport { compileClassGroup } from \"../class-group-declarations.js\";\nimport { collectFrontendModel, type FrontendModel } from \"../collect.js\";\nimport {\n evaluateAnimation,\n evaluateMotionKey,\n evaluateTransition,\n MOTION_MESSAGES,\n type MotionFinding,\n reportMotionFindings,\n} from \"../concepts/motion.js\";\nimport { type Declaration, parseStyleLeaf } from \"../css-declarations.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\nimport { createUniqueReporter, type Reporter } from \"../report.js\";\n\n/**\n * Checks a declaration's transitions and animations.\n *\n * @param declaration - The declaration, or `undefined` when the style leaf's value is not\n * statically known.\n * @param view - The project design system that resolves theme keyframes.\n * @returns The motion findings; none for `undefined`.\n */\nfunction evaluateDeclarationMotion(\n declaration: Declaration | undefined,\n view: DesignSystemView,\n): MotionFinding[] {\n return declaration\n ? [\n ...evaluateTransition(declaration),\n ...evaluateAnimation(declaration, view),\n ]\n : [];\n}\n\n/**\n * Reports the motion findings of every class group, style leaf and motion key in a file.\n *\n * @param report - The reporter to send diagnostics to.\n * @param model - The file's frontend model.\n * @param view - The project design system.\n */\nfunction reportModelMotion(\n report: Reporter,\n model: FrontendModel,\n view: DesignSystemView,\n): void {\n for (const group of model.classGroups) {\n for (const { token, declarations } of compileClassGroup(group, view)) {\n const findings = declarations.flatMap((declaration) =>\n evaluateDeclarationMotion(declaration, view),\n );\n reportMotionFindings(report, group.node, token, findings);\n }\n }\n for (const leaf of model.styleLeaves) {\n const findings = evaluateDeclarationMotion(parseStyleLeaf(leaf), view);\n reportMotionFindings(report, leaf.node, leaf.property, findings);\n }\n for (const key of model.motionKeys) {\n const findings = evaluateMotionKey(key.property);\n reportMotionFindings(report, key.node, key.property, findings);\n }\n}\n\n/**\n * Builds `animated-properties`: transitions and animations in classes, inline styles and motion\n * props may not animate all properties, layout properties or unverifiable properties.\n *\n * @param view - The project design system.\n * @returns The rule.\n */\nexport function createAnimatedPropertiesRule(\n view: DesignSystemView,\n): Rule.RuleModule {\n return {\n meta: {\n type: \"problem\",\n docs: { description: \"Animate paint properties only.\" },\n messages: MOTION_MESSAGES,\n schema: [],\n },\n create(context) {\n return {\n \"Program:exit\"() {\n const report = createUniqueReporter(context);\n const model = collectFrontendModel(context.sourceCode);\n reportModelMotion(report, model, view);\n },\n };\n },\n };\n}\n","/**\n * The color concept: color literals in arbitrary values, and references to Tailwind's default\n * palette.\n *\n * @packageDocumentation\n */\nimport {\n type CssNode,\n type CssNodePlain,\n lexer,\n type ValuePlain,\n} from \"@eslint/css-tree\";\n\nimport {\n type Declaration,\n firstIdentifierArgument,\n isVariableReference,\n listCssChildren,\n listValueNodes,\n parseValue,\n splitOnCommas,\n} from \"../css-declarations.js\";\nimport type { ClassCandidate, DesignSystemView } from \"../design-system.js\";\n\n/**\n * Report message for a default-palette color, with `source` and `variable` placeholders.\n */\nexport const DEFAULT_PALETTE_MESSAGE =\n \"{{source}} uses {{variable}} from Tailwind's default palette; use a project color token.\";\n\nconst COLOR_FUNCTIONS = new Set([\n \"rgb\",\n \"rgba\",\n \"hsl\",\n \"hsla\",\n \"hwb\",\n \"lab\",\n \"lch\",\n \"oklab\",\n \"oklch\",\n \"color\",\n]);\nconst KEYWORD_COLORS = new Set([\"transparent\", \"currentcolor\"]);\nconst THEME_COLOR = /^--color-/;\nconst THEME_FUNCTIONS = new Set([\"var\", \"theme\", \"--theme\"]);\n\n/**\n * Tells whether a node is `transparent` or `currentcolor`.\n *\n * @param node - A plain css-tree node.\n * @returns `true` for either keyword, in any letter case.\n */\nfunction isKeywordColor(node: CssNodePlain | undefined): boolean {\n return (\n node?.type === \"Identifier\" && KEYWORD_COLORS.has(node.name.toLowerCase())\n );\n}\n\n/**\n * Tells whether a node is a named color literal such as `red`.\n *\n * @param node - A plain css-tree node.\n * @returns `true` for named colors other than `transparent` and `currentcolor`.\n */\nfunction isNamedColor(node: CssNodePlain): boolean {\n return (\n node.type === \"Identifier\" &&\n !isKeywordColor(node) &&\n lexer.matchType(\"named-color\", node).error === null\n );\n}\n\n/**\n * Lists a function's arguments without separators.\n *\n * @param node - A plain css-tree node.\n * @returns The non-operator children of a function; empty for other nodes.\n */\nfunction functionArguments(node: CssNodePlain): CssNodePlain[] {\n return node.type === \"Function\"\n ? node.children.filter((child) => child.type !== \"Operator\")\n : [];\n}\n\n/**\n * Tells whether a color function takes all its channels from tokens.\n *\n * @param node - A color function such as `oklch(...)`.\n * @returns `true` when every channel is `var()`, or for relative syntax, when the origin is\n * `var()` and every channel is a keyword or `var()`.\n */\nfunction hasTokenChannels(node: CssNodePlain): boolean {\n const name = node.type === \"Function\" ? node.name.toLowerCase() : \"\";\n const [first, ...rest] = functionArguments(node);\n if (first?.type === \"Identifier\" && first.name.toLowerCase() === \"from\") {\n const [origin, ...channels] = rest;\n const skipped = name === \"color\" ? channels.slice(1) : channels;\n return (\n isVariableReference(origin) &&\n skipped.every(\n (channel) =>\n channel.type === \"Identifier\" || isVariableReference(channel),\n )\n );\n }\n const channels =\n name === \"color\" && first?.type === \"Identifier\" ? rest : [first, ...rest];\n return channels.every((channel) => isVariableReference(channel));\n}\n\n/**\n * Tells whether every color operand of a `color-mix()` is a token.\n *\n * @param node - A `color-mix()` function.\n * @returns `true` when every operand after the interpolation method is made of percentages,\n * `var()`, `transparent` or `currentcolor`.\n */\nfunction hasTokenOperands(node: CssNodePlain): boolean {\n const [, ...operands] = splitOnCommas(\n node.type === \"Function\" ? node.children : [],\n );\n return operands.every((operand) =>\n operand.every(\n (part) =>\n part.type === \"Percentage\" ||\n isVariableReference(part) ||\n isKeywordColor(part),\n ),\n );\n}\n\n/**\n * Tells whether a node contains a color literal.\n *\n * @param node - A plain css-tree node.\n * @returns `true` for hex and named colors, color functions with a literal channel, `color-mix()`\n * with a literal operand, and any of these nested in a `var()` fallback or another function.\n */\nfunction containsLiteral(node: CssNodePlain): boolean {\n if (node.type === \"Hash\" || isNamedColor(node)) {\n return true;\n }\n if (\n node.type !== \"Function\" &&\n node.type !== \"Value\" &&\n node.type !== \"Parentheses\"\n ) {\n return false;\n }\n const name = node.type === \"Function\" ? node.name.toLowerCase() : \"\";\n if (name === \"var\") {\n return splitOnCommas(node.children)\n .slice(1)\n .some((fallback) => fallback.some((part) => containsLiteral(part)));\n }\n if (COLOR_FUNCTIONS.has(name)) {\n return !hasTokenChannels(node);\n }\n if (name === \"color-mix\") {\n return !hasTokenOperands(node);\n }\n return node.children.some((child) => containsLiteral(child));\n}\n\n/**\n * Tells whether an authored arbitrary value writes a color literal instead of a token.\n *\n * Flags hex colors, named colors other than `transparent` and `currentcolor`, and color\n * functions with any literal channel or alpha, including inside `var()` fallbacks. Relative color\n * syntax passes only with a `var()` origin and keyword or `var()` channels; `color-mix` passes\n * when every color operand is `var()`, `transparent` or `currentcolor`. Strings and URLs are never\n * colors.\n *\n * @param text - An arbitrary value or modifier as written inside `[...]`.\n * @returns `true` when the value contains a color literal.\n */\nexport function containsColorLiteral(text: string): boolean {\n return containsLiteral(parseValue(text));\n}\n\n/**\n * Replaces each `var()` that has a fallback with that fallback, at any depth.\n *\n * @param node - A plain css-tree node.\n * @returns The node with fallbacks in place of `var()` calls, as a list because a fallback can be\n * several nodes; a `var()` without a fallback stays as it is.\n */\nfunction substituteVariableFallbacks(node: CssNodePlain): CssNodePlain[] {\n if (isVariableReference(node)) {\n const comma = node.children.findIndex(\n (child) => child.type === \"Operator\" && child.value === \",\",\n );\n return comma === -1\n ? [node]\n : node.children\n .slice(comma + 1)\n .flatMap((child) => substituteVariableFallbacks(child));\n }\n const children = listCssChildren(node);\n if (children.length === 0) {\n return [node];\n }\n const substituted = children.flatMap((child) =>\n substituteVariableFallbacks(child),\n );\n return [{ ...node, children: substituted } as CssNodePlain];\n}\n\n/**\n * Tells whether a declaration can set a color, so a color literal in it is a color choice.\n *\n * Each `var()` with a fallback is judged as its fallback. Custom properties can hold anything,\n * and values the CSS grammar still cannot match (such as a `var()` without a fallback) are\n * assumed to set one.\n *\n * @param declaration - A compiled class declaration.\n * @returns `true` for custom properties, unmatchable values, and values with a node in a `<color>`\n * position; `false` for, say, `grid-area: red`, `grid-area: var(--area, red)` or\n * `animation: red 1s`.\n */\nexport function canSetColor(declaration: Declaration): boolean {\n if (declaration.property.startsWith(\"--\")) {\n return true;\n }\n const [value = declaration.value] = substituteVariableFallbacks(\n declaration.value,\n );\n const match = lexer.matchProperty(declaration.property, value);\n if (match.error !== null) {\n return true;\n }\n return listValueNodes(value).some((node) =>\n match.isType(node as unknown as CssNode, \"color\"),\n );\n}\n\n/**\n * Builds the theme color variable a parse's value names.\n *\n * @param candidate - One parse of a class token.\n * @returns `--color-<value>`.\n */\nfunction themeColorVariable(candidate: ClassCandidate): string {\n return `--color-${candidate.value ?? \"\"}`;\n}\n\n/**\n * Reads the theme value of the project color a parse names.\n *\n * @param candidate - One parse of a class token.\n * @param view - The project design system.\n * @returns The theme value of a named value whose `--color-*` variable the project defines,\n * including an `@theme inline` color that aliases a default-palette color; `undefined` for any\n * other parse.\n */\nfunction projectThemeValue(\n candidate: ClassCandidate,\n view: DesignSystemView,\n): string | undefined {\n const variable = themeColorVariable(candidate);\n return candidate.valueKind === \"named\" &&\n !view.isDefaultThemeVariable(variable)\n ? view.themeValue(variable)\n : undefined;\n}\n\n/**\n * Tells whether a parse names a color the project theme defines.\n *\n * @param candidate - One parse of a class token.\n * @param view - The project design system.\n * @returns `true` for a named value whose `--color-*` variable the project defines, including an\n * `@theme inline` color that aliases a default-palette color.\n */\nexport function isProjectThemeColor(\n candidate: ClassCandidate,\n view: DesignSystemView,\n): boolean {\n return projectThemeValue(candidate, view) !== undefined;\n}\n\n/**\n * Lists the Tailwind default-palette colors behind the project theme color a parse names.\n *\n * @param candidate - One parse of a class token.\n * @param view - The project design system.\n * @returns The default-palette `--color-*` names the project color's theme value references, such\n * as `--color-red-500` for an `@theme inline` alias of it; empty when the parse names no project\n * color.\n */\nexport function listAliasedPaletteColors(\n candidate: ClassCandidate,\n view: DesignSystemView,\n): string[] {\n const value = projectThemeValue(candidate, view);\n return value === undefined\n ? []\n : listDefaultPaletteColors(parseValue(value), view);\n}\n\n/**\n * Lists the Tailwind default-palette color variables a value references.\n *\n * @param value - A parsed declaration value.\n * @param view - The project design system.\n * @returns The `--color-*` names, referenced through `var()`, `theme()` or `--theme()`, that come\n * from Tailwind's default theme, not the project.\n */\nexport function listDefaultPaletteColors(\n value: ValuePlain,\n view: DesignSystemView,\n): string[] {\n return listValueNodes(value).flatMap((node) => {\n const isThemeReference =\n node.type === \"Function\" && THEME_FUNCTIONS.has(node.name.toLowerCase());\n const name = isThemeReference ? firstIdentifierArgument(node) : undefined;\n const isDefaultColor =\n name !== undefined &&\n THEME_COLOR.test(name) &&\n view.isDefaultThemeVariable(name);\n return isDefaultColor ? [name] : [];\n });\n}\n","/**\n * The `color-tokens` rule: class tokens and inline styles may use project color tokens only.\n *\n * @packageDocumentation\n */\nimport type { Rule } from \"eslint\";\n\nimport { compileClassGroup } from \"../class-group-declarations.js\";\nimport {\n type ClassGroup,\n collectFrontendModel,\n type StyleLeaf,\n} from \"../collect.js\";\nimport {\n canSetColor,\n containsColorLiteral,\n DEFAULT_PALETTE_MESSAGE,\n listAliasedPaletteColors,\n listDefaultPaletteColors,\n} from \"../concepts/color.js\";\nimport { type Declaration, parseStyleLeaf } from \"../css-declarations.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\nimport { createUniqueReporter, type Reporter } from \"../report.js\";\n\n/**\n * Tells whether a token writes a color literal in an arbitrary value of a property that takes a\n * color.\n *\n * @param token - One class token.\n * @param declarations - The declarations the token compiles to.\n * @param view - The project design system that parses the token.\n * @returns `true` when an arbitrary input holds a color literal and a declaration can set a color.\n */\nfunction hasColorLiteral(\n token: string,\n declarations: readonly Declaration[],\n view: DesignSystemView,\n): boolean {\n const inputs = view\n .candidatesOf(token)\n .flatMap((candidate) => candidate.arbitraryInputs);\n return (\n inputs.some((input) => containsColorLiteral(input)) &&\n declarations.some((declaration) => canSetColor(declaration))\n );\n}\n\n/**\n * Lists the default-palette colors a token reaches through the project theme colors it names.\n *\n * @param token - One class token.\n * @param view - The project design system that parses the token.\n * @returns The default-palette `--color-*` names behind each project color a parse of the token\n * names, such as an `@theme inline` alias of a default-palette color.\n */\nfunction collectExemptPaletteColors(\n token: string,\n view: DesignSystemView,\n): Set<string> {\n return new Set(\n view\n .candidatesOf(token)\n .flatMap((candidate) => listAliasedPaletteColors(candidate, view)),\n );\n}\n\n/**\n * Reports the color literals and default palette colors of every token in a class group, except\n * the palette colors behind a project theme color the token names.\n *\n * @param report - The reporter to send diagnostics to.\n * @param group - One class group.\n * @param view - The project design system.\n */\nfunction checkClassGroup(\n report: Reporter,\n group: ClassGroup,\n view: DesignSystemView,\n): void {\n for (const { token, declarations } of compileClassGroup(group, view)) {\n if (hasColorLiteral(token, declarations, view)) {\n report({\n node: group.node,\n messageId: \"literal\",\n data: { source: token },\n });\n }\n const exemptVariables = collectExemptPaletteColors(token, view);\n for (const declaration of declarations) {\n const paletteColors = listDefaultPaletteColors(declaration.value, view);\n const variables = paletteColors.filter(\n (variable) => !exemptVariables.has(variable),\n );\n for (const variable of variables) {\n report({\n node: group.node,\n messageId: \"defaultPalette\",\n data: { source: token, variable },\n });\n }\n }\n }\n}\n\n/**\n * Reports the default palette colors an inline style leaf uses.\n *\n * @param report - The reporter to send diagnostics to.\n * @param leaf - One inline style leaf.\n * @param view - The project design system.\n */\nfunction checkStyleLeaf(\n report: Reporter,\n leaf: StyleLeaf,\n view: DesignSystemView,\n): void {\n const declaration = parseStyleLeaf(leaf);\n if (!declaration) {\n return;\n }\n const variables = listDefaultPaletteColors(declaration.value, view);\n for (const variable of variables) {\n report({\n node: leaf.node,\n messageId: \"defaultPalette\",\n data: { source: leaf.property, variable },\n });\n }\n}\n\n/**\n * Builds `color-tokens`: class tokens may not write color literals in arbitrary values of\n * properties that take a color, and classes and inline styles may not use Tailwind's default\n * palette.\n *\n * @param view - The project design system.\n * @returns The rule.\n */\nexport function createColorTokensRule(view: DesignSystemView): Rule.RuleModule {\n return {\n meta: {\n type: \"problem\",\n docs: { description: \"Use project color tokens.\" },\n messages: {\n literal:\n \"{{source}} writes a color literal; use a project color token such as bg-(--token).\",\n defaultPalette: DEFAULT_PALETTE_MESSAGE,\n },\n schema: [],\n },\n create(context) {\n return {\n \"Program:exit\"() {\n const report = createUniqueReporter(context);\n const model = collectFrontendModel(context.sourceCode);\n for (const group of model.classGroups) {\n checkClassGroup(report, group, view);\n }\n for (const leaf of model.styleLeaves) {\n checkStyleLeaf(report, leaf, view);\n }\n },\n };\n },\n };\n}\n","/**\n * The `css-animated-properties` rule: stylesheet transitions, keyframes and animations may animate\n * paint properties only.\n *\n * @packageDocumentation\n */\nimport type { CSSRuleDefinition } from \"@eslint/css\";\nimport type { CssNodePlain } from \"@eslint/css-tree\";\n\nimport {\n evaluateAnimation,\n evaluateKeyframeDeclaration,\n evaluateTransition,\n MOTION_MESSAGES,\n type MotionFinding,\n type MotionReport,\n reportMotionFindings,\n} from \"../concepts/motion.js\";\nimport { collectStylesheetDeclarations } from \"../css-declarations.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\n\n/**\n * The `css-animated-properties` rule type, with one message ID per finding kind.\n */\ntype CssAnimatedPropertiesRule = CSSRuleDefinition<{\n RuleOptions: [];\n MessageIds: MotionFinding[\"kind\"];\n}>;\n\n/**\n * Builds `css-animated-properties`: stylesheet transitions may not animate all properties, layout\n * properties or unverifiable properties; keyframes may not animate layout properties; and\n * `animation`/`animation-name` may not name theme keyframes that animate layout properties.\n *\n * @param view - The project design system.\n * @returns The rule.\n */\nexport function createCssAnimatedPropertiesRule(\n view: DesignSystemView,\n): CssAnimatedPropertiesRule {\n return {\n meta: {\n type: \"problem\",\n docs: { description: \"Animate paint properties only.\" },\n messages: MOTION_MESSAGES,\n schema: [],\n },\n create(context) {\n const report = (motionReport: MotionReport<CssNodePlain>) => {\n context.report(motionReport);\n };\n return {\n StyleSheet(node) {\n for (const declaration of collectStylesheetDeclarations(node)) {\n const findings = [\n ...evaluateTransition(declaration),\n ...evaluateKeyframeDeclaration(declaration),\n ...evaluateAnimation(declaration, view),\n ];\n reportMotionFindings(\n report,\n declaration.node ?? node,\n declaration.property,\n findings,\n );\n }\n },\n };\n },\n };\n}\n","/**\n * The `css-color-tokens` rule: stylesheet declarations may not use Tailwind's default palette.\n *\n * @packageDocumentation\n */\nimport type { CSSRuleDefinition } from \"@eslint/css\";\n\nimport {\n DEFAULT_PALETTE_MESSAGE,\n listDefaultPaletteColors,\n} from \"../concepts/color.js\";\nimport {\n collectStylesheetDeclarations,\n type Declaration,\n} from \"../css-declarations.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\n\n/**\n * The `css-color-tokens` rule type.\n */\ntype CssColorTokensRule = CSSRuleDefinition<{\n RuleOptions: [];\n MessageIds: \"defaultPalette\";\n}>;\n\n/**\n * Tells whether a declaration defines a custom property inside `@theme`.\n *\n * @param declaration - One stylesheet declaration.\n * @returns `true` for a `--*` declaration inside `@theme`.\n */\nfunction isThemeDefinition(declaration: Declaration): boolean {\n return declaration.inTheme && declaration.property.startsWith(\"--\");\n}\n\n/**\n * Builds `css-color-tokens`: stylesheet declarations may not use Tailwind's default palette.\n *\n * Variables defined inside `@theme` are project tokens, so they may alias default palette colors.\n *\n * @param view - The project design system.\n * @returns The rule.\n */\nexport function createCssColorTokensRule(\n view: DesignSystemView,\n): CssColorTokensRule {\n return {\n meta: {\n type: \"problem\",\n docs: { description: \"Use project color tokens.\" },\n messages: { defaultPalette: DEFAULT_PALETTE_MESSAGE },\n schema: [],\n },\n create(context) {\n return {\n StyleSheet(node) {\n for (const declaration of collectStylesheetDeclarations(node)) {\n if (isThemeDefinition(declaration)) {\n continue;\n }\n const variables = new Set(\n listDefaultPaletteColors(declaration.value, view),\n );\n for (const variable of variables) {\n context.report({\n node: declaration.node ?? node,\n messageId: \"defaultPalette\",\n data: { source: declaration.property, variable },\n });\n }\n }\n },\n };\n },\n };\n}\n","/**\n * The focus concept: which class tokens and CSS declarations change the focus indicator, and the\n * P1 class pattern and C1 CSS pattern that may.\n *\n * @packageDocumentation\n */\nimport {\n type AtrulePlain,\n type CssNodePlain,\n lexer,\n property as describeProperty,\n type RulePlain,\n type ValuePlain,\n} from \"@eslint/css-tree\";\n\nimport {\n CSS_WIDE_KEYWORDS,\n type Declaration,\n focusVariant,\n listCssChildren,\n listValueNodes,\n referencedVariable,\n} from \"../css-declarations.js\";\nimport type { ClassCandidate, DesignSystemView } from \"../design-system.js\";\nimport { isProjectThemeColor } from \"./color.js\";\n\n/**\n * A part of the P1 pattern a focus-scoped token can fill.\n */\ntype P1Role =\n | \"outline-hidden\"\n | \"ring-width\"\n | \"ring-color\"\n | \"offset-width\"\n | \"zero-offset-width\"\n | \"offset-color\";\n\n/**\n * A Tailwind ring utility (`ring` or `ring-offset`) with the variables its width and color set.\n */\ninterface RingFamily {\n /** The Tailwind utility root. */\n readonly utility: string;\n /** The variable a width token of the family sets. */\n readonly widthVariable: string;\n /** Finds the P1 role a parse of a width token fills, or `undefined` for a width outside P1. */\n readonly widthRole: (candidate: ClassCandidate) => P1Role | undefined;\n /** The variable a color token of the family sets. */\n readonly colorVariable: string;\n /** The P1 role a project token color fills. */\n readonly colorRole: P1Role;\n}\n\n/**\n * The outcome of checking one class group against the P1 focus pattern.\n */\nexport interface FocusGroupVerdict {\n /** The tokens that can change the focus indicator. */\n readonly scoped: readonly string[];\n /** The scoped tokens that fill no P1 part. */\n readonly offending: readonly string[];\n /** The labels of P1 parts that are missing or repeated. */\n readonly outOfRange: readonly string[];\n}\n\nconst FOCUS_SELECTOR = /(?<!\\\\):focus/;\nconst SHADOW_VARIABLES = new Set([\"--tw-shadow\", \"--tw-inset-shadow\"]);\nconst OUTLINE_WIDTH_KEYWORDS = new Set([\"thin\", \"medium\", \"thick\"]);\nconst EARLY_LAYERS = new Set([\"theme\", \"base\", \"components\"]);\nconst RING_SHADOW_VARIABLES = [\"--tw-ring-offset-shadow\", \"--tw-ring-shadow\"];\nconst UNPAIRED_OFFSET_LABEL =\n \"a ring offset color only alongside focus-visible:ring-offset-<n> (required when above 0)\";\nconst ROLE_LIMITS: Readonly<\n Record<P1Role, { minimum: number; maximum: number; label: string }>\n> = {\n \"outline-hidden\": {\n minimum: 1,\n maximum: 1,\n label: \"focus-visible:outline-hidden\",\n },\n \"ring-width\": {\n minimum: 1,\n maximum: 1,\n label: \"focus-visible:ring or focus-visible:ring-<n>\",\n },\n \"ring-color\": { minimum: 0, maximum: 1, label: \"one ring color\" },\n \"offset-width\": { minimum: 0, maximum: 1, label: \"one ring offset\" },\n \"zero-offset-width\": { minimum: 0, maximum: 1, label: \"one ring offset\" },\n \"offset-color\": { minimum: 0, maximum: 1, label: \"one ring offset color\" },\n};\nconst RING_FAMILIES: readonly RingFamily[] = [\n {\n utility: \"ring-offset\",\n widthVariable: \"--tw-ring-offset-width\",\n widthRole: offsetWidthRole,\n colorVariable: \"--tw-ring-offset-color\",\n colorRole: \"offset-color\",\n },\n {\n utility: \"ring\",\n widthVariable: \"--tw-ring-shadow\",\n widthRole: ringWidthRole,\n colorVariable: \"--tw-ring-color\",\n colorRole: \"ring-color\",\n },\n];\n\n/**\n * Tells whether a selector targets a focus state.\n *\n * @param selector - Selector text, possibly containing escaped class names.\n * @returns `true` for `:focus`, `:focus-visible` and `:focus-within`, outside escaped class names.\n */\nexport function isFocusSelector(selector: string): boolean {\n return FOCUS_SELECTOR.test(selector);\n}\n\n/**\n * Tells whether a CSS property always affects the focus indicator, wherever it is written.\n *\n * @param property - A CSS property name, vendor-prefixed or not.\n * @returns `true` for `outline*`, `forced-color-adjust`, `all` and ring variables.\n */\nexport function isFocusIndicatorProperty(property: string): boolean {\n const name = describeProperty(property).basename;\n return (\n name.startsWith(\"outline\") ||\n name.startsWith(\"--tw-ring-\") ||\n name.startsWith(\"--tw-inset-ring-\") ||\n name === \"forced-color-adjust\" ||\n name === \"all\"\n );\n}\n\n/**\n * Tells whether a CSS property is `box-shadow` or a vendor alias of it.\n *\n * @param property - A CSS property name.\n * @returns `true` for `box-shadow` and aliases such as `-webkit-box-shadow`.\n */\nexport function isBoxShadowProperty(property: string): boolean {\n return describeProperty(property).basename === \"box-shadow\";\n}\n\n/**\n * Tells whether a shadow value composes the Tailwind ring offset and ring.\n *\n * @param declaration - A `box-shadow` declaration.\n * @returns `true` when the value references both ring shadow variables.\n */\nfunction composesRing(declaration: Declaration): boolean {\n const variables = new Set(\n listValueNodes(declaration.value).flatMap((node) => {\n const name = referencedVariable(node);\n return name === undefined ? [] : [name];\n }),\n );\n return RING_SHADOW_VARIABLES.every((variable) => variables.has(variable));\n}\n\n/**\n * Tells whether a shadow variable is set to something that can be a shadow.\n *\n * @param declaration - A `--tw-shadow` or `--tw-inset-shadow` declaration.\n * @returns `false` for `none` and CSS-wide keywords; `true` for `var()` and valid shadows.\n */\nfunction isShadowValue(declaration: Declaration): boolean {\n const text = declaration.text.trim().toLowerCase();\n if (text === \"none\" || CSS_WIDE_KEYWORDS.has(text)) {\n return false;\n }\n return (\n text.includes(\"var(\") ||\n lexer.matchProperty(\"box-shadow\", declaration.value).error === null\n );\n}\n\n/**\n * Tells whether a declaration clears one of the shadow variables the Tailwind ring composes with.\n *\n * @param declaration - Any declaration.\n * @returns `true` when `--tw-shadow` or `--tw-inset-shadow` is set to something other than a shadow,\n * such as `none`, which removes the ring.\n */\nexport function isShadowVariableReset(declaration: Declaration): boolean {\n return (\n SHADOW_VARIABLES.has(declaration.property) && !isShadowValue(declaration)\n );\n}\n\n/**\n * Tells whether a compiled class declaration can change the focus indicator.\n *\n * @param declaration - A declaration a class token compiles to.\n * @returns `true` under a focus selector, for indicator properties and `--tw-outline-style`, for\n * shadows that do not compose the ring, and for shadow-variable resets.\n */\nfunction isScopedClassDeclaration(declaration: Declaration): boolean {\n return (\n declaration.selectors.some((selector) => isFocusSelector(selector)) ||\n isFocusIndicatorProperty(declaration.property) ||\n declaration.property === \"--tw-outline-style\" ||\n (isBoxShadowProperty(declaration.property) && !composesRing(declaration)) ||\n isShadowVariableReset(declaration)\n );\n}\n\n/**\n * Tells whether a class token can change the focus indicator, so it must be part of P1.\n *\n * @param token - One class token.\n * @param view - The project design system.\n * @returns `true` when the token is in the focus scope.\n */\nexport function isFocusScopedToken(\n token: string,\n view: DesignSystemView,\n): boolean {\n const declarations = view.declarationsOf(token);\n if (!declarations) {\n return false;\n }\n return (\n declarations.some((declaration) => isScopedClassDeclaration(declaration)) ||\n view\n .candidatesOf(token)\n .some(\n (candidate) =>\n candidate.arbitraryProperty &&\n SHADOW_VARIABLES.has(candidate.utility),\n )\n );\n}\n\n/**\n * Reads the custom property a node references through `var()` without a fallback.\n *\n * @param node - A plain css-tree node.\n * @returns The custom property name, or `undefined` for anything else.\n */\nfunction plainVariableOfNode(\n node: CssNodePlain | undefined,\n): string | undefined {\n const name =\n node?.type === \"Function\" && node.children.length === 1\n ? referencedVariable(node)\n : undefined;\n return name?.startsWith(\"--\") ? name : undefined;\n}\n\n/**\n * Reads the custom property a whole value references through `var()` without a fallback.\n *\n * @param value - A parsed declaration value.\n * @returns The custom property name when the value is only that `var()`; `undefined` otherwise.\n */\nfunction plainVariableOfValue(\n value: ValuePlain | undefined,\n): string | undefined {\n const [only, ...rest] = value?.children ?? [];\n return rest.length === 0 ? plainVariableOfNode(only) : undefined;\n}\n\n/**\n * Tells whether a token sets a color variable to a project theme color.\n *\n * @param declarations - The token's compiled declarations.\n * @param property - The color variable, such as `--tw-ring-color`.\n * @param view - The project design system.\n * @returns `true` when the variable is set to a plain `var()` the project defines.\n */\nfunction isTokenColor(\n declarations: readonly Declaration[],\n property: string,\n view: DesignSystemView,\n): boolean {\n const variable = plainVariableOfValue(\n declarations.find((declaration) => declaration.property === property)\n ?.value,\n );\n return variable !== undefined && !view.isDefaultThemeVariable(variable);\n}\n\n/**\n * Tells whether a value is a whole number no smaller than a minimum.\n *\n * @param value - A named value such as `2`.\n * @param minimum - The smallest allowed number.\n * @returns `true` for a whole number at or above `minimum`.\n */\nfunction isWholeNumberAtLeast(\n value: string | undefined,\n minimum: number,\n): boolean {\n return value !== undefined && /^\\d+$/.test(value) && Number(value) >= minimum;\n}\n\n/**\n * Finds the P1 role a `ring` width parse fills.\n *\n * @param candidate - One parse of a `ring` width token.\n * @returns `ring-width` for `ring` and `ring-<n>` with a whole `n` of at least 1; `undefined`\n * otherwise.\n */\nfunction ringWidthRole(candidate: ClassCandidate): P1Role | undefined {\n const isRingWidth =\n candidate.valueKind === \"none\" ||\n (candidate.valueKind === \"named\" &&\n isWholeNumberAtLeast(candidate.value, 1));\n return isRingWidth ? \"ring-width\" : undefined;\n}\n\n/**\n * Finds the P1 role a `ring-offset` width parse fills.\n *\n * @param candidate - One parse of a `ring-offset` width token.\n * @returns `zero-offset-width` for `ring-offset-0`, which draws no offset band, `offset-width` for\n * `ring-offset-<n>` with a whole `n` of at least 1, and `undefined` otherwise.\n */\nfunction offsetWidthRole(candidate: ClassCandidate): P1Role | undefined {\n if (\n candidate.valueKind !== \"named\" ||\n !isWholeNumberAtLeast(candidate.value, 0)\n ) {\n return undefined;\n }\n return Number(candidate.value) === 0 ? \"zero-offset-width\" : \"offset-width\";\n}\n\n/**\n * Finds the P1 role a `ring` or `ring-offset` token fills.\n *\n * @param token - One focus-scoped class token.\n * @param view - The project design system.\n * @returns The width role for a valid width, the color role for a project token color, or\n * `undefined`.\n */\nfunction ringRole(token: string, view: DesignSystemView): P1Role | undefined {\n const declarations = view.declarationsOf(token) ?? [];\n const setsVariable = (variable: string) =>\n declarations.some((declaration) => declaration.property === variable);\n const family = RING_FAMILIES.find(\n (ringFamily) =>\n setsVariable(ringFamily.widthVariable) ||\n setsVariable(ringFamily.colorVariable),\n );\n const candidate = view\n .candidatesOf(token)\n .find((parse) => parse.utility === family?.utility);\n if (!family || !candidate) {\n return undefined;\n }\n if (setsVariable(family.widthVariable)) {\n return family.widthRole(candidate);\n }\n const isColor =\n candidate.modifierKind === \"none\" &&\n (isTokenColor(declarations, family.colorVariable, view) ||\n isProjectThemeColor(candidate, view));\n return isColor ? family.colorRole : undefined;\n}\n\n/**\n * Finds the P1 role a focus-scoped token fills.\n *\n * @param token - One focus-scoped class token.\n * @param view - The project design system.\n * @returns The role, or `undefined` when the token has another variant, `!`, or fills no role.\n */\nfunction p1Role(token: string, view: DesignSystemView): P1Role | undefined {\n const candidates = view.candidatesOf(token);\n const wellFormed = candidates.every(\n (candidate) =>\n !candidate.important &&\n candidate.variants.length === 1 &&\n candidate.variants[0] === \"focus-visible\",\n );\n if (!wellFormed || candidates.length === 0) {\n return undefined;\n }\n const outlineHidden = candidates.every(\n (candidate) =>\n (candidate.utility === \"outline-hidden\" &&\n candidate.valueKind === \"none\") ||\n (candidate.utility === \"outline\" &&\n candidate.valueKind === \"named\" &&\n candidate.value === \"hidden\"),\n );\n if (outlineHidden) {\n return \"outline-hidden\";\n }\n return ringRole(token, view);\n}\n\n/**\n * Lists the P1 parts a class group has too few or too many of.\n *\n * @param counts - How many tokens fill each role.\n * @returns The labels of out-of-range roles, with one ring offset allowed across zero and non-zero\n * widths, plus the unpaired-offset label when a non-zero offset width has no offset color or an\n * offset color has no offset width.\n */\nfunction listOutOfRangeLabels(counts: ReadonlyMap<P1Role, number>): string[] {\n const offsetWidths = counts.get(\"offset-width\") ?? 0;\n const zeroOffsetWidths = counts.get(\"zero-offset-width\") ?? 0;\n const offsetColors = counts.get(\"offset-color\") ?? 0;\n const labels = new Set(\n Object.entries(ROLE_LIMITS)\n .filter(([role, limit]) => {\n const count = counts.get(role as P1Role) ?? 0;\n return count < limit.minimum || count > limit.maximum;\n })\n .map(([, limit]) => limit.label),\n );\n if (offsetWidths + zeroOffsetWidths > 1) {\n labels.add(ROLE_LIMITS[\"offset-width\"].label);\n }\n if (\n offsetColors < offsetWidths ||\n offsetColors > offsetWidths + zeroOffsetWidths\n ) {\n labels.add(UNPAIRED_OFFSET_LABEL);\n }\n return [...labels];\n}\n\n/**\n * Checks one class group against P1, the only allowed class focus pattern.\n *\n * P1: every in-scope token has exactly the `focus-visible` variant and no `!`; the group has one\n * `outline-hidden`, one `ring`/`ring-<n≥1>`, and optionally one project token ring color, one\n * `ring-offset-<n>` and one project token offset color; an offset above 0 needs the offset color,\n * `ring-offset-0` allows it, and no offset forbids it.\n *\n * @param tokens - The class tokens of one string or template literal.\n * @param view - The project design system.\n * @returns The in-scope tokens, the tokens outside P1, and the labels of P1 parts that are missing\n * or repeated.\n */\nexport function evaluateFocusGroup(\n tokens: readonly string[],\n view: DesignSystemView,\n): FocusGroupVerdict {\n const scoped = tokens.filter((token) => isFocusScopedToken(token, view));\n if (scoped.length === 0) {\n return { scoped, offending: [], outOfRange: [] };\n }\n const counts = new Map<P1Role, number>();\n const offending: string[] = [];\n for (const token of scoped) {\n const role = p1Role(token, view);\n if (role === undefined) {\n offending.push(token);\n } else {\n counts.set(role, (counts.get(role) ?? 0) + 1);\n }\n }\n return { scoped, offending, outOfRange: listOutOfRangeLabels(counts) };\n}\n\n/**\n * Tells whether a project CSS declaration outside a focus rule can change the focus indicator.\n *\n * @param declaration - A declaration from a project stylesheet.\n * @returns `true` for indicator properties, shadow-variable resets, `!important` shadows, and\n * shadows that do not compose the ring offset and ring and would beat the utilities layer\n * (unlayered, a layer after `theme`, `base` and `components`, or inside keyframes).\n */\nexport function isFocusScopedCssDeclaration(declaration: Declaration): boolean {\n if (\n isFocusIndicatorProperty(declaration.property) ||\n isShadowVariableReset(declaration)\n ) {\n return true;\n }\n if (!isBoxShadowProperty(declaration.property)) {\n return false;\n }\n if (declaration.important) {\n return true;\n }\n const firstLayer = declaration.layer?.split(\".\")[0];\n const beatsUtilities =\n firstLayer === undefined ||\n !EARLY_LAYERS.has(firstLayer) ||\n declaration.inKeyframes;\n return beatsUtilities && !composesRing(declaration);\n}\n\n/**\n * Tells whether a selector ends in `:focus-visible`.\n *\n * @param selector - One selector of a selector list.\n * @returns `true` when its last component is `:focus-visible`.\n */\nfunction endsWithFocusVisible(selector: CssNodePlain): boolean {\n const last = listCssChildren(selector).at(-1);\n return last?.type === \"PseudoClassSelector\" && last.name === \"focus-visible\";\n}\n\n/**\n * Tells whether a node is a non-zero outline width.\n *\n * @param width - The first node of an `outline` value.\n * @returns `true` for a positive length or `thin`, `medium` or `thick`.\n */\nfunction isNonZeroWidth(width: CssNodePlain | undefined): boolean {\n if (!width || lexer.matchType(\"line-width\", width).error !== null) {\n return false;\n }\n if (width.type === \"Dimension\") {\n return Number(width.value) > 0;\n }\n return width.type === \"Identifier\" && OUTLINE_WIDTH_KEYWORDS.has(width.name);\n}\n\n/**\n * Tells whether an `outline` value is `<non-zero width> solid var(--token)`.\n *\n * @param value - An `outline` value.\n * @returns `true` for the C1 outline.\n */\nfunction isC1Outline(value: ValuePlain): boolean {\n const [width, style, color, ...rest] = value.children;\n const solid = style?.type === \"Identifier\" && style.name === \"solid\";\n return (\n rest.length === 0 &&\n solid &&\n isNonZeroWidth(width) &&\n plainVariableOfNode(color) !== undefined\n );\n}\n\n/**\n * Tells whether a focus rule's declarations are exactly the C1 set.\n *\n * @param declarations - The declarations of one focus rule.\n * @returns `true` for one C1 `outline`, at most one `outline-offset`, nothing else, and no\n * `!important`.\n */\nfunction isC1Declarations(declarations: readonly Declaration[]): boolean {\n const counts = new Map<string, number>();\n for (const { property } of declarations) {\n counts.set(property, (counts.get(property) ?? 0) + 1);\n }\n const outlines = declarations.filter(\n (declaration) => declaration.property === \"outline\",\n );\n const otherProperties = [...counts.keys()].filter(\n (property) => property !== \"outline\" && property !== \"outline-offset\",\n );\n return (\n counts.get(\"outline\") === 1 &&\n (counts.get(\"outline-offset\") ?? 0) <= 1 &&\n otherProperties.length === 0 &&\n declarations.every((declaration) => !declaration.important) &&\n outlines.every((declaration) => isC1Outline(declaration.value))\n );\n}\n\n/**\n * Tells whether every selector a focus block applies to ends in `:focus-visible`.\n *\n * @param block - A rule, or an `@variant focus*` block.\n * @returns `true` for a rule whose every selector ends in `:focus-visible`, and for an\n * `@variant focus-visible` block.\n */\nfunction allSelectorsEndWithFocusVisible(\n block: RulePlain | AtrulePlain,\n): boolean {\n if (block.type === \"Atrule\") {\n return focusVariant(block) === \"focus-visible\";\n }\n return (\n block.prelude.type === \"SelectorList\" &&\n block.prelude.children.every((selector) => endsWithFocusVisible(selector))\n );\n}\n\n/**\n * Checks one focus block against C1, the only allowed CSS focus pattern.\n *\n * C1: every selector in the list ends in `:focus-visible` (an `@variant focus-visible` block\n * counts as one), and the declarations are exactly `outline: <non-zero line width> solid\n * var(--token)` plus an optional `outline-offset`, none `!important`.\n *\n * @param block - The rule whose selector targets focus, or an `@variant focus*` block.\n * @param declarations - The declarations whose block is `block`.\n * @returns `true` when the block is C1.\n */\nexport function matchesC1(\n block: RulePlain | AtrulePlain,\n declarations: readonly Declaration[],\n): boolean {\n return (\n allSelectorsEndWithFocusVisible(block) && isC1Declarations(declarations)\n );\n}\n","/**\n * The `css-focus-styling` rule: only the C1 pattern may change the focus indicator in stylesheets.\n *\n * @packageDocumentation\n */\nimport type { CSSRuleDefinition } from \"@eslint/css\";\nimport type { AtrulePlain, RulePlain } from \"@eslint/css-tree\";\n\nimport {\n isFocusScopedCssDeclaration,\n isFocusSelector,\n matchesC1,\n} from \"../concepts/focus.js\";\nimport {\n collectStylesheetDeclarations,\n type Declaration,\n} from \"../css-declarations.js\";\n\n/**\n * The `css-focus-styling` rule type.\n */\ntype CssFocusStylingRule = CSSRuleDefinition<{\n RuleOptions: [];\n MessageIds: \"focusRule\" | \"focusDeclaration\";\n}>;\n\n/**\n * Groups the declarations of focus blocks by their block.\n *\n * @param declarations - Every declaration of a stylesheet.\n * @returns The declarations under a focus selector, keyed by their nearest rule or\n * `@variant focus*` block, in source order.\n */\nfunction groupFocusBlocks(\n declarations: readonly Declaration[],\n): Map<RulePlain | AtrulePlain, Declaration[]> {\n const groups = new Map<RulePlain | AtrulePlain, Declaration[]>();\n for (const declaration of declarations) {\n const block = declaration.block;\n if (\n !block ||\n !declaration.selectors.some((selector) => isFocusSelector(selector))\n ) {\n continue;\n }\n const group = groups.get(block) ?? [];\n group.push(declaration);\n groups.set(block, group);\n }\n return groups;\n}\n\n/**\n * `css-focus-styling`: everything in a stylesheet that can change the focus indicator must be C1.\n *\n * A rule whose selector targets focus, and an `@variant focus*` block, must be C1 as a whole\n * (`focusRule`). Outside such rules, `outline*`, `forced-color-adjust`, `all`,\n * `--tw-ring-*`, `--tw-inset-ring-*`, resets of `--tw-shadow`/`--tw-inset-shadow`, `!important`\n * box shadows, and box shadows that do not compose the ring offset and ring and beat the utilities\n * layer are flagged (`focusDeclaration`).\n */\nexport const cssFocusStylingRule: CssFocusStylingRule = {\n meta: {\n type: \"problem\",\n docs: { description: \"Allow only the C1 focus pattern.\" },\n messages: {\n focusRule:\n \"A focus rule must be exactly C1: every selector ends in :focus-visible (or the rule is an @variant focus-visible block), and the only declarations are outline: <non-zero width> solid var(--token) and an optional outline-offset, without !important.\",\n focusDeclaration:\n \"{{property}} outside a C1 focus rule can hide or override the focus indicator; move focus styling into a C1 rule, and put a decorative box-shadow in @layer components or use filter: drop-shadow().\",\n },\n schema: [],\n },\n create(context) {\n return {\n StyleSheet(node) {\n const declarations = collectStylesheetDeclarations(node);\n const focusBlocks = groupFocusBlocks(declarations);\n for (const [block, blockDeclarations] of focusBlocks) {\n if (!matchesC1(block, blockDeclarations)) {\n context.report({ node: block, messageId: \"focusRule\" });\n }\n }\n const grouped = new Set([...focusBlocks.values()].flat());\n for (const declaration of declarations) {\n if (\n declaration.node &&\n !grouped.has(declaration) &&\n isFocusScopedCssDeclaration(declaration)\n ) {\n context.report({\n node: declaration.node,\n messageId: \"focusDeclaration\",\n data: { property: declaration.property },\n });\n }\n }\n },\n };\n },\n};\n","/**\n * The `css-no-apply` rule: stylesheets may not use `@apply`.\n *\n * @packageDocumentation\n */\nimport type { CSSRuleDefinition } from \"@eslint/css\";\n\n/**\n * The `css-no-apply` rule type.\n */\ntype CssNoApplyRule = CSSRuleDefinition<{\n RuleOptions: [];\n MessageIds: \"apply\";\n}>;\n\n/**\n * `css-no-apply`: flags every `@apply` at-rule, whose class tokens no frontend rule can check.\n */\nexport const cssNoApplyRule: CssNoApplyRule = {\n meta: {\n type: \"problem\",\n docs: { description: \"Disallow @apply.\" },\n messages: {\n apply:\n \"Write the classes in markup or plain declarations here; @apply hides them from the lint rules.\",\n },\n schema: [],\n },\n create(context) {\n return {\n Atrule(node) {\n if (node.name.toLowerCase() === \"apply\") {\n context.report({ node, messageId: \"apply\" });\n }\n },\n };\n },\n};\n","/**\n * The `css-parsed-fully` rule: every block and rule prelude must parse.\n *\n * @packageDocumentation\n */\nimport type { CSSRuleDefinition } from \"@eslint/css\";\n\n/**\n * The `css-parsed-fully` rule type.\n */\ntype CssParsedFullyRule = CSSRuleDefinition<{\n RuleOptions: [];\n MessageIds: \"unparsed\" | \"swallowed\";\n}>;\n\n/**\n * `css-parsed-fully`: flags every raw child of a block (`unparsed`) and every rule prelude left raw\n * with a `:` or `;` in it (`swallowed`), which is how the tolerant parser swallows declarations\n * written before a nested rule inside an at-rule. No other rule checks what did not parse.\n */\nexport const cssParsedFullyRule: CssParsedFullyRule = {\n meta: {\n type: \"problem\",\n docs: { description: \"Require blocks to parse fully.\" },\n messages: {\n unparsed:\n \"This part of the block did not parse, so no rule checks it; rewrite it as plain declarations and nested rules, wrapping declarations that sit between nested rules in & { … } so they keep their order.\",\n swallowed:\n \"The declarations before this nested rule did not parse, so no rule checks them; wrap them in & { … } where they stand, or move @keyframes into an @theme block of their own.\",\n },\n schema: [],\n },\n create(context) {\n return {\n Block(node) {\n for (const child of node.children) {\n if (child.type === \"Raw\") {\n context.report({ node: child, messageId: \"unparsed\" });\n }\n }\n },\n Rule(node) {\n if (node.prelude.type === \"Raw\" && /[:;]/.test(node.prelude.value)) {\n context.report({ node: node.prelude, messageId: \"swallowed\" });\n }\n },\n };\n },\n};\n","/**\n * Detects the `vh` unit in declarations.\n *\n * @packageDocumentation\n */\nimport { type Declaration, listValueNodes } from \"../css-declarations.js\";\n\n/**\n * Report message for a `vh` finding, with a `source` placeholder.\n */\nexport const VH_UNIT_MESSAGE =\n \"{{source}} uses vh, which ignores mobile browser chrome; use dvh, svh or lvh, such as h-dvh or min-h-svh.\";\n\n/**\n * Tells whether a declaration uses the `vh` unit anywhere, including `var()` fallbacks.\n *\n * Only `vh` itself matches, in any letter case; the `dvh`, `svh` and `lvh` replacements do not.\n *\n * @param declaration - Any declaration.\n * @returns `true` when a `vh` dimension appears in the value.\n */\nexport function usesVhUnit(declaration: Declaration): boolean {\n return listValueNodes(declaration.value).some(\n (node) => node.type === \"Dimension\" && node.unit.toLowerCase() === \"vh\",\n );\n}\n","/**\n * Builds rules that flag project stylesheet declarations matching a predicate.\n *\n * @packageDocumentation\n */\nimport type { CSSRuleDefinition } from \"@eslint/css\";\n\nimport {\n collectStylesheetDeclarations,\n type Declaration,\n} from \"./css-declarations.js\";\n\n/**\n * What a stylesheet declaration rule flags and how it reports it.\n */\nexport interface CssDeclarationRuleOptions {\n /** The rule description shown in ESLint metadata. */\n readonly description: string;\n /** The single message ID the rule reports. */\n readonly messageId: string;\n /** The report message, with a `source` placeholder. */\n readonly message: string;\n /** Tells whether a declaration breaks the rule. */\n readonly matches: (declaration: Declaration) => boolean;\n /** Builds the `source` placeholder value for a reported declaration. */\n readonly describe: (declaration: Declaration) => string;\n}\n\n/**\n * Builds a rule that flags every stylesheet declaration that matches, at the declaration or, when\n * the declaration has no node, at the stylesheet.\n *\n * @param options - The predicate, message and metadata of the rule.\n * @returns The rule.\n */\nexport function createCssDeclarationRule(\n options: CssDeclarationRuleOptions,\n): CSSRuleDefinition<{ RuleOptions: []; MessageIds: string }> {\n return {\n meta: {\n type: \"problem\",\n docs: { description: options.description },\n messages: { [options.messageId]: options.message },\n schema: [],\n },\n create(context) {\n return {\n StyleSheet(node) {\n for (const declaration of collectStylesheetDeclarations(node)) {\n if (options.matches(declaration)) {\n context.report({\n node: declaration.node ?? node,\n messageId: options.messageId,\n data: { source: options.describe(declaration) },\n });\n }\n }\n },\n };\n },\n };\n}\n","/**\n * The `css-viewport-units` rule: stylesheet declarations may not use the `vh` unit.\n *\n * @packageDocumentation\n */\nimport type { CSSRuleDefinition } from \"@eslint/css\";\n\nimport { usesVhUnit, VH_UNIT_MESSAGE } from \"../concepts/viewport.js\";\nimport { createCssDeclarationRule } from \"../css-declaration-rule.js\";\n\n/**\n * The `css-viewport-units` rule type.\n */\ntype CssViewportUnitsRule = CSSRuleDefinition<{\n RuleOptions: [];\n MessageIds: \"vhUnit\";\n}>;\n\n/**\n * `css-viewport-units`: stylesheet declarations may not use the `vh` unit, `var()` fallbacks\n * included. Each finding names the declaration's property.\n */\nexport const cssViewportUnitsRule: CssViewportUnitsRule =\n createCssDeclarationRule({\n description: \"Disallow vh units.\",\n messageId: \"vhUnit\",\n message: VH_UNIT_MESSAGE,\n matches: usesVhUnit,\n describe: (declaration) => declaration.property,\n });\n","/**\n * Checks `z-index` declarations against the project cap.\n *\n * @packageDocumentation\n */\nimport type { CssNodePlain, ValuePlain } from \"@eslint/css-tree\";\n\nimport {\n type Declaration,\n firstIdentifierArgument,\n isVariableReference,\n listCssChildren,\n parseValue,\n} from \"../css-declarations.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\n\n/**\n * The highest z-index a declaration may set.\n */\nexport const Z_INDEX_CAP = 50;\n\n/**\n * Report message for a z-index finding, with a `source` placeholder.\n */\nexport const Z_INDEX_MESSAGE = `z-index must be at most ${String(Z_INDEX_CAP)}, negative, auto, or a var() whose theme value or fallback is; {{source}} is not. To fix it, use the scale up to ${String(Z_INDEX_CAP)} or a named layer such as z-(--layer).`;\n\n/**\n * How many nested `var()` resolutions a value may take before it counts as unverifiable.\n */\nconst MAX_VARIABLE_DEPTH = 4;\n\n/**\n * Lists the arguments of a `calc()` call.\n *\n * @param node - A plain css-tree node.\n * @returns The `calc()` children, or an empty list for any other node.\n */\nfunction calcArguments(node: CssNodePlain): CssNodePlain[] {\n return node.type === \"Function\" && node.name.toLowerCase() === \"calc\"\n ? node.children\n : [];\n}\n\n/**\n * Computes the product of a `calc(a * b)` call over two plain numbers.\n *\n * @param node - A plain css-tree node.\n * @returns The product, or `undefined` for any other node.\n */\nfunction computeProduct(node: CssNodePlain): number | undefined {\n const [left, operator, right, ...rest] = calcArguments(node);\n const isMultiplication =\n operator?.type === \"Operator\" && operator.value === \"*\";\n if (\n rest.length > 0 ||\n !isMultiplication ||\n left?.type !== \"Number\" ||\n right?.type !== \"Number\"\n ) {\n return undefined;\n }\n return Number(left.value) * Number(right.value);\n}\n\n/**\n * Resolves a `var()` call through the theme, then through its fallback.\n *\n * @param node - A `var()` function node.\n * @param view - The project design system that resolves theme variables.\n * @returns The parsed theme value, else the fallback value, else `undefined`.\n */\nfunction resolveVariable(\n node: CssNodePlain,\n view: DesignSystemView,\n): ValuePlain | undefined {\n const name = firstIdentifierArgument(node);\n const themeValue = name === undefined ? undefined : view.themeValue(name);\n if (themeValue !== undefined) {\n return parseValue(themeValue);\n }\n const fallback = listCssChildren(node).at(2);\n return fallback?.type === \"Value\" ? fallback : undefined;\n}\n\n/**\n * Tells whether a single-node value is within the cap, resolving `var()` up to a depth.\n *\n * @param value - A declaration value.\n * @param view - The project design system that resolves theme variables.\n * @param depth - How many more `var()` resolutions may follow.\n * @returns `true` when the value passes the cap.\n */\nfunction isAllowedValue(\n value: ValuePlain,\n view: DesignSystemView,\n depth: number,\n): boolean {\n const [node, ...rest] = value.children;\n if (rest.length > 0 || !node) {\n return false;\n }\n if (node.type === \"Number\") {\n return Number(node.value) <= Z_INDEX_CAP;\n }\n if (node.type === \"Identifier\") {\n return node.name.toLowerCase() === \"auto\";\n }\n if (isVariableReference(node)) {\n const resolved = resolveVariable(node, view);\n return (\n resolved === undefined ||\n (depth > 0 && isAllowedValue(resolved, view, depth - 1))\n );\n }\n const product = computeProduct(node);\n return product !== undefined && product <= Z_INDEX_CAP;\n}\n\n/**\n * Tells whether a `z-index` declaration breaks the cap.\n *\n * Numbers up to the cap (negative numbers included), `auto`, and `calc(a * b)` whose product is at\n * most the cap pass. A `var()` is resolved through the theme, or through its fallback when the\n * theme does not define it, and the result is checked the same way; a `var()` with neither passes.\n * Anything else fails.\n *\n * @param declaration - Any declaration; other properties never break the cap.\n * @param view - The project design system that resolves theme variables.\n * @returns `true` when the declaration sets a z-index above the cap or an unverifiable one.\n */\nexport function exceedsZIndexCap(\n declaration: Declaration,\n view: DesignSystemView,\n): boolean {\n return (\n declaration.property === \"z-index\" &&\n !isAllowedValue(declaration.value, view, MAX_VARIABLE_DEPTH)\n );\n}\n","/**\n * The `css-z-index` rule: stylesheet declarations may not set a z-index above the cap or one that\n * cannot be verified statically.\n *\n * @packageDocumentation\n */\nimport type { CSSRuleDefinition } from \"@eslint/css\";\n\nimport { exceedsZIndexCap, Z_INDEX_MESSAGE } from \"../concepts/z-index.js\";\nimport { createCssDeclarationRule } from \"../css-declaration-rule.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\n\n/**\n * The `css-z-index` rule type.\n */\ntype CssZIndexRule = CSSRuleDefinition<{\n RuleOptions: [];\n MessageIds: \"exceeds\";\n}>;\n\n/**\n * Builds `css-z-index`: stylesheet declarations may not set a z-index above the cap or one that\n * cannot be verified statically. Each finding names the declaration's text.\n *\n * @param view - The project design system that resolves theme variables.\n * @returns The rule.\n */\nexport function createCssZIndexRule(view: DesignSystemView): CssZIndexRule {\n return createCssDeclarationRule({\n description: \"Cap z-index values.\",\n messageId: \"exceeds\",\n message: Z_INDEX_MESSAGE,\n matches: (declaration) => exceedsZIndexCap(declaration, view),\n describe: (declaration) => declaration.text,\n });\n}\n","/**\n * The `focus-styling` rule: only the P1 class pattern may change the focus indicator in JavaScript\n * and TypeScript files.\n *\n * @packageDocumentation\n */\nimport type { Rule } from \"eslint\";\n\nimport {\n type AstNode,\n childNodes,\n findJsxAttribute,\n jsxAttributeValue,\n} from \"../ast.js\";\nimport {\n collectFrontendModel,\n type ElementHandler,\n type FrontendModel,\n listBranches,\n listStaticTexts,\n type MotionKey,\n type StyleAssignment,\n type StyleLeaf,\n} from \"../collect.js\";\nimport {\n evaluateFocusGroup,\n type FocusGroupVerdict,\n isBoxShadowProperty,\n isFocusIndicatorProperty,\n isShadowVariableReset,\n} from \"../concepts/focus.js\";\nimport { parseStyleLeaf } from \"../css-declarations.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\nimport { createUniqueReporter, type Reporter } from \"../report.js\";\n\n/**\n * An inline style or motion key.\n */\ntype StyleKey = StyleLeaf | MotionKey;\n\n/**\n * A class group with its focus verdict.\n */\ninterface EvaluatedGroup {\n /** The class group literal. */\n readonly node: AstNode;\n /** The verdict on its tokens. */\n readonly verdict: FocusGroupVerdict;\n}\n\nconst FOCUS_HANDLER_ATTRIBUTES = new Set([\n \"onFocus\",\n \"onBlur\",\n \"onFocusCapture\",\n \"onBlurCapture\",\n]);\nconst P1_DESCRIPTION =\n \"focus-visible:outline-hidden focus-visible:ring-2 (plus an optional project ring color, ring-offset-<n> and project offset color)\";\n\n/**\n * Describes what breaks the P1 pattern in a class group.\n *\n * @param verdict - The class group's verdict.\n * @returns The tokens outside P1 and the P1 parts that are missing or repeated, joined by `; `.\n */\nfunction describeVerdict(verdict: FocusGroupVerdict): string {\n const parts: string[] = [];\n if (verdict.offending.length > 0) {\n parts.push(`not P1: ${verdict.offending.join(\" \")}`);\n }\n if (verdict.outOfRange.length > 0) {\n parts.push(`missing or repeated: ${verdict.outOfRange.join(\", \")}`);\n }\n return parts.join(\"; \");\n}\n\n/**\n * Tells whether a handler is a focus or blur handler that writes `.style`.\n *\n * @param handler - An element handler.\n * @returns `true` for such a handler.\n */\nfunction isStylingFocusHandler(handler: ElementHandler): boolean {\n return (\n FOCUS_HANDLER_ATTRIBUTES.has(handler.attributeName) &&\n handler.styleAssignments.length > 0\n );\n}\n\n/**\n * Lists the inline style and motion keys of a file.\n *\n * @param model - The file's frontend model.\n * @returns The style leaves followed by the motion keys.\n */\nfunction listStyleKeys(model: FrontendModel): StyleKey[] {\n return [...model.styleLeaves, ...model.motionKeys];\n}\n\n/**\n * Tells whether a style key resets `--tw-shadow` or `--tw-inset-shadow`.\n *\n * @param key - An inline style or motion key.\n * @returns `true` for a key whose static value resets a shadow variable.\n */\nfunction resetsShadowVariable(key: StyleKey): boolean {\n const declaration = parseStyleLeaf(key);\n return declaration !== undefined && isShadowVariableReset(declaration);\n}\n\n/**\n * Lists the variant labels an element's `whileFocus` names.\n *\n * @param element - A JSX opening element, or `undefined` outside JSX.\n * @returns The labels of every static string or array of static strings the value can take behind\n * `as`, `satisfies`, `!`, ternaries and `&&`, or an empty list for no `whileFocus`.\n */\nfunction listWhileFocusLabels(element: AstNode | undefined): string[] {\n const attribute = element && findJsxAttribute(element, \"whileFocus\");\n const value = attribute && jsxAttributeValue(attribute);\n return listBranches(value).flatMap((branch) =>\n branch.type === \"ArrayExpression\"\n ? childNodes(branch, \"elements\").flatMap((item) => listStaticTexts(item))\n : listStaticTexts(branch),\n );\n}\n\n/**\n * Tells whether a style key is a key of a `whileFocus` motion object.\n *\n * @param key - An inline style or motion key.\n * @returns `true` for a key of an inline `whileFocus` object, or of a `variants` entry whose label\n * the element's `whileFocus` names, other than the `transition` timing config.\n */\nfunction isWhileFocusKey(key: StyleKey): boolean {\n if (!(\"attributeName\" in key) || key.property === \"transition\") {\n return false;\n }\n return (\n key.attributeName === \"whileFocus\" ||\n (key.variantLabel !== undefined &&\n listWhileFocusLabels(key.element).includes(key.variantLabel))\n );\n}\n\n/**\n * Tells whether a style key changes the focus indicator.\n *\n * @param key - An inline style or motion key.\n * @returns `true` for an indicator property, a shadow variable reset, or any `whileFocus` key.\n */\nfunction isIndicatorKey(key: StyleKey): boolean {\n return (\n isFocusIndicatorProperty(key.property) ||\n resetsShadowVariable(key) ||\n isWhileFocusKey(key)\n );\n}\n\n/**\n * Evaluates every class group of a file against the P1 pattern.\n *\n * @param model - The file's frontend model.\n * @param view - The project design system.\n * @returns One entry per class group, in source order.\n */\nfunction evaluateClassGroups(\n model: FrontendModel,\n view: DesignSystemView,\n): EvaluatedGroup[] {\n return model.classGroups.map((group) => ({\n node: group.node,\n verdict: evaluateFocusGroup(group.tokens, view),\n }));\n}\n\n/**\n * Selects the class groups that hold focus-scoped tokens.\n *\n * @param groups - The evaluated class groups.\n * @returns The literals of the focus-scoped groups.\n */\nfunction selectFocusScopedNodes(\n groups: readonly EvaluatedGroup[],\n): Set<AstNode> {\n return new Set(\n groups\n .filter((group) => group.verdict.scoped.length > 0)\n .map((group) => group.node),\n );\n}\n\n/**\n * Collects the elements whose focus indicator is styled by a class, an inline key or a focus\n * handler.\n *\n * @param model - The file's frontend model.\n * @param scopedNodes - The literals of the focus-scoped class groups.\n * @returns The JSX opening elements.\n */\nfunction collectFocusStyledElements(\n model: FrontendModel,\n scopedNodes: ReadonlySet<AstNode>,\n): Set<AstNode> {\n const elements = new Set<AstNode>();\n for (const group of model.classGroups) {\n if (group.element && scopedNodes.has(group.node)) {\n elements.add(group.element);\n }\n }\n for (const key of listStyleKeys(model)) {\n if (key.element && isIndicatorKey(key)) {\n elements.add(key.element);\n }\n }\n for (const handler of model.handlers) {\n if (isStylingFocusHandler(handler)) {\n elements.add(handler.element);\n }\n }\n return elements;\n}\n\n/**\n * Tells whether a handler styles the focus indicator.\n *\n * @param handler - An element handler.\n * @param focusStyled - The focus-styled elements.\n * @returns `true` for a focus handler, or a handler on a focus-styled element that writes\n * `.style.boxShadow`.\n */\nfunction isScopedHandler(\n handler: ElementHandler,\n focusStyled: ReadonlySet<AstNode>,\n): boolean {\n const writesShadow = handler.styleAssignments.some((assignment) =>\n isBoxShadowProperty(assignment.property),\n );\n return (\n isStylingFocusHandler(handler) ||\n (focusStyled.has(handler.element) && writesShadow)\n );\n}\n\n/**\n * Selects the handlers that style the focus indicator, once per set of style writes.\n *\n * @param model - The file's frontend model.\n * @param focusStyled - The focus-styled elements.\n * @returns The scoped handlers in source order, without a handler whose style writes all belong to\n * handlers listed before it, such as a second element sharing the same handler function.\n */\nfunction selectScopedHandlers(\n model: FrontendModel,\n focusStyled: ReadonlySet<AstNode>,\n): ElementHandler[] {\n const covered = new Set<StyleAssignment>();\n return model.handlers.filter((handler) => {\n if (\n !isScopedHandler(handler, focusStyled) ||\n handler.styleAssignments.every((assignment) => covered.has(assignment))\n ) {\n return false;\n }\n for (const assignment of handler.styleAssignments) {\n covered.add(assignment);\n }\n return true;\n });\n}\n\n/**\n * Reports each class group that breaks the P1 pattern.\n *\n * @param report - The reporter.\n * @param groups - The evaluated class groups.\n */\nfunction reportClassGroups(\n report: Reporter,\n groups: readonly EvaluatedGroup[],\n): void {\n for (const { node, verdict } of groups) {\n if (verdict.offending.length > 0 || verdict.outOfRange.length > 0) {\n report({\n node,\n messageId: \"classGroup\",\n data: { problems: describeVerdict(verdict) },\n });\n }\n }\n}\n\n/**\n * Reports `whileFocus` keys, inline indicator keys, and `boxShadow` keys on focus-styled elements.\n *\n * @param report - The reporter.\n * @param model - The file's frontend model.\n * @param focusStyled - The focus-styled elements.\n */\nfunction reportStyleKeys(\n report: Reporter,\n model: FrontendModel,\n focusStyled: ReadonlySet<AstNode>,\n): void {\n for (const key of listStyleKeys(model)) {\n const isOnFocusStyledElement =\n key.element !== undefined && focusStyled.has(key.element);\n if (\n isIndicatorKey(key) ||\n (isBoxShadowProperty(key.property) && isOnFocusStyledElement)\n ) {\n report({\n node: key.node,\n messageId: isWhileFocusKey(key) ? \"whileFocus\" : \"inlineStyle\",\n data: { property: key.property },\n });\n }\n }\n}\n\n/**\n * Reports each scoped handler on its attribute.\n *\n * @param report - The reporter.\n * @param handlers - The scoped handlers.\n */\nfunction reportHandlers(\n report: Reporter,\n handlers: readonly ElementHandler[],\n): void {\n for (const handler of handlers) {\n report({\n node: handler.attribute,\n messageId: \"handler\",\n data: { attribute: handler.attributeName },\n });\n }\n}\n\n/**\n * Reports `.style` writes to indicator properties outside the reported handlers.\n *\n * @param report - The reporter.\n * @param model - The file's frontend model.\n * @param reportedHandlers - The handlers already reported.\n */\nfunction reportAssignments(\n report: Reporter,\n model: FrontendModel,\n reportedHandlers: readonly ElementHandler[],\n): void {\n const covered = new Set(\n reportedHandlers.flatMap((handler) => handler.styleAssignments),\n );\n for (const assignment of model.styleAssignments) {\n if (\n isFocusIndicatorProperty(assignment.property) &&\n !covered.has(assignment)\n ) {\n report({\n node: assignment.node,\n messageId: \"assignment\",\n data: { property: assignment.property },\n });\n }\n }\n}\n\n/**\n * Builds `focus-styling`: everything in a JavaScript or TypeScript file that can change the focus\n * indicator must be the P1 class pattern.\n *\n * In scope: class tokens with focus selectors, outline (`--tw-outline-style` included), ring,\n * `forced-color-adjust`, `all`, resets of `--tw-shadow`/`--tw-inset-shadow` (arbitrary properties\n * included) or a shadow that cannot compose the ring; inline style and motion-prop keys for\n * outline, ring (`--tw-ring-*` and `--tw-inset-ring-*` included), `forcedColorAdjust` and `all`,\n * and resets of `--tw-shadow`/`--tw-inset-shadow`; every key of `whileFocus` other than\n * `transition`, including the keys of a `variants` entry that a static `whileFocus` label or label\n * array names; `boxShadow` keys on focus-styled elements; `.style` writes to those indicator properties; focus and blur handlers\n * (capture phase included) that write `.style.*`; and any handler on a focus-styled element that\n * writes `.style.boxShadow`.\n *\n * Not followed: a `variants` object held in a variable, a variant written as a function, and\n * `whileFocus` labels an element inherits from a parent motion element.\n *\n * @param view - The project design system.\n * @returns The rule.\n */\nexport function createFocusStylingRule(\n view: DesignSystemView,\n): Rule.RuleModule {\n return {\n meta: {\n type: \"problem\",\n docs: { description: \"Allow only the P1 focus pattern.\" },\n messages: {\n classGroup: `Focus styling in this class string must be exactly ${P1_DESCRIPTION}; {{problems}}.`,\n inlineStyle: `Inline {{property}} changes the focus indicator; use ${P1_DESCRIPTION}.`,\n whileFocus: `whileFocus styles the focused state with {{property}}; focus styling must be exactly ${P1_DESCRIPTION}.`,\n handler: `This {{attribute}} handler styles the focus indicator imperatively; use ${P1_DESCRIPTION}.`,\n assignment: `.style writes to {{property}} change the focus indicator; use ${P1_DESCRIPTION}.`,\n },\n schema: [],\n },\n create(context) {\n return {\n \"Program:exit\"() {\n const report = createUniqueReporter(context);\n const model = collectFrontendModel(context.sourceCode);\n const groups = evaluateClassGroups(model, view);\n const scopedNodes = selectFocusScopedNodes(groups);\n const focusStyled = collectFocusStyledElements(model, scopedNodes);\n const scopedHandlers = selectScopedHandlers(model, focusStyled);\n reportClassGroups(report, groups);\n reportStyleKeys(report, model, focusStyled);\n reportHandlers(report, scopedHandlers);\n reportAssignments(report, model, scopedHandlers);\n },\n };\n },\n };\n}\n","/**\n * The `form-control-has-label` rule: every form control needs an accessible name.\n *\n * @packageDocumentation\n */\nimport type { Rule, Scope, SourceCode } from \"eslint\";\n\nimport {\n type AstNode,\n childNode,\n childNodes,\n childString,\n containsNode,\n findJsxAttribute,\n findVariable,\n FUNCTION_TYPES,\n jsxAttributeValue,\n jsxElementName,\n staticText,\n toAstNode,\n toRuleNode,\n} from \"../ast.js\";\n\n/**\n * A `<label htmlFor>` and the component it renders in.\n */\ninterface LabelTarget {\n /** The component that renders the label, in the format {@link enclosingComponent} returns. */\n readonly component: AstNode;\n /** The id key of the label's `htmlFor`, in the format {@link idKey} returns. */\n readonly key: string;\n}\n\n/**\n * Elements that need a label.\n */\nconst CONTROLS = new Set([\"input\", \"textarea\", \"select\"]);\n\n/**\n * Elements a `<label>` without `htmlFor` can label.\n */\nconst LABELABLE_ELEMENTS = new Set([\n \"button\",\n \"input\",\n \"meter\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n]);\n\n/**\n * Input types that need no label.\n */\nconst EXEMPT_INPUT_TYPES = new Set([\n \"hidden\",\n \"submit\",\n \"reset\",\n \"button\",\n \"image\",\n]);\n\n/**\n * Attributes that give a control an accessible name on their own.\n */\nconst LABEL_ATTRIBUTES = [\"aria-label\", \"aria-labelledby\"];\n\n/**\n * Id expression types matched by their source text.\n */\nconst SOURCE_KEYED_TYPES = new Set([\n \"MemberExpression\",\n \"ChainExpression\",\n \"TemplateLiteral\",\n]);\n\n/**\n * Reads the static text of an attribute.\n *\n * @param opening - A `JSXOpeningElement`.\n * @param name - The attribute name.\n * @returns The text, or `undefined` when the attribute is missing or not static.\n */\nfunction attributeText(opening: AstNode, name: string): string | undefined {\n const attribute = findJsxAttribute(opening, name);\n return attribute ? staticText(jsxAttributeValue(attribute)) : undefined;\n}\n\n/**\n * Tells whether an attribute value is known to be empty.\n *\n * @param value - The attribute value.\n * @returns `true` for no value, `null`, `undefined` or an empty static string.\n */\nfunction isStaticallyAbsent(value: AstNode | undefined): boolean {\n return (\n value === undefined ||\n (value.type === \"Literal\" && value.value === null) ||\n (value.type === \"Identifier\" && value.name === \"undefined\") ||\n staticText(value) === \"\"\n );\n}\n\n/**\n * Tells whether an element has a non-absent `aria-label` or `aria-labelledby`.\n *\n * @param opening - A `JSXOpeningElement`.\n * @returns `true` when either attribute gives the element a name.\n */\nfunction hasAriaName(opening: AstNode): boolean {\n return LABEL_ATTRIBUTES.some((name) => {\n const attribute = findJsxAttribute(opening, name);\n return (\n attribute !== undefined &&\n !isStaticallyAbsent(jsxAttributeValue(attribute))\n );\n });\n}\n\n/**\n * Tells whether a control is skipped: it spreads props, or it is an input of an exempt type.\n *\n * @param opening - A control's `JSXOpeningElement`.\n * @param name - The control's tag name.\n * @returns `true` when the rule does not check the control.\n */\nfunction isExemptControl(opening: AstNode, name: string): boolean {\n const typeValue = attributeText(opening, \"type\");\n const spread = childNodes(opening, \"attributes\").some(\n (attribute) => attribute.type === \"JSXSpreadAttribute\",\n );\n return (\n spread ||\n (name === \"input\" &&\n typeValue !== undefined &&\n EXEMPT_INPUT_TYPES.has(typeValue))\n );\n}\n\n/**\n * Tells whether a `<label>` without `htmlFor` can label an element.\n *\n * @param opening - A `JSXOpeningElement`.\n * @returns `true` for labelable elements other than hidden inputs.\n */\nfunction isLabelable(opening: AstNode): boolean {\n const name = jsxElementName(opening) ?? \"\";\n return (\n LABELABLE_ELEMENTS.has(name) &&\n !(name === \"input\" && attributeText(opening, \"type\") === \"hidden\")\n );\n}\n\n/**\n * Builds the key of a variable from its declaration.\n *\n * @param variable - A variable, or `undefined` or `null` for none.\n * @returns `variable:<offset>`, where offset is the start of the variable's declaration, or\n * `undefined` for no variable or a variable without a declaration, such as a configured global.\n */\nfunction declarationKey(\n variable: Scope.Variable | null | undefined,\n): string | undefined {\n const range = variable?.identifiers[0]?.range;\n return range ? `variable:${String(range[0])}` : undefined;\n}\n\n/**\n * Builds the id key of an identifier from the variable it resolves to.\n *\n * @param identifier - An `Identifier` used as an id.\n * @param sourceCode - The file's source code.\n * @returns The key {@link declarationKey} builds for the variable, or `undefined` when the\n * identifier resolves to no declared variable.\n */\nfunction variableKey(\n identifier: AstNode,\n sourceCode: SourceCode,\n): string | undefined {\n const scope = sourceCode.getScope(toRuleNode(identifier));\n return declarationKey(findVariable(scope, String(identifier.name)));\n}\n\n/**\n * Tells whether a reference can read a runtime value.\n *\n * @param reference - A reference.\n * @returns `false` for a TypeScript type-only reference, such as the type in `props as Field`;\n * `true` for every other reference.\n */\nfunction isValueReference(reference: Scope.Reference): boolean {\n return (\n !(\"isValueReference\" in reference) || reference.isValueReference === true\n );\n}\n\n/**\n * Lists the value references a scope and its nested scopes make inside an expression.\n *\n * @param scope - The innermost scope holding the expression.\n * @param expression - The expression.\n * @returns The references whose identifier lies inside the expression, in scope order, without\n * type-only references.\n */\nfunction listContainedReferences(\n scope: Scope.Scope,\n expression: AstNode,\n): Scope.Reference[] {\n const ownReferences = scope.references.filter(\n (reference) =>\n isValueReference(reference) &&\n containsNode(expression, toAstNode(reference.identifier)),\n );\n const nestedReferences = scope.childScopes\n .filter((child) => containsNode(expression, toAstNode(child.block)))\n .flatMap((child) => listContainedReferences(child, expression));\n return [...ownReferences, ...nestedReferences];\n}\n\n/**\n * Builds the key of a reference from the variable it resolves to.\n *\n * @param reference - A reference.\n * @returns The key {@link declarationKey} builds for the resolved variable, or `global:<name>` for\n * a name that resolves to no declared variable.\n */\nfunction referenceKey(reference: Scope.Reference): string {\n return (\n declarationKey(reference.resolved) ?? `global:${reference.identifier.name}`\n );\n}\n\n/**\n * Builds the id key of an expression from its source text and the variables it reads.\n *\n * @param expression - A member, optional-chain or template expression used as an id.\n * @param sourceCode - The file's source code.\n * @returns `source:<text>@<variables>`, where variables lists the key of every value the expression\n * reads, so the same text over different variables, such as parameters of two callbacks, gives\n * different keys even when both callbacks map the same array.\n */\nfunction sourceKey(expression: AstNode, sourceCode: SourceCode): string {\n const node = toRuleNode(expression);\n const references = listContainedReferences(\n sourceCode.getScope(node),\n expression,\n );\n const variables = references.map((reference) => referenceKey(reference));\n return `source:${sourceCode.getText(node)}@${variables.join(\",\")}`;\n}\n\n/**\n * Builds the key two id attributes share when they refer to the same id.\n *\n * @param attribute - An `id` or `htmlFor` attribute.\n * @param sourceCode - The file's source code.\n * @returns `string:<text>` for non-empty static text, the key {@link variableKey} builds for an\n * identifier, the key {@link sourceKey} builds for a member, optional-chain or template\n * expression, and `undefined` for a missing attribute, an empty string or any other expression.\n */\nfunction idKey(\n attribute: AstNode | undefined,\n sourceCode: SourceCode,\n): string | undefined {\n const value = attribute ? jsxAttributeValue(attribute) : undefined;\n const text = staticText(value);\n if (text !== undefined) {\n return text === \"\" ? undefined : `string:${text}`;\n }\n if (value?.type === \"Identifier\") {\n return variableKey(value, sourceCode);\n }\n return value && SOURCE_KEYED_TYPES.has(value.type)\n ? sourceKey(value, sourceCode)\n : undefined;\n}\n\n/**\n * Reads the name a function declaration or a variable initialiser declares.\n *\n * @param node - A function node.\n * @returns The name of a function declaration; for a function that initialises a variable, its own\n * name, else the variable's; `undefined` for any other function, such as a callback passed to a\n * call, a property value or a class method.\n */\nfunction functionName(node: AstNode): string | undefined {\n const parent = node.parent;\n const ownName = childString(childNode(node, \"id\"), \"name\");\n if (node.type === \"FunctionDeclaration\") {\n return ownName;\n }\n if (parent?.type !== \"VariableDeclarator\" || parent.init !== node) {\n return undefined;\n }\n return ownName ?? childString(childNode(parent, \"id\"), \"name\");\n}\n\n/**\n * Finds the component an element renders in.\n *\n * @param node - Any node.\n * @returns The nearest enclosing function declaration or variable initialiser whose name starts\n * with a capital letter; else the outermost enclosing function, so callbacks nested in a component\n * count as that component; else the program root outside any function.\n */\nfunction enclosingComponent(node: AstNode): AstNode {\n let outermostFunction: AstNode | undefined;\n let current = node;\n while (current.parent) {\n if (FUNCTION_TYPES.has(current.type)) {\n if (/^[A-Z]/.test(functionName(current) ?? \"\")) {\n return current;\n }\n outermostFunction = current;\n }\n current = current.parent;\n }\n return outermostFunction ?? current;\n}\n\n/**\n * Tells whether a node is a `<label>` element.\n *\n * @param node - Any node.\n * @returns `true` for a `JSXElement` whose tag is `label`.\n */\nfunction isLabelElement(node: AstNode): boolean {\n const opening = childNode(node, \"openingElement\");\n return (\n node.type === \"JSXElement\" &&\n opening !== undefined &&\n jsxElementName(opening) === \"label\"\n );\n}\n\n/**\n * Finds the nearest `<label>` element around an element.\n *\n * @param opening - A `JSXOpeningElement`.\n * @returns The enclosing label's `JSXElement`, or `undefined` when none encloses it.\n */\nfunction enclosingLabel(opening: AstNode): AstNode | undefined {\n let current = opening.parent?.parent;\n while (current && !isLabelElement(current)) {\n current = current.parent;\n }\n return current;\n}\n\n/**\n * Tells whether two elements sit on opposite branches of the same conditional, so at most one of\n * them renders.\n *\n * @param first - An element.\n * @param second - Another element.\n * @returns `true` when the nearest conditional expression enclosing both holds one in its\n * consequent and the other in its alternate.\n */\nfunction areMutuallyExclusive(first: AstNode, second: AstNode): boolean {\n let current = first.parent;\n while (\n current &&\n !(current.type === \"ConditionalExpression\" && containsNode(current, second))\n ) {\n current = current.parent;\n }\n const consequent = childNode(current, \"consequent\");\n const alternate = childNode(current, \"alternate\");\n if (!consequent || !alternate) {\n return false;\n }\n return (\n (containsNode(consequent, first) && containsNode(alternate, second)) ||\n (containsNode(alternate, first) && containsNode(consequent, second))\n );\n}\n\n/**\n * Tells whether an enclosing `<label>` labels a control.\n *\n * @param opening - The control's `JSXOpeningElement`.\n * @param controlKey - The id key of the control's `id`.\n * @param openings - Every opening element in the file, in source order.\n * @param sourceCode - The file's source code.\n * @returns `true` when the label's `htmlFor` matches the control's id, or when the label has no\n * `htmlFor` and the control is its first labelable element; an element on the other branch of a\n * conditional never renders together with the control, so it does not count as earlier.\n */\nfunction hasWrappingLabel(\n opening: AstNode,\n controlKey: string | undefined,\n openings: readonly AstNode[],\n sourceCode: SourceCode,\n): boolean {\n const label = enclosingLabel(opening);\n const labelOpening = childNode(label, \"openingElement\");\n if (!label || !labelOpening) {\n return false;\n }\n const htmlFor = findJsxAttribute(labelOpening, \"htmlFor\");\n if (htmlFor !== undefined) {\n return (\n controlKey !== undefined && idKey(htmlFor, sourceCode) === controlKey\n );\n }\n const firstLabelable = openings.find(\n (candidate) =>\n containsNode(label, candidate) &&\n isLabelable(candidate) &&\n !areMutuallyExclusive(candidate, opening),\n );\n return firstLabelable === opening;\n}\n\n/**\n * Builds the label target of a `<label>` with a resolvable `htmlFor`.\n *\n * @param opening - A `JSXOpeningElement`.\n * @param sourceCode - The file's source code.\n * @returns The label's component and id key, or `undefined` for any other element.\n */\nfunction buildLabelTarget(\n opening: AstNode,\n sourceCode: SourceCode,\n): LabelTarget | undefined {\n if (jsxElementName(opening) !== \"label\") {\n return undefined;\n }\n const key = idKey(findJsxAttribute(opening, \"htmlFor\"), sourceCode);\n return key === undefined\n ? undefined\n : { component: enclosingComponent(opening), key };\n}\n\n/**\n * Tells whether an element is a control the rule checks that has no aria name.\n *\n * @param opening - A `JSXOpeningElement`.\n * @returns `true` for a non-exempt control without `aria-label` or `aria-labelledby`.\n */\nfunction needsLabel(opening: AstNode): boolean {\n const name = jsxElementName(opening) ?? \"\";\n return (\n CONTROLS.has(name) &&\n !isExemptControl(opening, name) &&\n !hasAriaName(opening)\n );\n}\n\n/**\n * `form-control-has-label`: every `input`, `textarea` and `select` needs an accessible name.\n *\n * A control passes with a non-absent `aria-label` or `aria-labelledby`; as the first labelable\n * element inside a `<label>` without `htmlFor`, where elements on the other branch of a conditional\n * do not count; inside a `<label>` with a matching `htmlFor`; or next to a `<label htmlFor>` in the\n * same component whose id matches. The component is the nearest enclosing function declaration or\n * variable initialiser named with a capital letter (by its own name or its variable's), else the\n * outermost enclosing function, so callbacks, named ones included, count as their component. Ids\n * match when they are the same static string, the same variable (a `const`, a prop, a parameter or\n * a `useId()` result), or member, optional-chain or template expressions with the same source text\n * whose values resolve to the same variables. Controls with spread props are skipped, and so are\n * inputs of type hidden, submit, reset, button and image.\n *\n * Known false positives: a component defined inside another component is a separate component, so\n * it does not pair with a label its enclosing component renders; and separate callbacks over the\n * same data, such as a label list and an input list mapping one array, do not pair. Known false\n * negative: components nested in a factory function pair with each other's labels when they are\n * wrapped in a call such as `forwardRef` or `memo`, written as object property values, or written\n * as classes, since only function declarations and variable initialisers are component boundaries.\n */\nexport const formControlHasLabelRule: Rule.RuleModule = {\n meta: {\n type: \"problem\",\n docs: { description: \"Require a label on form controls.\" },\n messages: {\n unlabelled:\n \"Give this <{{element}}> a <label>, a matching <label htmlFor>, or an aria-label or aria-labelledby; a placeholder is not a label.\",\n },\n schema: [],\n },\n create(context) {\n const sourceCode = context.sourceCode;\n const controls: AstNode[] = [];\n const labels: LabelTarget[] = [];\n const openings: AstNode[] = [];\n return {\n JSXOpeningElement(node: Rule.Node) {\n const opening = toAstNode(node);\n openings.push(opening);\n const label = buildLabelTarget(opening, sourceCode);\n if (label) {\n labels.push(label);\n }\n if (needsLabel(opening)) {\n controls.push(opening);\n }\n },\n \"Program:exit\"() {\n for (const control of controls) {\n const key = idKey(findJsxAttribute(control, \"id\"), sourceCode);\n const component = enclosingComponent(control);\n const sibling =\n key !== undefined &&\n labels.some(\n (label) => label.key === key && label.component === component,\n );\n if (\n !sibling &&\n !hasWrappingLabel(control, key, openings, sourceCode)\n ) {\n context.report({\n node: toRuleNode(control),\n messageId: \"unlabelled\",\n data: { element: jsxElementName(control) ?? \"\" },\n });\n }\n }\n },\n };\n },\n};\n","/**\n * The `no-embedded-style` rule: JSX may not embed `<style>` elements.\n *\n * @packageDocumentation\n */\nimport type { Rule } from \"eslint\";\n\nimport { jsxElementName, toAstNode } from \"../ast.js\";\n\n/**\n * `no-embedded-style`: flags every JSX `<style>` element, whose CSS the CSS rules cannot check.\n */\nexport const noEmbeddedStyleRule: Rule.RuleModule = {\n meta: {\n type: \"problem\",\n docs: { description: \"Disallow JSX <style> elements.\" },\n messages: {\n embedded:\n \"Move this CSS into a project stylesheet, where the CSS rules check it.\",\n },\n schema: [],\n },\n create(context) {\n return {\n JSXOpeningElement(node: Rule.Node) {\n if (jsxElementName(toAstNode(node)) === \"style\") {\n context.report({ node, messageId: \"embedded\" });\n }\n },\n };\n },\n};\n","/**\n * Builds rules that flag class tokens and inline styles whose declarations match a predicate.\n *\n * @packageDocumentation\n */\nimport type { Rule } from \"eslint\";\n\nimport { compileClassGroup } from \"./class-group-declarations.js\";\nimport {\n type ClassGroup,\n collectFrontendModel,\n type StyleLeaf,\n} from \"./collect.js\";\nimport { type Declaration, parseStyleLeaf } from \"./css-declarations.js\";\nimport type { DesignSystemView } from \"./design-system.js\";\nimport { createUniqueReporter, type Reporter } from \"./report.js\";\n\n/**\n * What a declaration rule flags and how it reports it.\n */\nexport interface DeclarationRuleOptions {\n /** The rule description shown in ESLint metadata. */\n readonly description: string;\n /** The single message ID the rule reports. */\n readonly messageId: string;\n /** The report message, with a `source` placeholder for the offending token or declaration. */\n readonly message: string;\n /** Tells whether a declaration breaks the rule. */\n readonly matches: (declaration: Declaration) => boolean;\n}\n\n/**\n * Reports each token of a class group that compiles to a matching declaration.\n *\n * @param report - The reporter to send diagnostics to.\n * @param group - One class group.\n * @param view - The project design system.\n * @param options - The rule's predicate and message ID.\n */\nfunction checkClassGroup(\n report: Reporter,\n group: ClassGroup,\n view: DesignSystemView,\n options: DeclarationRuleOptions,\n): void {\n for (const { token, declarations } of compileClassGroup(group, view)) {\n if (declarations.some((declaration) => options.matches(declaration))) {\n report({\n node: group.node,\n messageId: options.messageId,\n data: { source: token },\n });\n }\n }\n}\n\n/**\n * Reports an inline style leaf whose declaration matches.\n *\n * @param report - The reporter to send diagnostics to.\n * @param leaf - One inline style leaf.\n * @param options - The rule's predicate and message ID.\n */\nfunction checkStyleLeaf(\n report: Reporter,\n leaf: StyleLeaf,\n options: DeclarationRuleOptions,\n): void {\n const declaration = parseStyleLeaf(leaf);\n if (declaration && options.matches(declaration)) {\n report({\n node: leaf.node,\n messageId: options.messageId,\n data: { source: declaration.text },\n });\n }\n}\n\n/**\n * Builds a rule that flags every class token and inline style leaf whose declaration matches.\n *\n * A token is reported with its own text as `source`; a style leaf with its declaration text.\n *\n * @param view - The project design system.\n * @param options - The predicate, message and metadata of the rule.\n * @returns The rule.\n */\nexport function createDeclarationRule(\n view: DesignSystemView,\n options: DeclarationRuleOptions,\n): Rule.RuleModule {\n return {\n meta: {\n type: \"problem\",\n docs: { description: options.description },\n messages: { [options.messageId]: options.message },\n schema: [],\n },\n create(context) {\n return {\n \"Program:exit\"() {\n const report = createUniqueReporter(context);\n const model = collectFrontendModel(context.sourceCode);\n for (const group of model.classGroups) {\n checkClassGroup(report, group, view, options);\n }\n for (const leaf of model.styleLeaves) {\n checkStyleLeaf(report, leaf, options);\n }\n },\n };\n },\n };\n}\n","/**\n * The `viewport-units` rule: class tokens and inline styles may not use the `vh` unit.\n *\n * @packageDocumentation\n */\nimport type { Rule } from \"eslint\";\n\nimport { usesVhUnit, VH_UNIT_MESSAGE } from \"../concepts/viewport.js\";\nimport { createDeclarationRule } from \"../declaration-rule.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\n\n/**\n * Builds `viewport-units`: class tokens and inline styles may not use the `vh` unit.\n *\n * @param view - The project design system.\n * @returns The rule.\n */\nexport function createViewportUnitsRule(\n view: DesignSystemView,\n): Rule.RuleModule {\n return createDeclarationRule(view, {\n description: \"Disallow vh units.\",\n messageId: \"vhUnit\",\n message: VH_UNIT_MESSAGE,\n matches: usesVhUnit,\n });\n}\n","/**\n * The `z-index` rule: class tokens and inline styles may not set a z-index above the cap or one\n * that cannot be verified statically.\n *\n * @packageDocumentation\n */\nimport type { Rule } from \"eslint\";\n\nimport { exceedsZIndexCap, Z_INDEX_MESSAGE } from \"../concepts/z-index.js\";\nimport { createDeclarationRule } from \"../declaration-rule.js\";\nimport type { DesignSystemView } from \"../design-system.js\";\n\n/**\n * Builds `z-index`: class tokens and inline styles may not set a z-index above the cap or one that\n * cannot be verified statically.\n *\n * @param view - The project design system.\n * @returns The rule.\n */\nexport function createZIndexRule(view: DesignSystemView): Rule.RuleModule {\n return createDeclarationRule(view, {\n description: \"Cap z-index values.\",\n messageId: \"exceeds\",\n message: Z_INDEX_MESSAGE,\n matches: (declaration) => exceedsZIndexCap(declaration, view),\n });\n}\n","/**\n * Assembles the frontend rules into the `pragmatiks` ESLint plugin.\n *\n * @packageDocumentation\n */\nimport type { ESLint } from \"eslint\";\n\nimport type { DesignSystemView } from \"./design-system.js\";\nimport { createAnimatedPropertiesRule } from \"./rules/animated-properties.js\";\nimport { createColorTokensRule } from \"./rules/color-tokens.js\";\nimport { createCssAnimatedPropertiesRule } from \"./rules/css-animated-properties.js\";\nimport { createCssColorTokensRule } from \"./rules/css-color-tokens.js\";\nimport { cssFocusStylingRule } from \"./rules/css-focus-styling.js\";\nimport { cssNoApplyRule } from \"./rules/css-no-apply.js\";\nimport { cssParsedFullyRule } from \"./rules/css-parsed-fully.js\";\nimport { cssViewportUnitsRule } from \"./rules/css-viewport-units.js\";\nimport { createCssZIndexRule } from \"./rules/css-z-index.js\";\nimport { createFocusStylingRule } from \"./rules/focus-styling.js\";\nimport { formControlHasLabelRule } from \"./rules/form-control-has-label.js\";\nimport { noEmbeddedStyleRule } from \"./rules/no-embedded-style.js\";\nimport { createViewportUnitsRule } from \"./rules/viewport-units.js\";\nimport { createZIndexRule } from \"./rules/z-index.js\";\n\n/**\n * Plugin rules keyed by rule ID.\n */\ntype PluginRules = NonNullable<ESLint.Plugin[\"rules\"]>;\n\n/**\n * The frontend rules keyed by rule ID, split by the files they run on.\n */\nexport interface FrontendRules {\n /** The rules for JavaScript and TypeScript files. */\n readonly javascript: PluginRules;\n /** The rules for CSS files. */\n readonly css: PluginRules;\n}\n\n/**\n * Builds every frontend rule around one project's design system.\n *\n * @param view - The project design system every Tailwind-aware rule reads.\n * @returns The rules for JavaScript and TypeScript files and the rules for CSS files.\n */\nexport function createFrontendRules(view: DesignSystemView): FrontendRules {\n return {\n javascript: {\n \"form-control-has-label\": formControlHasLabelRule,\n \"focus-styling\": createFocusStylingRule(view),\n \"animated-properties\": createAnimatedPropertiesRule(view),\n \"viewport-units\": createViewportUnitsRule(view),\n \"z-index\": createZIndexRule(view),\n \"color-tokens\": createColorTokensRule(view),\n \"no-embedded-style\": noEmbeddedStyleRule,\n },\n css: {\n \"css-focus-styling\": cssFocusStylingRule,\n \"css-animated-properties\": createCssAnimatedPropertiesRule(view),\n \"css-viewport-units\": cssViewportUnitsRule,\n \"css-z-index\": createCssZIndexRule(view),\n \"css-color-tokens\": createCssColorTokensRule(view),\n \"css-no-apply\": cssNoApplyRule,\n \"css-parsed-fully\": cssParsedFullyRule,\n } as unknown as PluginRules,\n };\n}\n\n/**\n * Builds the `pragmatiks` frontend plugin.\n *\n * @param rules - The frontend rules the plugin registers.\n * @returns The plugin with every JavaScript and CSS rule.\n */\nexport function createFrontendPlugin(rules: FrontendRules): ESLint.Plugin {\n return {\n meta: { name: \"@pragmatiks/lint/eslint-config/next\" },\n rules: { ...rules.javascript, ...rules.css },\n };\n}\n","/**\n * The `@pragmatiks/lint/eslint-config/next` entry: the flat config for a Next app with Tailwind.\n *\n * @packageDocumentation\n */\nimport css from \"@eslint/css\";\nimport type { ESLint, Linter } from \"eslint\";\nimport reactX from \"eslint-plugin-react-x\";\n\nimport { pragmatiksConfig } from \"../index.js\";\nimport {\n type DesignSystemSource,\n type DesignSystemView,\n loadDesignSystem,\n} from \"./frontend/design-system.js\";\nimport {\n createFrontendPlugin,\n createFrontendRules,\n type FrontendRules,\n} from \"./frontend/plugin.js\";\nimport {\n FILENAME_CASE_OPTIONS,\n NO_USELESS_UNDEFINED_OPTIONS,\n} from \"../options.js\";\n\n/**\n * One rule's severity and options.\n */\ntype RuleEntry = Linter.RuleEntry;\n\n/**\n * The part of `eslint-plugin-jsx-a11y` this config reads.\n */\ninterface AccessibilityPlugin {\n /** The plugin's flat presets. */\n readonly flatConfigs?: {\n readonly recommended?: { readonly rules?: Record<string, RuleEntry> };\n };\n}\n\nconst ACCESSIBILITY_PLUGIN = \"jsx-a11y\";\nconst LABEL_RULE = \"jsx-a11y/control-has-associated-label\";\nconst TYPED_FILES = [\"**/*.{ts,tsx,mts}\"];\nconst THREE_DOTS_PATTERN = String.raw`/[A-Za-z]\\.\\.\\./`;\nconst ELLIPSIS_MESSAGE = \"Write the ellipsis glyph … instead of three dots.\";\nconst ZOOM_MESSAGE = \"Never disable zoom in the viewport export.\";\nconst FORWARD_REF_MESSAGE =\n \"Pass ref as a prop; React 19 does not need forwardRef.\";\nconst URL_ATTRIBUTE = String.raw`JSXAttribute[name.name=/^(href|src|action)$/]`;\nconst ELLIPSIS_EXEMPT_LITERAL = [\n `${URL_ATTRIBUTE} Literal`,\n \"ImportDeclaration > Literal\",\n \"ExportNamedDeclaration > Literal\",\n \"ExportAllDeclaration > Literal\",\n \"ImportExpression > Literal\",\n].join(\", \");\nconst PRESET_RECOVERY =\n \"To fix it, pass [...nextVitals, ...nextTs] from eslint-config-next\";\nconst ICON_FAMILY = \"@phosphor-icons/react\";\nconst ICON_PACKAGES = [\n \"lucide-react\",\n \"react-icons\",\n \"react-icons/*\",\n \"@heroicons/*\",\n \"@tabler/icons-react\",\n \"@radix-ui/react-icons\",\n \"react-feather\",\n \"@fortawesome/*\",\n \"@mui/icons-material\",\n \"@mui/icons-material/*\",\n];\n\nconst RESTRICTED_SYNTAX = [\n {\n selector: `JSXText[value=${THREE_DOTS_PATTERN}]`,\n message: ELLIPSIS_MESSAGE,\n },\n {\n selector: `Literal[value=${THREE_DOTS_PATTERN}]:not(${ELLIPSIS_EXEMPT_LITERAL})`,\n message: ELLIPSIS_MESSAGE,\n },\n {\n selector: `TemplateElement[value.cooked=${THREE_DOTS_PATTERN}]:not(${URL_ATTRIBUTE} TemplateElement)`,\n message: ELLIPSIS_MESSAGE,\n },\n {\n selector: `JSXAttribute[name.name=\"onPaste\"] CallExpression[callee.property.name=\"preventDefault\"]`,\n message: \"Never block pasting into inputs.\",\n },\n {\n selector: `Property:matches([key.name=\"userScalable\"], [key.value=\"userScalable\"])[value.value=false]`,\n message: ZOOM_MESSAGE,\n },\n {\n selector: `Property:matches([key.name=\"maximumScale\"], [key.value=\"maximumScale\"])[value.value=1]`,\n message: ZOOM_MESSAGE,\n },\n {\n selector: `JSXOpeningElement[name.name=\"link\"] JSXAttribute[name.name=\"href\"] Literal[value=/fonts\\.(googleapis|gstatic)\\.com/]`,\n message: \"Load fonts through next/font, not a <link> to Google Fonts.\",\n },\n {\n selector: `JSXText[value=/lorem ipsum|John Doe/i]`,\n message: \"Replace placeholder content with real copy.\",\n },\n];\n\nconst RESTRICTED_IMPORTS = {\n paths: [\n {\n name: \"react\",\n importNames: [\"forwardRef\"],\n message: FORWARD_REF_MESSAGE,\n },\n ],\n patterns: [\n {\n group: ICON_PACKAGES,\n message: `Use ${ICON_FAMILY}, the project's one icon family.`,\n },\n ],\n};\n\nconst RESTRICTED_PROPERTIES = {\n object: \"React\",\n property: \"forwardRef\",\n message: FORWARD_REF_MESSAGE,\n};\n\n/**\n * Where the Next app lives and which stylesheet is its Tailwind entry point.\n */\nexport interface PragmatiksNextOptions extends DesignSystemSource {\n /** Absolute path of the Next app, usually `import.meta.dirname` of its `eslint.config.mjs`. */\n readonly rootDir: string;\n /** Path of the Tailwind entry stylesheet relative to `rootDir`, such as `app/globals.css`. */\n readonly tailwindStylesheet: string;\n}\n\n/**\n * Tells whether a config object only lists ignores.\n *\n * @param config - A flat config object.\n * @returns `true` when the object has no keys besides `ignores` and `name`.\n */\nfunction isIgnoreOnly(config: Linter.Config): boolean {\n return Object.keys(config).every(\n (key) => key === \"ignores\" || key === \"name\",\n );\n}\n\n/**\n * Finds the one Next config object that registers `jsx-a11y`.\n *\n * @param nextConfigs - The Next presets.\n * @returns The object, which has `files`.\n * @throws Error when no object or more than one registers `jsx-a11y`, or the one that does has\n * no `files`.\n */\nfunction findAccessibilityConfig(\n nextConfigs: readonly Linter.Config[],\n): Linter.Config {\n const matches = nextConfigs.filter(\n (config) => config.plugins?.[ACCESSIBILITY_PLUGIN] !== undefined,\n );\n const [only] = matches;\n if (matches.length !== 1 || !only?.files) {\n throw new Error(\n `@pragmatiks/lint: pragmatiksNextConfig expects exactly one Next config object that registers ${ACCESSIBILITY_PLUGIN} with files; found ${String(matches.length)}. ${PRESET_RECOVERY}.`,\n );\n }\n return only;\n}\n\n/**\n * Scopes the Next config objects that have no `files` to a glob.\n *\n * @param nextConfigs - The Next presets.\n * @param files - The glob to apply.\n * @returns The presets, with ignore-only objects and objects that have `files` unchanged.\n */\nfunction scopeNextConfigs(\n nextConfigs: readonly Linter.Config[],\n files: Linter.Config[\"files\"],\n): Linter.Config[] {\n return nextConfigs.map((config) =>\n config.files || isIgnoreOnly(config) ? config : { ...config, files },\n );\n}\n\n/**\n * Adds `select` to the ignored elements of `jsx-a11y/control-has-associated-label`.\n *\n * @param labelOptions - The rule's recommended options.\n * @returns The options with `select` appended to `ignoreElements`.\n */\nfunction buildLabelOptions(labelOptions: readonly unknown[]): unknown[] {\n const [first, ...rest] = labelOptions;\n const options = (first ?? {}) as { ignoreElements?: readonly string[] };\n return [\n {\n ...options,\n ignoreElements: [...(options.ignoreElements ?? []), \"select\"],\n },\n ...rest,\n ];\n}\n\n/**\n * Builds the `jsx-a11y` rules: the recommended preset with the label rule and `no-autofocus` as\n * errors.\n *\n * @param accessibilityConfig - The Next object that registers `jsx-a11y`.\n * @returns The rule entries.\n * @throws Error when the plugin has no flat recommended preset with label rule options.\n */\nfunction buildAccessibilityRules(\n accessibilityConfig: Linter.Config,\n): Record<string, RuleEntry> {\n const plugin = accessibilityConfig.plugins?.[ACCESSIBILITY_PLUGIN] as\n | AccessibilityPlugin\n | undefined;\n const recommended = plugin?.flatConfigs?.recommended?.rules;\n const labelEntry = recommended?.[LABEL_RULE];\n if (!recommended || !Array.isArray(labelEntry)) {\n throw new Error(\n `@pragmatiks/lint: ${ACCESSIBILITY_PLUGIN} has no flat recommended preset with ${LABEL_RULE} options. ${PRESET_RECOVERY}.`,\n );\n }\n const [, ...labelOptions] = labelEntry;\n return {\n ...recommended,\n [LABEL_RULE]: [\"error\", ...buildLabelOptions(labelOptions)],\n \"jsx-a11y/no-autofocus\": [\"error\", { ignoreNonDOM: true }],\n };\n}\n\n/**\n * Turns frontend rule ids into error entries under the `pragmatiks` plugin.\n *\n * @param ruleIds - The rule ids without the plugin prefix.\n * @returns One `pragmatiks/<id>: \"error\"` entry per id.\n */\nfunction buildRuleEntries(\n ruleIds: readonly string[],\n): Record<string, RuleEntry> {\n return Object.fromEntries(\n ruleIds.map((ruleId) => [`pragmatiks/${ruleId}`, \"error\"]),\n );\n}\n\n/**\n * Builds the config object for the JavaScript and TypeScript frontend rules.\n *\n * @param accessibilityConfig - The Next object that registers `jsx-a11y`, whose `files` it reuses.\n * @param plugin - The `pragmatiks` plugin.\n * @param rules - The frontend rules.\n * @returns The config object.\n * @throws Error when `jsx-a11y` has no flat recommended preset with label rule options.\n */\nfunction buildFrontendConfig(\n accessibilityConfig: Linter.Config,\n plugin: ESLint.Plugin,\n rules: FrontendRules,\n): Linter.Config {\n return {\n name: \"pragmatiks/next/frontend\",\n files: accessibilityConfig.files,\n plugins: { pragmatiks: plugin },\n rules: {\n ...buildAccessibilityRules(accessibilityConfig),\n ...buildRuleEntries(Object.keys(rules.javascript)),\n \"no-restricted-syntax\": [\"error\", ...RESTRICTED_SYNTAX],\n \"no-restricted-imports\": [\"error\", RESTRICTED_IMPORTS],\n \"no-restricted-properties\": [\"error\", RESTRICTED_PROPERTIES],\n \"no-alert\": \"error\",\n \"unicorn/filename-case\": [\"error\", FILENAME_CASE_OPTIONS],\n \"unicorn/no-useless-undefined\": [\"error\", NO_USELESS_UNDEFINED_OPTIONS],\n },\n };\n}\n\n/**\n * Builds the config object for the typed `react-x` leaked-render check.\n *\n * @param rootDirectory - The app root, where the TypeScript project service looks for tsconfig.\n * @returns The config object for TypeScript files.\n */\nfunction buildTypedConfig(rootDirectory: string): Linter.Config {\n return {\n name: \"pragmatiks/next/typed\",\n files: TYPED_FILES,\n plugins: { \"react-x\": reactX as unknown as ESLint.Plugin },\n languageOptions: {\n parserOptions: { projectService: true, tsconfigRootDir: rootDirectory },\n },\n rules: { \"react-x/no-leaked-conditional-rendering\": \"error\" },\n };\n}\n\n/**\n * Builds the config object for the CSS rules.\n *\n * @param plugin - The `pragmatiks` plugin.\n * @param rules - The frontend rules.\n * @returns The config object for CSS files, parsed tolerantly by `@eslint/css`.\n */\nfunction buildCssConfig(\n plugin: ESLint.Plugin,\n rules: FrontendRules,\n): Linter.Config {\n return {\n name: \"pragmatiks/next/css\",\n files: [\"**/*.css\"],\n plugins: { css: css as unknown as ESLint.Plugin, pragmatiks: plugin },\n language: \"css/css\",\n languageOptions: { tolerant: true },\n rules: buildRuleEntries(Object.keys(rules.css)),\n };\n}\n\n/**\n * Builds the flat config for a Next app: the Next presets, the Pragmatiks base config, the\n * frontend rules for JavaScript and TypeScript, a typed leaked-render check, and the CSS rules.\n *\n * Next config objects without `files` are scoped to the glob of the one object that registers\n * `jsx-a11y`; ignore-only objects are kept as they are. The base config's typescript-eslint parser\n * replaces Next's Babel parser on JavaScript files. The project's Tailwind design system is loaded\n * when the config is built, so a stylesheet edit needs a restart of long-lived ESLint processes.\n *\n * Note: requires the optional peers `@eslint/css`, `eslint-plugin-react-x`, `tailwindcss`,\n * `@tailwindcss/postcss` and `@tailwindcss/node`, with `tailwindcss` and `@tailwindcss/postcss`\n * resolvable from `rootDir`.\n *\n * @param nextConfigs - The `eslint-config-next` presets, such as `[...nextVitals, ...nextTs]`.\n * @param options - The app root and its Tailwind entry stylesheet.\n * @returns The composed flat config.\n * @throws Error when the presets do not register `jsx-a11y` exactly once or lack its flat\n * recommended preset, when a peer or Tailwind package is missing or their versions differ, when\n * the stylesheet cannot be read, or when the Tailwind API or canary check fails.\n */\nexport async function pragmatiksNextConfig(\n nextConfigs: readonly Linter.Config[],\n options: PragmatiksNextOptions,\n): Promise<Linter.Config[]> {\n const accessibilityConfig = findAccessibilityConfig(nextConfigs);\n const view: DesignSystemView = await loadDesignSystem(options);\n const rules = createFrontendRules(view);\n const plugin = createFrontendPlugin(rules);\n return [\n ...scopeNextConfigs(nextConfigs, accessibilityConfig.files),\n ...(pragmatiksConfig() as Linter.Config[]),\n buildFrontendConfig(accessibilityConfig, plugin, rules),\n buildTypedConfig(options.rootDir),\n buildCssConfig(plugin, rules),\n ];\n}\n"]}