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,EAAO;AAAA,IACL,wBAAA,EAA0B;AAAA;AAE9B,CAAA;AAEA,IAAO,qBAAA,GAAQ","file":"eslint-plugin.cjs","sourcesContent":["import type {Rule} from 'eslint'\n\n/**\n * JSX isn't part of the ESTree spec eslint's own types cover, so this is\n * hand-declared for exactly the shapes this rule reads. Every field is\n * optional because the same loose shape stands in for every node kind this\n * rule inspects (Identifier, MemberExpression, CallExpression,\n * VariableDeclarator, JSXExpressionContainer, JSXAttribute); each call site\n * narrows it with a plain `.type` check instead of relying on a\n * discriminated union.\n *\n * `name` covers two real shapes that happen to share a property name:\n * `Identifier.name` is a plain string, but `JSXAttribute.name` is itself a\n * `JSXIdentifier` node (so `alt={x}`'s attribute name is\n * `node.parent.name.name`, not `node.parent.name`). getJsxAttributeName()\n * below is the one place that distinction matters.\n */\ninterface AstNode {\n  type: string\n  name?: string | AstNode\n  value?: unknown\n  computed?: boolean\n  object?: AstNode\n  property?: AstNode\n  callee?: AstNode\n  expression?: AstNode\n  init?: AstNode | null\n  parent?: AstNode\n  body?: AstNode[]\n  specifiers?: AstNode[]\n  source?: AstNode\n  local?: AstNode\n  imported?: AstNode\n  importKind?: string\n  sourceType?: string\n}\n\n/** An Identifier node's own name, narrowed from the shared `string |\n *  AstNode` field (see the AstNode doc comment for why that union exists). */\nfunction getIdentifierName(node: AstNode): string | null {\n  return typeof node.name === 'string' ? node.name : null\n}\n\n/** The property name of a member access, whether written `.username` or\n *  the computed-but-static `[\"username\"]` (a common way to sidestep a\n *  quick eyeball read of dot-access, so it's covered on purpose). Computed\n *  access with anything other than a string literal (`user[key]`) can't be\n *  resolved statically and returns null. */\nfunction getMemberPropertyName(node: AstNode): string | null {\n  if (!node.computed && node.property?.type === 'Identifier') {\n    return getIdentifierName(node.property)\n  }\n  if (node.computed && node.property?.type === 'Literal' && typeof node.property.value === 'string') {\n    return node.property.value\n  }\n  return null\n}\n\n/** The attribute name of a JSXAttribute node (`alt` in `alt={x}`), or null\n *  for shapes this rule doesn't resolve statically (for example a\n *  namespaced name like `xlink:href`). */\nfunction getJsxAttributeName(attribute: AstNode): string | null {\n  const nameNode = attribute.name\n  if (typeof nameNode === 'string') return nameNode\n  if (nameNode?.type === 'JSXIdentifier' && typeof nameNode.name === 'string') {\n    return nameNode.name\n  }\n  return null\n}\n\ninterface AutoImportConfig {\n  name: string\n  source: string\n}\n\ninterface RuleOptions {\n  riskyNames?: string[]\n  riskyAttributes?: string[]\n  sanitizerNames?: string[]\n  autoImport?: AutoImportConfig | false\n}\n\nconst DEFAULT_RISKY_NAMES = ['username', 'handle', 'displayname', 'nickname', 'bio']\nconst DEFAULT_SANITIZER_NAMES = ['sanitize']\n/**\n * What --fix wraps a violation in and, if needed, imports. Decoupled from\n * sanitizerNames on purpose: sanitizerNames is about recognizing an\n * already-sanitized value during the *check*, or a project may list several\n * (a local wrapper included); autoImport is about what's safe to generate\n * during the *fix*, where only one answer can be written, and it must be a\n * real export of `source` or the fix produces broken code. Set to `false` to\n * report without offering a fix, for setups too custom to automate safely.\n */\nconst DEFAULT_AUTO_IMPORT: AutoImportConfig = {name: 'sanitize', source: 'unicode-shield'}\n/**\n * JSX attributes that render or expose their value as text (visibly, or to\n * assistive tech), the same class of sink as a JSX child. Deliberately\n * excludes event handlers (`onChange`), styling/behavior props\n * (`className`, `href`, `key`, `ref`), and anything else that isn't a text\n * sink, those would only produce false positives here.\n */\nconst DEFAULT_RISKY_ATTRIBUTES = ['alt', 'title', 'placeholder', 'aria-label', 'value']\n\nfunction matchesAnyExact(name: string, candidates: string[]): boolean {\n  const lower = name.toLowerCase()\n  return candidates.some(candidate => lower === candidate.toLowerCase())\n}\n\nfunction matchesAny(name: string, candidates: string[]): boolean {\n  const lower = name.toLowerCase()\n  return candidates.some(candidate => lower.includes(candidate.toLowerCase()))\n}\n\n/**\n * Optional chaining (`user?.bio`, `sanitize?.(x)`) wraps the whole chain in\n * a ChainExpression one level above the Identifier/MemberExpression/\n * CallExpression this rule actually looks for, so every shape check below\n * unwraps through it first. Without this, `{user?.bio}` isn't recognized as\n * risky at all (a real detection gap: optional chaining is exactly how\n * these fields are commonly accessed, precisely because they're optional),\n * and `const safe = sanitize?.(bio)` isn't recognized as already-sanitized\n * either.\n */\nfunction unwrapChainExpression(node: AstNode): AstNode {\n  return node.type === 'ChainExpression' && node.expression ? node.expression : node\n}\n\n/**\n * The risky name this expression would be reported under, or null if this\n * shape isn't one this rule analyzes. Only a bare identifier (`{username}`)\n * or a member access with a statically known property name (`{user.username}`\n * or `{user[\"username\"]}`), optionally chained, are considered; anything\n * else (a call, a template literal, a computed access with a non-literal\n * key) is left alone. This is a one-hop naming heuristic, not real\n * data-flow analysis.\n */\nfunction getRiskyName(rawNode: AstNode, riskyNames: string[]): string | null {\n  const node = unwrapChainExpression(rawNode)\n  if (node.type === 'Identifier') {\n    const name = getIdentifierName(node)\n    if (name !== null && matchesAny(name, riskyNames)) return name\n  }\n  if (node.type === 'MemberExpression') {\n    const propertyName = getMemberPropertyName(node)\n    if (propertyName !== null && matchesAny(propertyName, riskyNames)) {\n      return propertyName\n    }\n  }\n  return null\n}\n\nfunction isSanitizerCall(rawNode: AstNode | null | undefined, sanitizerNames: string[]): boolean {\n  if (!rawNode) return false\n  const node = unwrapChainExpression(rawNode)\n  if (node.type !== 'CallExpression' || !node.callee) return false\n  const callee = node.callee\n  if (callee.type === 'Identifier') {\n    const name = getIdentifierName(callee)\n    return name !== null && sanitizerNames.includes(name)\n  }\n  if (callee.type === 'MemberExpression') {\n    const propertyName = getMemberPropertyName(callee)\n    return propertyName !== null && sanitizerNames.includes(propertyName)\n  }\n  return false\n}\n\n/**\n * True when `identifier` was declared as `const x = sanitize(...)`. Only\n * chases the variable's own initializer (one hop): it doesn't follow\n * re-assignments or multi-step aliasing.\n */\nfunction isSanitizedVariable(\n  context: Rule.RuleContext,\n  identifier: AstNode,\n  sanitizerNames: string[],\n): boolean {\n  const scope = context.sourceCode.getScope(identifier as unknown as Rule.Node)\n  const reference = scope.references.find(ref => (ref.identifier as unknown as AstNode) === identifier)\n  const def = reference?.resolved?.defs[0]\n  if (!def || def.type !== 'Variable') return false\n  const declarator = def.node as unknown as AstNode\n  return isSanitizerCall(declarator.init, sanitizerNames)\n}\n\n/**\n * Where a JSXExpressionContainer sits determines whether this rule looks at\n * it at all, and which one determines the risky attribute name for\n * attribute positions. `null` means \"not a position this rule checks\".\n */\ntype CheckedPosition = {kind: 'child'} | {kind: 'attribute'; attributeName: string}\n\nfunction getCheckedPosition(node: AstNode, riskyAttributes: string[]): CheckedPosition | null {\n  const parent = node.parent\n  if (!parent) return null\n\n  if (parent.type === 'JSXElement' || parent.type === 'JSXFragment') {\n    return {kind: 'child'}\n  }\n\n  if (parent.type === 'JSXAttribute') {\n    const attributeName = getJsxAttributeName(parent)\n    if (attributeName !== null && matchesAnyExact(attributeName, riskyAttributes)) {\n      return {kind: 'attribute', attributeName}\n    }\n  }\n\n  return null\n}\n\n/**\n * What the fixer needs to do to bring autoImport's name into scope, decided\n * once per fix by walking the scope chain from the flagged expression's own\n * scope upward (not just checking module scope): a nearer function or block\n * scope can shadow autoImport.name with something unrelated (`var sanitize\n * = 5` inside the very function the violation is in), and JS lexical\n * scoping means that shadow, not a module-level import, is what a call at\n * that spot would actually run.\n * - already-imported: the nearest enclosing binding named autoImport.name\n *   is at module scope, and it's exactly the thing we'd otherwise import: a\n *   named (not default/namespace), non-type-only specifier importing\n *   exactly autoImport.name (not some other export aliased to this local\n *   name, `import {scan as sanitize}` doesn't count) from exactly\n *   autoImport.source. The fixer only needs to wrap the value.\n * - unsafe: the nearest enclosing binding named autoImport.name is\n *   anything else, at module scope (a different import, a local\n *   const/function/class, a default/namespace import, a type-only one, an\n *   aliased import of an unrelated export) or at any nearer scope at all\n *   (any binding there shadows a module-level import for every reference\n *   inside it); or there's no such binding anywhere but the file's\n *   sourceType isn't 'module' (inserting an ES `import` there is itself a\n *   SyntaxError). Every one of these is a real, confirmed way to produce\n *   unparseable or silently-wrong output: ESLint's own `--fix` has no\n *   safety net that rejects a fix producing broken output, it writes\n *   whatever `output` it computes, so no fix is offered here at all rather\n *   than risking any of these failure modes.\n * - add-specifier: no existing binding for autoImport.name anywhere, but an\n *   import from `source` exists with a named ({...}) block that isn't\n *   type-only; append the name there instead of creating a second import\n *   statement from the same source.\n * - add-declaration: no existing binding for autoImport.name anywhere, no\n *   usable value import from `source` to extend either (covers no import\n *   at all, a default/namespace-only import, and a type-only one), and the\n *   file's sourceType is 'module'. Inserts a fresh `import {name} from\n *   'source'`, after the last existing import if there is one, otherwise\n *   before the file's first statement.\n */\ntype ImportFixPlan =\n  | {kind: 'already-imported'}\n  | {kind: 'unsafe'}\n  | {kind: 'add-specifier'; lastSpecifier: AstNode}\n  | {kind: 'add-declaration'; afterImport: AstNode | null; beforeStatement: AstNode | null}\n\ninterface ScopeDefinition {\n  type: string\n  node: AstNode\n  parent?: AstNode | null\n}\n\ninterface ScopeLike {\n  type: string\n  variables: Array<{name: string; defs: ScopeDefinition[]}>\n  upper: ScopeLike | null\n  childScopes: ScopeLike[]\n}\n\nfunction isSanitizerImportBinding(definition: ScopeDefinition, autoImport: AutoImportConfig): boolean {\n  if (definition.type !== 'ImportBinding') return false\n  const specifier = definition.node\n  if (specifier.type !== 'ImportSpecifier' || specifier.importKind === 'type') return false\n  if (specifier.imported == null || getIdentifierName(specifier.imported) !== autoImport.name) return false\n  const declaration = definition.parent\n  return declaration != null && declaration.source?.value === autoImport.source && declaration.importKind !== 'type'\n}\n\n/** The nearest enclosing binding named autoImport.name, walking up from\n *  `startScope`, plus which scope it was found in (module scope is where a\n *  real import can live; anywhere nearer is a shadow). Null if nothing\n *  binds that name all the way up through module scope. */\nfunction findEnclosingBinding(\n  startScope: ScopeLike,\n  name: string,\n): {scope: ScopeLike; variable: {defs: ScopeDefinition[]}} | null {\n  let scope: ScopeLike | null = startScope\n  while (scope) {\n    const variable = scope.variables.find(candidate => candidate.name === name)\n    if (variable) return {scope, variable}\n    if (scope.type === 'module') return null\n    scope = scope.upper\n  }\n  return null\n}\n\nfunction planSanitizerImportFix(\n  context: Rule.RuleContext,\n  program: AstNode,\n  expression: AstNode,\n  autoImport: AutoImportConfig,\n): ImportFixPlan {\n  const globalScope = context.sourceCode.getScope(program as unknown as Rule.Node) as unknown as ScopeLike\n  const moduleScope = globalScope.childScopes.find(child => child.type === 'module') ?? globalScope\n  const expressionScope = context.sourceCode.getScope(expression as unknown as Rule.Node) as unknown as ScopeLike\n  const enclosing = findEnclosingBinding(expressionScope, autoImport.name)\n\n  if (enclosing) {\n    if (enclosing.scope !== moduleScope) return {kind: 'unsafe'}\n    const isExactSanitizerImport = enclosing.variable.defs.some(definition =>\n      isSanitizerImportBinding(definition, autoImport),\n    )\n    return isExactSanitizerImport ? {kind: 'already-imported'} : {kind: 'unsafe'}\n  }\n\n  const body = program.body ?? []\n  let lastImportDeclaration: AstNode | null = null\n  let lastNamedSpecifierFromSource: AstNode | null = null\n\n  for (const statement of body) {\n    if (statement.type !== 'ImportDeclaration') continue\n    lastImportDeclaration = statement\n    if (statement.source?.value !== autoImport.source || statement.importKind === 'type') continue\n\n    const namedSpecifiers = (statement.specifiers ?? []).filter(\n      specifier => specifier.type === 'ImportSpecifier' && specifier.importKind !== 'type',\n    )\n    if (namedSpecifiers.length > 0) {\n      lastNamedSpecifierFromSource = namedSpecifiers[namedSpecifiers.length - 1] ?? null\n    }\n  }\n\n  if (lastNamedSpecifierFromSource) {\n    return {kind: 'add-specifier', lastSpecifier: lastNamedSpecifierFromSource}\n  }\n  // No existing import to extend: about to insert a fresh `import`\n  // statement, which is itself a SyntaxError outside of sourceType\n  // 'module' (confirmed directly), so this is the one place that check\n  // matters, add-specifier only reaches here via an ImportDeclaration\n  // that already parsed, which is impossible under any other sourceType.\n  if (program.sourceType !== 'module') return {kind: 'unsafe'}\n  return {kind: 'add-declaration', afterImport: lastImportDeclaration, beforeStatement: body[0] ?? null}\n}\n\nconst VALID_IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/\n\n// Every ES2015+ reserved word and literal keyword: none of these can be used\n// as a plain identifier (an import specifier's local name, or a call\n// callee) in a module, which is always strict mode. `arguments` and `eval`\n// are deliberately included too: not reserved words technically, but\n// strict mode (which a module always is) forbids binding either as an\n// import/const-like name, confirmed directly rather than assumed.\nconst RESERVED_WORDS = new Set([\n  'arguments', 'await', 'break', 'case', 'catch', 'class', 'const', 'continue',\n  'debugger', 'default', 'delete', 'do', 'else', 'enum', 'eval', 'export',\n  'extends', 'false', 'finally', 'for', 'function', 'if', 'implements',\n  'import', 'in', 'instanceof', 'interface', 'let', 'new', 'null', 'package',\n  'private', 'protected', 'public', 'return', 'static', 'super', 'switch',\n  'this', 'throw', 'true', 'try', 'typeof', 'var', 'void', 'while', 'with',\n  'yield',\n])\n\n/**\n * Whether autoImport.name is safe to splice directly into generated code as\n * a bare identifier (both the call `name(...)` and the import specifier\n * `{name}`). Guards a config typo (a package-style `sanitize-text`, a\n * leading digit, an empty string, a reserved word) from producing an\n * autofix that inserts syntactically invalid JS. This matters because\n * nothing downstream catches it: ESLint's own `--fix` writes whatever\n * `output` it computes with no check that it still parses (confirmed\n * directly against `ESLint.outputFixes`, not assumed), so this check is the\n * only thing standing between a bad config value and a corrupted file.\n */\nfunction isSafeIdentifier(name: string): boolean {\n  return VALID_IDENTIFIER.test(name) && !RESERVED_WORDS.has(name)\n}\n\n/**\n * A single-quoted JS string literal for `value`, escaped by direct\n * construction (backslash first, so it can't double-escape the characters\n * the later replacements introduce) rather than by reusing\n * JSON.stringify's double-quoted output, so the generated import's module\n * specifier can't break out of its string even if it's an unusual one\n * (containing a quote or backslash, e.g. a Windows path someone configured).\n */\nfunction toSingleQuotedStringLiteral(value: string): string {\n  const escaped = value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\").replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r')\n  return `'${escaped}'`\n}\n\n/**\n * Wraps the flagged expression in a call to autoImport.name, plus whatever\n * import edit `plan` calls for. Both are returned as one fix array so\n * ESLint applies them atomically; when two violations in the same file both\n * need `add-declaration`, their combined ranges overlap (both touch the same\n * insertion point) and only one wins per pass, the other converges on\n * ESLint's next pass once the import already exists. That's standard\n * multi-pass --fix behavior, not something this rule needs to work around.\n * Returns null for `unsafe`: no fix at all is safer than one that collides\n * with an existing, unrelated binding of the same name.\n */\nfunction buildSanitizeFix(\n  context: Rule.RuleContext,\n  fixer: Rule.RuleFixer,\n  expression: AstNode,\n  plan: ImportFixPlan,\n  autoImport: AutoImportConfig,\n): Rule.Fix[] | null {\n  if (plan.kind === 'unsafe') return null\n\n  const expressionNode = expression as unknown as Rule.Node\n  const expressionText = context.sourceCode.getText(expressionNode)\n  const fixes = [fixer.replaceText(expressionNode, `${autoImport.name}(${expressionText})`)]\n\n  if (plan.kind === 'add-specifier') {\n    fixes.push(fixer.insertTextAfter(plan.lastSpecifier as unknown as Rule.Node, `, ${autoImport.name}`))\n  } else if (plan.kind === 'add-declaration') {\n    // The trailing `;` is deliberate even in a semicolon-free codebase: this\n    // statement's own end relies on ASI, and if what follows in the file\n    // happens to start with `<` (bare JSX used as a statement, or another\n    // JSX-leading line), acorn-jsx doesn't reliably insert a semicolon on\n    // its own there, an unterminated-import parse error results otherwise\n    // (confirmed directly against espree, not theoretical).\n    const importText = `import {${autoImport.name}} from ${toSingleQuotedStringLiteral(autoImport.source)};`\n    if (plan.afterImport) {\n      fixes.push(fixer.insertTextAfter(plan.afterImport as unknown as Rule.Node, `\\n${importText}`))\n    } else if (plan.beforeStatement) {\n      fixes.push(fixer.insertTextBefore(plan.beforeStatement as unknown as Rule.Node, `${importText}\\n\\n`))\n    }\n  }\n\n  return fixes\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    fixable: 'code',\n    docs: {\n      description:\n        \"Require identity-like text (usernames, handles, display names, bios) rendered as JSX content or passed to a text-rendering JSX attribute (alt, title, placeholder, aria-label, value) to be passed through unicode-shield's sanitize() first\",\n    },\n    schema: [\n      {\n        type: 'object',\n        properties: {\n          riskyNames: {type: 'array', items: {type: 'string'}},\n          riskyAttributes: {type: 'array', items: {type: 'string'}},\n          sanitizerNames: {type: 'array', items: {type: 'string'}},\n          autoImport: {\n            oneOf: [\n              {const: false},\n              {\n                type: 'object',\n                properties: {\n                  name: {type: 'string'},\n                  source: {type: 'string'},\n                },\n                required: ['name', 'source'],\n                additionalProperties: false,\n              },\n            ],\n          },\n        },\n        additionalProperties: false,\n      },\n    ],\n    messages: {\n      requireSanitize:\n        \"'{{name}}' looks like user-supplied text rendered without going through unicode-shield's sanitize(). If it can contain untrusted input, wrap it: sanitize({{name}}).\",\n      requireSanitizeAttribute:\n        \"'{{name}}' looks like user-supplied text passed to the '{{attribute}}' attribute without going through unicode-shield's sanitize(). If it can contain untrusted input, wrap it: sanitize({{name}}).\",\n    },\n  },\n  create(context) {\n    const options = (context.options[0] ?? {}) as RuleOptions\n    const riskyNames = options.riskyNames ?? DEFAULT_RISKY_NAMES\n    const riskyAttributes = options.riskyAttributes ?? DEFAULT_RISKY_ATTRIBUTES\n    const sanitizerNames = options.sanitizerNames ?? DEFAULT_SANITIZER_NAMES\n    const configuredAutoImport = options.autoImport === false ? null : (options.autoImport ?? DEFAULT_AUTO_IMPORT)\n    const autoImport = configuredAutoImport && isSafeIdentifier(configuredAutoImport.name) ? configuredAutoImport : null\n    const program = context.sourceCode.ast as unknown as AstNode\n\n    return {\n      JSXExpressionContainer(rawNode: unknown) {\n        const node = rawNode as AstNode\n        const position = getCheckedPosition(node, riskyAttributes)\n        if (!position) return\n\n        const expression = node.expression\n        if (!expression || expression.type === 'JSXEmptyExpression') return\n\n        const riskyName = getRiskyName(expression, riskyNames)\n        if (!riskyName) return\n\n        if (expression.type === 'Identifier' && isSanitizedVariable(context, expression, sanitizerNames)) {\n          return\n        }\n\n        const fix = autoImport\n          ? (fixer: Rule.RuleFixer) =>\n              buildSanitizeFix(\n                context,\n                fixer,\n                expression,\n                planSanitizerImportFix(context, program, expression, autoImport),\n                autoImport,\n              )\n          : undefined\n\n        if (position.kind === 'attribute') {\n          context.report({\n            node: expression as unknown as Rule.Node,\n            messageId: 'requireSanitizeAttribute',\n            data: {name: riskyName, attribute: position.attributeName},\n            fix,\n          })\n          return\n        }\n\n        context.report({\n          node: expression as unknown as Rule.Node,\n          messageId: 'requireSanitize',\n          data: {name: riskyName},\n          fix,\n        })\n      },\n    }\n  },\n}\n\nexport default rule\n","import requireSanitizedText from './rules/require-sanitized-text'\n\n/**\n * ESLint flat-config plugin. Usage:\n *\n *   import unicodeShield from 'unicode-shield/eslint-plugin'\n *\n *   export default [\n *     {\n *       plugins: {'unicode-shield': unicodeShield},\n *       rules: {'unicode-shield/require-sanitized-text': 'warn'},\n *     },\n *   ]\n */\nconst plugin = {\n  rules: {\n    'require-sanitized-text': requireSanitizedText,\n  },\n}\n\nexport default plugin\n"]}