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,EAAQ,YAEd,IACF,EAAQ,QAAU,EAAY,KAC9B,EAAQ,UAAY,EAAY,OAEpC,CAEA,EAAY,KAAK,EACnB,CACF,CAEA,OAAO,CACT,CAxRA,qBAAqB","file":"/npm/eslint-plugin-html@5.0.2/src/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/eslint-plugin-html@5.0.2/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\"\n\nconst path = require(\"path\")\nconst extract = require(\"./extract\")\nconst utils = require(\"./utils\")\nconst splatSet = utils.splatSet\nconst getSettings = require(\"./settings\").getSettings\n\nconst PREPARE_RULE_NAME = \"__eslint-plugin-html-prepare\"\nconst LINTER_ISPATCHED_PROPERTY_NAME =\n  \"__eslint-plugin-html-verify-function-is-patched\"\n\n// Disclaimer:\n//\n// This is not a long term viable solution. ESLint needs to improve its processor API to\n// provide access to the configuration before actually preprocess files, but it's not\n// planed yet. This solution is quite ugly but shouldn't alter eslint process.\n//\n// Related github issues:\n// https://github.com/eslint/eslint/issues/3422\n// https://github.com/eslint/eslint/issues/4153\n\nconst needle = path.join(\"lib\", \"linter.js\")\n\niterateESLintModules(patch)\n\nfunction getModuleFromRequire() {\n  return require(\"eslint/lib/linter\")\n}\n\nfunction getModuleFromCache(key) {\n  if (!key.endsWith(needle)) return\n\n  const module = require.cache[key]\n  if (!module || !module.exports) return\n\n  const Linter = module.exports\n  if (\n    typeof Linter === \"function\" &&\n    typeof Linter.prototype.verify === \"function\"\n  ) {\n    return Linter\n  }\n}\n\nfunction iterateESLintModules(fn) {\n  if (!require.cache || Object.keys(require.cache).length === 0) {\n    // Jest is replacing the node \"require\" function, and \"require.cache\" isn't available here.\n    fn(getModuleFromRequire())\n    return\n  }\n\n  let found = false\n\n  for (const key in require.cache) {\n    const Linter = getModuleFromCache(key)\n    if (Linter) {\n      fn(Linter)\n      found = true\n    }\n  }\n\n  if (!found) {\n    let eslintPath, eslintVersion\n    try {\n      eslintPath = require.resolve(\"eslint\")\n    } catch (e) {\n      eslintPath = \"(not found)\"\n    }\n    try {\n      eslintVersion = require(\"eslint/package.json\").version\n    } catch (e) {\n      eslintVersion = \"n/a\"\n    }\n\n    const parentPaths = module =>\n      module ? [module.filename].concat(parentPaths(module.parent)) : []\n\n    throw new Error(\n      `eslint-plugin-html error: It seems that eslint is not loaded.\nIf you think this is a bug, please file a report at https://github.com/BenoitZugmeyer/eslint-plugin-html/issues\n\nIn the report, please include *all* those informations:\n\n* ESLint version: ${eslintVersion}\n* ESLint path: ${eslintPath}\n* Plugin version: ${require(\"../package.json\").version}\n* Plugin inclusion paths: ${parentPaths(module).join(\", \")}\n* NodeJS version: ${process.version}\n* CLI arguments: ${JSON.stringify(process.argv)}\n* Content of your lock file (package-lock.json or yarn.lock) or the output of \\`npm list\\`\n* How did you run ESLint (via the command line? an editor plugin?)\n* The following stack trace:\n    ${new Error().stack.slice(10)}\n\n\n      `\n    )\n  }\n}\n\nfunction getMode(pluginSettings, filenameOrOptions) {\n  const filename =\n    typeof filenameOrOptions === \"object\"\n      ? filenameOrOptions.filename\n      : filenameOrOptions\n  const extension = path.extname(filename || \"\")\n\n  if (pluginSettings.htmlExtensions.indexOf(extension) >= 0) {\n    return \"html\"\n  }\n  if (pluginSettings.xmlExtensions.indexOf(extension) >= 0) {\n    return \"xml\"\n  }\n}\n\nfunction patch(Linter) {\n  const verify = Linter.prototype.verify\n\n  // ignore if verify function is already been patched sometime before\n  if (Linter[LINTER_ISPATCHED_PROPERTY_NAME] === true) {\n    return\n  }\n  Linter[LINTER_ISPATCHED_PROPERTY_NAME] = true\n  Linter.prototype.verify = function(\n    textOrSourceCode,\n    config,\n    filenameOrOptions,\n    saveState\n  ) {\n    const pluginSettings = getSettings(config.settings || {})\n    const mode = getMode(pluginSettings, filenameOrOptions)\n\n    if (!mode || typeof textOrSourceCode !== \"string\") {\n      return verify.call(\n        this,\n        textOrSourceCode,\n        config,\n        filenameOrOptions,\n        saveState\n      )\n    }\n    const extractResult = extract(\n      textOrSourceCode,\n      pluginSettings.indent,\n      mode === \"xml\",\n      pluginSettings.isJavaScriptMIMEType\n    )\n\n    const messages = []\n\n    if (pluginSettings.reportBadIndent) {\n      messages.push(\n        ...extractResult.badIndentationLines.map(line => ({\n          message: \"Bad line indentation.\",\n          line,\n          column: 1,\n          ruleId: \"(html plugin)\",\n          severity: pluginSettings.reportBadIndent,\n        }))\n      )\n    }\n\n    // Save code parts parsed source code so we don't have to parse it twice\n    const sourceCodes = new WeakMap()\n    const verifyCodePart = (codePart, { prepare, ignoreRules } = {}) => {\n      this.defineRule(PREPARE_RULE_NAME, context => {\n        sourceCodes.set(codePart, context.getSourceCode())\n        return {\n          Program() {\n            if (prepare) {\n              prepare(context)\n            }\n          },\n        }\n      })\n\n      const localMessages = verify.call(\n        this,\n        sourceCodes.get(codePart) || String(codePart),\n        Object.assign({}, config, {\n          rules: Object.assign(\n            { [PREPARE_RULE_NAME]: \"error\" },\n            !ignoreRules && config.rules\n          ),\n        }),\n        ignoreRules && typeof filenameOrOptions === \"object\"\n          ? Object.assign({}, filenameOrOptions, {\n              reportUnusedDisableDirectives: false,\n            })\n          : filenameOrOptions,\n        saveState\n      )\n\n      messages.push(\n        ...remapMessages(localMessages, extractResult.hasBOM, codePart)\n      )\n    }\n\n    if (config.parserOptions && config.parserOptions.sourceType === \"module\") {\n      for (const codePart of extractResult.code) {\n        verifyCodePart(codePart)\n      }\n    } else {\n      verifyWithSharedScopes(extractResult.code, verifyCodePart)\n    }\n\n    messages.sort((ma, mb) => ma.line - mb.line || ma.column - mb.column)\n\n    return messages\n  }\n}\n\nfunction verifyWithSharedScopes(codeParts, verifyCodePart) {\n  // First pass: collect needed globals and declared globals for each script tags.\n  const firstPassValues = []\n\n  for (const codePart of codeParts) {\n    verifyCodePart(codePart, {\n      prepare(context) {\n        firstPassValues.push({\n          codePart,\n          exportedGlobals: context\n            .getScope()\n            .through.map(node => node.identifier.name),\n          declaredGlobals: context\n            .getScope()\n            .variables.map(variable => variable.name),\n        })\n      },\n      ignoreRules: true,\n    })\n  }\n\n  // Second pass: declare variables for each script scope, then run eslint.\n  for (let i = 0; i < firstPassValues.length; i += 1) {\n    verifyCodePart(firstPassValues[i].codePart, {\n      prepare(context) {\n        const exportedGlobals = splatSet(\n          firstPassValues\n            .slice(i + 1)\n            .map(nextValues => nextValues.exportedGlobals)\n        )\n        for (const name of exportedGlobals) context.markVariableAsUsed(name)\n\n        const declaredGlobals = splatSet(\n          firstPassValues\n            .slice(0, i)\n            .map(previousValues => previousValues.declaredGlobals)\n        )\n        const scope = context.getScope()\n        scope.through = scope.through.filter(variable => {\n          return !declaredGlobals.has(variable.identifier.name)\n        })\n      },\n    })\n  }\n}\n\nfunction remapMessages(messages, hasBOM, codePart) {\n  const newMessages = []\n  const bomOffset = hasBOM ? -1 : 0\n\n  for (const message of messages) {\n    const location = codePart.originalLocation({\n      line: message.line,\n      // eslint-plugin-eslint-comments is raising message with column=0 to bypass ESLint ignore\n      // comments. Since messages are already ignored at this time, just reset the column to a valid\n      // number. See https://github.com/BenoitZugmeyer/eslint-plugin-html/issues/70\n      column: message.column || 1,\n    })\n\n    // Ignore messages if they were in transformed code\n    if (location) {\n      Object.assign(message, location)\n      message.source = codePart.getOriginalLine(location.line)\n\n      // Map fix range\n      if (message.fix && message.fix.range) {\n        message.fix.range = [\n          codePart.originalIndex(message.fix.range[0]) + bomOffset,\n          // The range end is exclusive, meaning it should replace all characters  with indexes from\n          // start to end - 1. We have to get the original index of the last targeted character.\n          codePart.originalIndex(message.fix.range[1] - 1) + 1 + bomOffset,\n        ]\n      }\n\n      // Map end location\n      if (message.endLine && message.endColumn) {\n        const endLocation = codePart.originalLocation({\n          line: message.endLine,\n          column: message.endColumn,\n        })\n        if (endLocation) {\n          message.endLine = endLocation.line\n          message.endColumn = endLocation.column\n        }\n      }\n\n      newMessages.push(message)\n    }\n  }\n\n  return newMessages\n}\n"]}