import type { Rule } from 'eslint' import { ESCAPE_MESSAGES, isEscaped } from './escape' interface JSXOpeningElement { type: string name: { type: string; name?: string } loc: NonNullable range: [number, number] parent?: Parent } interface Parent { type: string name?: { name?: string } openingElement?: unknown parent?: Parent } /** * The elements this package writes by hand. The set the count used (UIG-1, * docs/GATES.md §5 and §7): every element that carries behaviour or a role of * its own. A `div` or a `span` is layout and is nobody's business here. */ export const RAW_ELEMENTS = new Set(['a', 'button', 'input', 'textarea', 'select', 'dialog', 'form', 'label']) /** * A raw element nested inside another element, in the package itself (UIG-5, * the inward tracer). * * The package is allowed to write raw elements — that is what a primitive is. * Two shapes are right, and both are facts about the code rather than a * judgement: * * - **the component's own outermost element.** `NavItem` is an ``, `Link` is * an ``, a `MenuItem` outside a `Menu` is a `