astexplorer.app
Version:
https://astexplorer.net with ES Modules support and Hot Reloading
1 lines • 6.64 MB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[8,30],{"./node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs":function(module,exports,__webpack_require__){"use strict";eval('/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \'__esModule\', { value: true });\n\nvar util = __webpack_require__("./node_modules/util/util.js");\nvar path = __webpack_require__("./node_modules/path-browserify/index.js");\nvar Ajv = __webpack_require__("./node_modules/@eslint/eslintrc/node_modules/ajv/lib/ajv.js");\nvar globals = __webpack_require__("./node_modules/@eslint/eslintrc/node_modules/globals/index.js");\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === \'object\' && \'default\' in e ? e : { \'default\': e }; }\n\nvar util__default = /*#__PURE__*/_interopDefaultLegacy(util);\nvar path__default = /*#__PURE__*/_interopDefaultLegacy(path);\nvar Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv);\nvar globals__default = /*#__PURE__*/_interopDefaultLegacy(globals);\n\n/**\n * @fileoverview Config file operations. This file must be usable in the browser,\n * so no Node-specific code can be here.\n * @author Nicholas C. Zakas\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\nconst RULE_SEVERITY_STRINGS = ["off", "warn", "error"],\n RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {\n map[value] = index;\n return map;\n }, {}),\n VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"];\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Normalizes the severity value of a rule\'s configuration to a number\n * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule\'s configuration value, generally\n * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0),\n * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array\n * whose first element is one of the above values. Strings are matched case-insensitively.\n * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.\n */\nfunction getRuleSeverity(ruleConfig) {\n const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (severityValue === 0 || severityValue === 1 || severityValue === 2) {\n return severityValue;\n }\n\n if (typeof severityValue === "string") {\n return RULE_SEVERITY[severityValue.toLowerCase()] || 0;\n }\n\n return 0;\n}\n\n/**\n * Converts old-style severity settings (0, 1, 2) into new-style\n * severity settings (off, warn, error) for all rules. Assumption is that severity\n * values have already been validated as correct.\n * @param {Object} config The config object to normalize.\n * @returns {void}\n */\nfunction normalizeToStrings(config) {\n\n if (config.rules) {\n Object.keys(config.rules).forEach(ruleId => {\n const ruleConfig = config.rules[ruleId];\n\n if (typeof ruleConfig === "number") {\n config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];\n } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {\n ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];\n }\n });\n }\n}\n\n/**\n * Determines if the severity for the given rule configuration represents an error.\n * @param {int|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} True if the rule represents an error, false if not.\n */\nfunction isErrorSeverity(ruleConfig) {\n return getRuleSeverity(ruleConfig) === 2;\n}\n\n/**\n * Checks whether a given config has valid severity or not.\n * @param {number|string|Array} ruleConfig The configuration for an individual rule.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isValidSeverity(ruleConfig) {\n let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;\n\n if (typeof severity === "string") {\n severity = severity.toLowerCase();\n }\n return VALID_SEVERITIES.indexOf(severity) !== -1;\n}\n\n/**\n * Checks whether every rule of a given config has valid severity or not.\n * @param {Object} config The configuration for rules.\n * @returns {boolean} `true` if the configuration has valid severity.\n */\nfunction isEverySeverityValid(config) {\n return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));\n}\n\n/**\n * Normalizes a value for a global in a config\n * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in\n * a global directive comment\n * @returns {("readable"|"writeable"|"off")} The value normalized as a string\n * @throws Error if global value is invalid\n */\nfunction normalizeConfigGlobal(configuredValue) {\n switch (configuredValue) {\n case "off":\n return "off";\n\n case true:\n case "true":\n case "writeable":\n case "writable":\n return "writable";\n\n case null:\n case false:\n case "false":\n case "readable":\n case "readonly":\n return "readonly";\n\n default:\n throw new Error(`\'${configuredValue}\' is not a valid configuration for a global (use \'readonly\', \'writable\', or \'off\')`);\n }\n}\n\nvar ConfigOps = {\n __proto__: null,\n getRuleSeverity: getRuleSeverity,\n normalizeToStrings: normalizeToStrings,\n isErrorSeverity: isErrorSeverity,\n isValidSeverity: isValidSeverity,\n isEverySeverityValid: isEverySeverityValid,\n normalizeConfigGlobal: normalizeConfigGlobal\n};\n\n/**\n * @fileoverview Provide the function that emits deprecation warnings.\n * @author Toru Nagashima <http://github.com/mysticatea>\n */\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\n\n// Defitions for deprecation warnings.\nconst deprecationWarningMessages = {\n ESLINT_LEGACY_ECMAFEATURES:\n "The \'ecmaFeatures\' config file property is deprecated and has no effect.",\n ESLINT_PERSONAL_CONFIG_LOAD:\n "\'~/.eslintrc.*\' config files have been deprecated. " +\n "Please use a config file per project or the \'--config\' option.",\n ESLINT_PERSONAL_CONFIG_SUPPRESS:\n "\'~/.eslintrc.*\' config files have been deprecated. " +\n "Please remove it or add \'root:true\' to the config files in your " +\n "projects in order to avoid loading \'~/.eslintrc.*\' accidentally."\n};\n\nconst sourceFileErrorCache = new Set();\n\n/**\n * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted\n * for each unique file path, but repeated invocations with the same file path have no effect.\n * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.\n * @param {string} source The name of the configuration source to report the warning for.\n * @param {string} errorCode The warning message to show.\n * @returns {void}\n */\nfunction emitDeprecationWarning(source, errorCode) {\n const cacheKey = JSON.stringify({ source, errorCode });\n\n if (sourceFileErrorCache.has(cacheKey)) {\n return;\n }\n sourceFileErrorCache.add(cacheKey);\n\n const rel = path__default["default"].relative(process.cwd(), source);\n const message = deprecationWarningMessages[errorCode];\n\n process.emitWarning(\n `${message} (found in "${rel}")`,\n "DeprecationWarning",\n errorCode\n );\n}\n\n/**\n * @fileoverview The instance of Ajv validator.\n * @author Evgeny Poberezkin\n */\n\n//-----------------------------------------------------------------------------\n// Helpers\n//-----------------------------------------------------------------------------\n\n/*\n * Copied from ajv/lib/refs/json-schema-draft-04.json\n * The MIT License (MIT)\n * Copyright (c) 2015-2017 Evgeny Poberezkin\n */\nconst metaSchema = {\n id: "http://json-schema.org/draft-04/schema#",\n $schema: "http://json-schema.org/draft-04/schema#",\n description: "Core schema meta-schema",\n definitions: {\n schemaArray: {\n type: "array",\n minItems: 1,\n items: { $ref: "#" }\n },\n positiveInteger: {\n type: "integer",\n minimum: 0\n },\n positiveIntegerDefault0: {\n allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }]\n },\n simpleTypes: {\n enum: ["array", "boolean", "integer", "null", "number", "object", "string"]\n },\n stringArray: {\n type: "array",\n items: { type: "string" },\n minItems: 1,\n uniqueItems: true\n }\n },\n type: "object",\n properties: {\n id: {\n type: "string"\n },\n $schema: {\n type: "string"\n },\n title: {\n type: "string"\n },\n description: {\n type: "string"\n },\n default: { },\n multipleOf: {\n type: "number",\n minimum: 0,\n exclusiveMinimum: true\n },\n maximum: {\n type: "number"\n },\n exclusiveMaximum: {\n type: "boolean",\n default: false\n },\n minimum: {\n type: "number"\n },\n exclusiveMinimum: {\n type: "boolean",\n default: false\n },\n maxLength: { $ref: "#/definitions/positiveInteger" },\n minLength: { $ref: "#/definitions/positiveIntegerDefault0" },\n pattern: {\n type: "string",\n format: "regex"\n },\n additionalItems: {\n anyOf: [\n { type: "boolean" },\n { $ref: "#" }\n ],\n default: { }\n },\n items: {\n anyOf: [\n { $ref: "#" },\n { $ref: "#/definitions/schemaArray" }\n ],\n default: { }\n },\n maxItems: { $ref: "#/definitions/positiveInteger" },\n minItems: { $ref: "#/definitions/positiveIntegerDefault0" },\n uniqueItems: {\n type: "boolean",\n default: false\n },\n maxProperties: { $ref: "#/definitions/positiveInteger" },\n minProperties: { $ref: "#/definitions/positiveIntegerDefault0" },\n required: { $ref: "#/definitions/stringArray" },\n additionalProperties: {\n anyOf: [\n { type: "boolean" },\n { $ref: "#" }\n ],\n default: { }\n },\n definitions: {\n type: "object",\n additionalProperties: { $ref: "#" },\n default: { }\n },\n properties: {\n type: "object",\n additionalProperties: { $ref: "#" },\n default: { }\n },\n patternProperties: {\n type: "object",\n additionalProperties: { $ref: "#" },\n default: { }\n },\n dependencies: {\n type: "object",\n additionalProperties: {\n anyOf: [\n { $ref: "#" },\n { $ref: "#/definitions/stringArray" }\n ]\n }\n },\n enum: {\n type: "array",\n minItems: 1,\n uniqueItems: true\n },\n type: {\n anyOf: [\n { $ref: "#/definitions/simpleTypes" },\n {\n type: "array",\n items: { $ref: "#/definitions/simpleTypes" },\n minItems: 1,\n uniqueItems: true\n }\n ]\n },\n format: { type: "string" },\n allOf: { $ref: "#/definitions/schemaArray" },\n anyOf: { $ref: "#/definitions/schemaArray" },\n oneOf: { $ref: "#/definitions/schemaArray" },\n not: { $ref: "#" }\n },\n dependencies: {\n exclusiveMaximum: ["maximum"],\n exclusiveMinimum: ["minimum"]\n },\n default: { }\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nvar ajvOrig = (additionalOptions = {}) => {\n const ajv = new Ajv__default["default"]({\n meta: false,\n useDefaults: true,\n validateSchema: false,\n missingRefs: "ignore",\n verbose: true,\n schemaId: "auto",\n ...additionalOptions\n });\n\n ajv.addMetaSchema(metaSchema);\n // eslint-disable-next-line no-underscore-dangle\n ajv._opts.defaultMeta = metaSchema.id;\n\n return ajv;\n};\n\n/**\n * @fileoverview Defines a schema for configs.\n * @author Sylvan Mably\n */\n\nconst baseConfigProperties = {\n $schema: { type: "string" },\n env: { type: "object" },\n extends: { $ref: "#/definitions/stringOrStrings" },\n globals: { type: "object" },\n overrides: {\n type: "array",\n items: { $ref: "#/definitions/overrideConfig" },\n additionalItems: false\n },\n parser: { type: ["string", "null"] },\n parserOptions: { type: "object" },\n plugins: { type: "array" },\n processor: { type: "string" },\n rules: { type: "object" },\n settings: { type: "object" },\n noInlineConfig: { type: "boolean" },\n reportUnusedDisableDirectives: { type: "boolean" },\n\n ecmaFeatures: { type: "object" } // deprecated; logs a warning when used\n};\n\nconst configSchema = {\n definitions: {\n stringOrStrings: {\n oneOf: [\n { type: "string" },\n {\n type: "array",\n items: { type: "string" },\n additionalItems: false\n }\n ]\n },\n stringOrStringsRequired: {\n oneOf: [\n { type: "string" },\n {\n type: "array",\n items: { type: "string" },\n additionalItems: false,\n minItems: 1\n }\n ]\n },\n\n // Config at top-level.\n objectConfig: {\n type: "object",\n properties: {\n root: { type: "boolean" },\n ignorePatterns: { $ref: "#/definitions/stringOrStrings" },\n ...baseConfigProperties\n },\n additionalProperties: false\n },\n\n // Config in `overrides`.\n overrideConfig: {\n type: "object",\n properties: {\n excludedFiles: { $ref: "#/definitions/stringOrStrings" },\n files: { $ref: "#/definitions/stringOrStringsRequired" },\n ...baseConfigProperties\n },\n required: ["files"],\n additionalProperties: false\n }\n },\n\n $ref: "#/definitions/objectConfig"\n};\n\n/**\n * @fileoverview Defines environment settings and globals.\n * @author Elan Shanker\n */\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Get the object that has difference.\n * @param {Record<string,boolean>} current The newer object.\n * @param {Record<string,boolean>} prev The older object.\n * @returns {Record<string,boolean>} The difference object.\n */\nfunction getDiff(current, prev) {\n const retv = {};\n\n for (const [key, value] of Object.entries(current)) {\n if (!Object.hasOwnProperty.call(prev, key)) {\n retv[key] = value;\n }\n }\n\n return retv;\n}\n\nconst newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ...\nconst newGlobals2017 = {\n Atomics: false,\n SharedArrayBuffer: false\n};\nconst newGlobals2020 = {\n BigInt: false,\n BigInt64Array: false,\n BigUint64Array: false,\n globalThis: false\n};\n\nconst newGlobals2021 = {\n AggregateError: false,\n FinalizationRegistry: false,\n WeakRef: false\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/** @type {Map<string, import("../lib/shared/types").Environment>} */\nvar environments = new Map(Object.entries({\n\n // Language\n builtin: {\n globals: globals__default["default"].es5\n },\n es6: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2015: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 6\n }\n },\n es2016: {\n globals: newGlobals2015,\n parserOptions: {\n ecmaVersion: 7\n }\n },\n es2017: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 8\n }\n },\n es2018: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 9\n }\n },\n es2019: {\n globals: { ...newGlobals2015, ...newGlobals2017 },\n parserOptions: {\n ecmaVersion: 10\n }\n },\n es2020: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },\n parserOptions: {\n ecmaVersion: 11\n }\n },\n es2021: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 12\n }\n },\n es2022: {\n globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },\n parserOptions: {\n ecmaVersion: 13\n }\n },\n\n // Platforms\n browser: {\n globals: globals__default["default"].browser\n },\n node: {\n globals: globals__default["default"].node,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n "shared-node-browser": {\n globals: globals__default["default"]["shared-node-browser"]\n },\n worker: {\n globals: globals__default["default"].worker\n },\n serviceworker: {\n globals: globals__default["default"].serviceworker\n },\n\n // Frameworks\n commonjs: {\n globals: globals__default["default"].commonjs,\n parserOptions: {\n ecmaFeatures: {\n globalReturn: true\n }\n }\n },\n amd: {\n globals: globals__default["default"].amd\n },\n mocha: {\n globals: globals__default["default"].mocha\n },\n jasmine: {\n globals: globals__default["default"].jasmine\n },\n jest: {\n globals: globals__default["default"].jest\n },\n phantomjs: {\n globals: globals__default["default"].phantomjs\n },\n jquery: {\n globals: globals__default["default"].jquery\n },\n qunit: {\n globals: globals__default["default"].qunit\n },\n prototypejs: {\n globals: globals__default["default"].prototypejs\n },\n shelljs: {\n globals: globals__default["default"].shelljs\n },\n meteor: {\n globals: globals__default["default"].meteor\n },\n mongo: {\n globals: globals__default["default"].mongo\n },\n protractor: {\n globals: globals__default["default"].protractor\n },\n applescript: {\n globals: globals__default["default"].applescript\n },\n nashorn: {\n globals: globals__default["default"].nashorn\n },\n atomtest: {\n globals: globals__default["default"].atomtest\n },\n embertest: {\n globals: globals__default["default"].embertest\n },\n webextensions: {\n globals: globals__default["default"].webextensions\n },\n greasemonkey: {\n globals: globals__default["default"].greasemonkey\n }\n}));\n\n/**\n * @fileoverview Validates configs.\n * @author Brandon Mills\n */\n\nconst ajv = ajvOrig();\n\nconst ruleValidators = new WeakMap();\nconst noop = Function.prototype;\n\n//------------------------------------------------------------------------------\n// Private\n//------------------------------------------------------------------------------\nlet validateSchema;\nconst severityMap = {\n error: 2,\n warn: 1,\n off: 0\n};\n\nconst validated = new WeakSet();\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nclass ConfigValidator {\n constructor({ builtInRules = new Map() } = {}) {\n this.builtInRules = builtInRules;\n }\n\n /**\n * Gets a complete options schema for a rule.\n * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object\n * @returns {Object} JSON Schema for the rule\'s options.\n */\n getRuleOptionsSchema(rule) {\n if (!rule) {\n return null;\n }\n\n const schema = rule.schema || rule.meta && rule.meta.schema;\n\n // Given a tuple of schemas, insert warning level at the beginning\n if (Array.isArray(schema)) {\n if (schema.length) {\n return {\n type: "array",\n items: schema,\n minItems: 0,\n maxItems: schema.length\n };\n }\n return {\n type: "array",\n minItems: 0,\n maxItems: 0\n };\n\n }\n\n // Given a full schema, leave it alone\n return schema || null;\n }\n\n /**\n * Validates a rule\'s severity and returns the severity value. Throws an error if the severity is invalid.\n * @param {options} options The given options for the rule.\n * @returns {number|string} The rule\'s severity value\n */\n validateRuleSeverity(options) {\n const severity = Array.isArray(options) ? options[0] : options;\n const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity;\n\n if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {\n return normSeverity;\n }\n\n throw new Error(`\\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed \'${util__default["default"].inspect(severity).replace(/\'/gu, "\\"").replace(/\\n/gu, "")}\').\\n`);\n\n }\n\n /**\n * Validates the non-severity options passed to a rule, based on its schema.\n * @param {{create: Function}} rule The rule to validate\n * @param {Array} localOptions The options for the rule, excluding severity\n * @returns {void}\n */\n validateRuleSchema(rule, localOptions) {\n if (!ruleValidators.has(rule)) {\n const schema = this.getRuleOptionsSchema(rule);\n\n if (schema) {\n ruleValidators.set(rule, ajv.compile(schema));\n }\n }\n\n const validateRule = ruleValidators.get(rule);\n\n if (validateRule) {\n validateRule(localOptions);\n if (validateRule.errors) {\n throw new Error(validateRule.errors.map(\n error => `\\tValue ${JSON.stringify(error.data)} ${error.message}.\\n`\n ).join(""));\n }\n }\n }\n\n /**\n * Validates a rule\'s options against its schema.\n * @param {{create: Function}|null} rule The rule that the config is being validated for\n * @param {string} ruleId The rule\'s unique name.\n * @param {Array|number} options The given options for the rule.\n * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,\n * no source is prepended to the message.\n * @returns {void}\n */\n validateRuleOptions(rule, ruleId, options, source = null) {\n try {\n const severity = this.validateRuleSeverity(options);\n\n if (severity !== 0) {\n this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);\n }\n } catch (err) {\n const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\\n${err.message}`;\n\n if (typeof source === "string") {\n throw new Error(`${source}:\\n\\t${enhancedMessage}`);\n } else {\n throw new Error(enhancedMessage);\n }\n }\n }\n\n /**\n * Validates an environment object\n * @param {Object} environment The environment config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.\n * @returns {void}\n */\n validateEnvironment(\n environment,\n source,\n getAdditionalEnv = noop\n ) {\n\n // not having an environment is ok\n if (!environment) {\n return;\n }\n\n Object.keys(environment).forEach(id => {\n const env = getAdditionalEnv(id) || environments.get(id) || null;\n\n if (!env) {\n const message = `${source}:\\n\\tEnvironment key "${id}" is unknown\\n`;\n\n throw new Error(message);\n }\n });\n }\n\n /**\n * Validates a rules config object\n * @param {Object} rulesConfig The rules config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules\n * @returns {void}\n */\n validateRules(\n rulesConfig,\n source,\n getAdditionalRule = noop\n ) {\n if (!rulesConfig) {\n return;\n }\n\n Object.keys(rulesConfig).forEach(id => {\n const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;\n\n this.validateRuleOptions(rule, id, rulesConfig[id], source);\n });\n }\n\n /**\n * Validates a `globals` section of a config file\n * @param {Object} globalsConfig The `globals` section\n * @param {string|null} source The name of the configuration source to report in the event of an error.\n * @returns {void}\n */\n validateGlobals(globalsConfig, source = null) {\n if (!globalsConfig) {\n return;\n }\n\n Object.entries(globalsConfig)\n .forEach(([configuredGlobal, configuredValue]) => {\n try {\n normalizeConfigGlobal(configuredValue);\n } catch (err) {\n throw new Error(`ESLint configuration of global \'${configuredGlobal}\' in ${source} is invalid:\\n${err.message}`);\n }\n });\n }\n\n /**\n * Validate `processor` configuration.\n * @param {string|undefined} processorName The processor name.\n * @param {string} source The name of config file.\n * @param {function(id:string): Processor} getProcessor The getter of defined processors.\n * @returns {void}\n */\n validateProcessor(processorName, source, getProcessor) {\n if (processorName && !getProcessor(processorName)) {\n throw new Error(`ESLint configuration of processor in \'${source}\' is invalid: \'${processorName}\' was not found.`);\n }\n }\n\n /**\n * Formats an array of schema validation errors.\n * @param {Array} errors An array of error messages to format.\n * @returns {string} Formatted error message\n */\n formatErrors(errors) {\n return errors.map(error => {\n if (error.keyword === "additionalProperties") {\n const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;\n\n return `Unexpected top-level property "${formattedPropertyPath}"`;\n }\n if (error.keyword === "type") {\n const formattedField = error.dataPath.slice(1);\n const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema;\n const formattedValue = JSON.stringify(error.data);\n\n return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \\`${formattedValue}\\`)`;\n }\n\n const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;\n\n return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;\n }).map(message => `\\t- ${message}.\\n`).join("");\n }\n\n /**\n * Validates the top level properties of the config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @returns {void}\n */\n validateConfigSchema(config, source = null) {\n validateSchema = validateSchema || ajv.compile(configSchema);\n\n if (!validateSchema(config)) {\n throw new Error(`ESLint configuration in ${source} is invalid:\\n${this.formatErrors(validateSchema.errors)}`);\n }\n\n if (Object.hasOwnProperty.call(config, "ecmaFeatures")) {\n emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES");\n }\n }\n\n /**\n * Validates an entire config object.\n * @param {Object} config The config object to validate.\n * @param {string} source The name of the configuration source to report in any errors.\n * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.\n * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.\n * @returns {void}\n */\n validate(config, source, getAdditionalRule, getAdditionalEnv) {\n this.validateConfigSchema(config, source);\n this.validateRules(config.rules, source, getAdditionalRule);\n this.validateEnvironment(config.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n\n for (const override of config.overrides || []) {\n this.validateRules(override.rules, source, getAdditionalRule);\n this.validateEnvironment(override.env, source, getAdditionalEnv);\n this.validateGlobals(config.globals, source);\n }\n }\n\n /**\n * Validate config array object.\n * @param {ConfigArray} configArray The config array to validate.\n * @returns {void}\n */\n validateConfigArray(configArray) {\n const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);\n const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);\n const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);\n\n // Validate.\n for (const element of configArray) {\n if (validated.has(element)) {\n continue;\n }\n validated.add(element);\n\n this.validateEnvironment(element.env, element.name, getPluginEnv);\n this.validateGlobals(element.globals, element.name);\n this.validateProcessor(element.processor, element.name, getPluginProcessor);\n this.validateRules(element.rules, element.name, getPluginRule);\n }\n }\n\n}\n\n/**\n * @fileoverview Common helpers for naming of plugins, formatters and configs\n */\n\nconst NAMESPACE_REGEX = /^@.*\\//iu;\n\n/**\n * Brings package name to correct format based on prefix\n * @param {string} name The name of the package.\n * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter"\n * @returns {string} Normalized name of the package\n * @private\n */\nfunction normalizePackageName(name, prefix) {\n let normalizedName = name;\n\n /**\n * On Windows, name can come in with Windows slashes instead of Unix slashes.\n * Normalize to Unix first to avoid errors later on.\n * https://github.com/eslint/eslint/issues/5644\n */\n if (normalizedName.includes("\\\\")) {\n normalizedName = normalizedName.replace(/\\\\/gu, "/");\n }\n\n if (normalizedName.charAt(0) === "@") {\n\n /**\n * it\'s a scoped package\n * package name is the prefix, or just a username\n */\n const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"),\n scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u");\n\n if (scopedPackageShortcutRegex.test(normalizedName)) {\n normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);\n } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) {\n\n /**\n * for scoped packages, insert the prefix after the first / unless\n * the path is already @scope/eslint or @scope/eslint-xxx-yyy\n */\n normalizedName = normalizedName.replace(/^@([^/]+)\\/(.*)$/u, `@$1/${prefix}-$2`);\n }\n } else if (!normalizedName.startsWith(`${prefix}-`)) {\n normalizedName = `${prefix}-${normalizedName}`;\n }\n\n return normalizedName;\n}\n\n/**\n * Removes the prefix from a fullname.\n * @param {string} fullname The term which may have the prefix.\n * @param {string} prefix The prefix to remove.\n * @returns {string} The term without prefix.\n */\nfunction getShorthandName(fullname, prefix) {\n if (fullname[0] === "@") {\n let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname);\n\n if (matchResult) {\n return matchResult[1];\n }\n\n matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname);\n if (matchResult) {\n return `${matchResult[1]}/${matchResult[2]}`;\n }\n } else if (fullname.startsWith(`${prefix}-`)) {\n return fullname.slice(prefix.length + 1);\n }\n\n return fullname;\n}\n\n/**\n * Gets the scope (namespace) of a term.\n * @param {string} term The term which may have the namespace.\n * @returns {string} The namespace of the term if it has one.\n */\nfunction getNamespaceFromTerm(term) {\n const match = term.match(NAMESPACE_REGEX);\n\n return match ? match[0] : "";\n}\n\nvar naming = {\n __proto__: null,\n normalizePackageName: normalizePackageName,\n getShorthandName: getShorthandName,\n getNamespaceFromTerm: getNamespaceFromTerm\n};\n\n/**\n * @fileoverview Package exports for @eslint/eslintrc\n * @author Nicholas C. Zakas\n */\n\n//-----------------------------------------------------------------------------\n// Exports\n//-----------------------------------------------------------------------------\n\nconst Legacy = {\n environments,\n\n // shared\n ConfigOps,\n ConfigValidator,\n naming\n};\n\nexports.Legacy = Legacy;\n//# sourceMappingURL=eslintrc-universal.cjs.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("./node_modules/process/browser.js")))\n\n//# sourceURL=webpack:///./node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs?')},"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/ajv.js":function(module,exports,__webpack_require__){"use strict";eval("\n\nvar compileSchema = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/compile/index.js\")\n , resolve = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/compile/resolve.js\")\n , Cache = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/cache.js\")\n , SchemaObject = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/compile/schema_obj.js\")\n , stableStringify = __webpack_require__(\"./node_modules/fast-json-stable-stringify/index.js\")\n , formats = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/compile/formats.js\")\n , rules = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/compile/rules.js\")\n , $dataMetaSchema = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/data.js\")\n , util = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/compile/util.js\");\n\nmodule.exports = Ajv;\n\nAjv.prototype.validate = validate;\nAjv.prototype.compile = compile;\nAjv.prototype.addSchema = addSchema;\nAjv.prototype.addMetaSchema = addMetaSchema;\nAjv.prototype.validateSchema = validateSchema;\nAjv.prototype.getSchema = getSchema;\nAjv.prototype.removeSchema = removeSchema;\nAjv.prototype.addFormat = addFormat;\nAjv.prototype.errorsText = errorsText;\n\nAjv.prototype._addSchema = _addSchema;\nAjv.prototype._compile = _compile;\n\nAjv.prototype.compileAsync = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/compile/async.js\");\nvar customKeyword = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/keyword.js\");\nAjv.prototype.addKeyword = customKeyword.add;\nAjv.prototype.getKeyword = customKeyword.get;\nAjv.prototype.removeKeyword = customKeyword.remove;\nAjv.prototype.validateKeyword = customKeyword.validate;\n\nvar errorClasses = __webpack_require__(\"./node_modules/@eslint/eslintrc/node_modules/ajv/lib/compile/error_classes.js\");\nAjv.ValidationError = errorClasses.Validation;\nAjv.MissingRefError = errorClasses.MissingRef;\nAjv.$dataMetaSchema = $dataMetaSchema;\n\nvar META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';\n\nvar META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ];\nvar META_SUPPORT_DATA = ['/properties'];\n\n/**\n * Creates validator instance.\n * Usage: `Ajv(opts)`\n * @param {Object} opts optional options\n * @return {Object} ajv instance\n */\nfunction Ajv(opts) {\n if (!(this instanceof Ajv)) return new Ajv(opts);\n opts = this._opts = util.copy(opts) || {};\n setLogger(this);\n this._schemas = {};\n this._refs = {};\n this._fragments = {};\n this._formats = formats(opts.format);\n\n this._cache = opts.cache || new Cache;\n this._loadingSchemas = {};\n this._compilations = [];\n this.RULES = rules();\n this._getId = chooseGetId(opts);\n\n opts.loopRequired = opts.loopRequired || Infinity;\n if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;\n if (opts.serialize === undefined) opts.serialize = stableStringify;\n this._metaOpts = getMetaSchemaOptions(this);\n\n if (opts.formats) addInitialFormats(this);\n if (opts.keywords) addInitialKeywords(this);\n addDefaultMetaSchema(this);\n if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);\n if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});\n addInitialSchemas(this);\n}\n\n\n\n/**\n * Validate data using schema\n * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.\n * @this Ajv\n * @param {String|Object} schemaKeyRef key, ref or schema object\n * @param {Any} data to be validated\n * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).\n */\nfunction validate(schemaKeyRef, data) {\n var v;\n if (typeof schemaKeyRef == 'string') {\n v = this.getSchema(schemaKeyRef);\n if (!v) throw new Error('no schema with key or ref \"' + schemaKeyRef + '\"');\n } else {\n var schemaObj = this._addSchema(schemaKeyRef);\n v = schemaObj.validate || this._compile(schemaObj);\n }\n\n var valid = v(data);\n if (v.$async !== true) this.errors = v.errors;\n return valid;\n}\n\n\n/**\n * Create validating function for passed schema.\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.\n * @return {Function} validating function\n */\nfunction compile(schema, _meta) {\n var schemaObj = this._addSchema(schema, undefined, _meta);\n return schemaObj.validate || this._compile(schemaObj);\n}\n\n\n/**\n * Adds schema to the instance.\n * @this Ajv\n * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.\n * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.\n * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n * @return {Ajv} this for method chaining\n */\nfunction addSchema(schema, key, _skipValidation, _meta) {\n if (Array.isArray(schema)){\n for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta);\n return this;\n }\n var id = this._getId(schema);\n if (id !== undefined && typeof id != 'string')\n throw new Error('schema id must be string');\n key = resolve.normalizeId(key || id);\n checkUnique(this, key);\n this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);\n return this;\n}\n\n\n/**\n * Add schema that will be used to validate other schemas\n * options in META_IGNORE_OPTIONS are alway set to false\n * @this Ajv\n * @param {Object} schema schema object\n * @param {String} key optional schema key\n * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema\n * @return {Ajv} this for method chaining\n */\nfunction addMetaSchema(schema, key, skipValidation) {\n this.addSchema(schema, key, skipValidation, true);\n return this;\n}\n\n\n/**\n * Validate schema\n * @this Ajv\n * @param {Object} schema schema to validate\n * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid\n * @return {Boolean} true if schema is valid\n */\nfunction validateSchema(schema, throwOrLogError) {\n var $schema = schema.$schema;\n if ($schema !== undefined && typeof $schema != 'string')\n throw new Error('$schema must be a string');\n $schema = $schema || this._opts.defaultMeta || defaultMeta(this);\n if (!$schema) {\n this.logger.warn('meta-schema not available');\n this.errors = null;\n return true;\n }\n var valid = this.validate($schema, schema);\n if (!valid && throwOrLogError) {\n var message = 'schema is invalid: ' + this.errorsText();\n if (this._opts.validateSchema == 'log') this.logger.error(message);\n else throw new Error(message);\n }\n return valid;\n}\n\n\nfunction defaultMeta(self) {\n var meta = self._opts.meta;\n self._opts.defaultMeta = typeof meta == 'object'\n ? self._getId(meta) || meta\n : self.getSchema(META_SCHEMA_ID)\n ? META_SCHEMA_ID\n : undefined;\n return self._opts.defaultMeta;\n}\n\n\n/**\n * Get compiled schema from the instance by `key` or `ref`.\n * @this Ajv\n * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).\n * @return {Function} schema validating function (with property `schema`).\n */\nfunction getSchema(keyRef) {\n var schemaObj = _getSchemaObj(this, keyRef);\n switch (typeof schemaObj) {\n case 'object': return schemaObj.validate || this._compile(schemaObj);\n case 'string': return this.getSchema(schemaObj);\n case 'undefined': return _getSchemaFragment(this, keyRef);\n }\n}\n\n\nfunction _getSchemaFragment(self, ref) {\n var res = resolve.schema.call(self, { schema: {} }, ref);\n if (res) {\n var schema = res.schema\n , root = res.root\n , baseId = res.baseId;\n var v = compileSchema.call(self, schema, root, undefined, baseId);\n self._fragments[ref] = new SchemaObject({\n ref: ref,\n fragment: true,\n schema: schema,\n root: root,\n baseId: baseId,\n validate: v\n });\n return v;\n }\n}\n\n\nfunction _getSchemaObj(self, keyRef) {\n keyRef = resolve.normalizeId(keyRef);\n return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];\n}\n\n\n/**\n * Remove cached schema(s).\n * If no parameter is passed all schemas but meta-schemas are removed.\n * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.\n * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.\n * @this Ajv\n * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object\n * @return {Ajv} this for method chaining\n */\nfunction removeSchema(schemaKeyRef) {\n if (schemaKeyRef instanceof RegExp) {\n _removeAllSchemas(this, this._schemas, schemaKeyRef);\n _removeAllSchemas(this, this._refs, schemaKeyRef);\n return this;\n }\n switch (typeof schemaKeyRef) {\n case 'undefined':\n _removeAllSchemas(this, this._schemas);\n _removeAllSchemas(this, this._refs);\n this._cache.clear();\n return this;\n case 'string':\n var schemaObj = _getSchemaObj(this, schemaKeyRef);\n if (schemaObj) this._cache.del(schemaObj.cacheKey);\n delete this._schemas[schemaKeyRef];\n delete this._refs[schemaKeyRef];\n return this;\n case 'object':\n var serialize = this._opts.serialize;\n var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;\n this._cache.del(cacheKey);\n var id = this._getId(schemaKeyRef);\n if (id) {\n id = resolve.normalizeId(id);\n delete this._schemas[id];\n delete this._refs[id];\n }\n }\n return this;\n}\n\n\nfunction _removeAllSchemas(self, schemas, regex) {\n for (var keyRef in schemas) {\n var schemaObj = schemas[keyRef];\n if (!schemaObj.meta && (!regex || regex.test(keyRef))) {\n self._cache.del(schemaObj.cacheKey);\n delete schemas[keyRef];\n }\n }\n}\n\n\n/* @this Ajv */\nfunction _addSchema(schema, skipValidation, meta, shouldAddSchema) {\n if (typeof schema != 'object' && typeof schema != 'boolean')\n throw new Error('schema should be object or boolean');\n var serialize = this._opts.serialize;\n var cacheKey = serialize ? serialize(schema) : schema;\n var cached = this._cache.get(cacheKey);\n if (cached) return cached;\n\n shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;\n\n var id = resolve.normalizeId(this._getId(schema));\n if (id && shouldAddSchema) checkUnique(this, id);\n\n var willValidate = this._opts.validateSchema !== false && !skipValidation;\n var recursiveMeta;\n if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))\n this.validateSchema(schema, true);\n\n var localRefs = resolve.ids.call(this, schema);\n\n var schemaObj = new SchemaObject({\n id: id,\n schema: schema,\n localRefs: localRefs,\n cacheKey: cacheKey,\n meta: meta\n });\n\n if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj;\n this._cache.put(cacheKey, schemaObj);\n\n if (willValidate && recursiveMeta) this.validateSchema(schema, true);\n\n return schemaObj;\n}\n\n\n/* @this Ajv */\nfunction _compile(schemaObj, root) {\n if (schemaObj.compiling) {\n schemaObj.validate = callValidate;\n callValidate.schema = schemaObj.schema;\n callValidate.errors = null;\n callValidate.root = root ? root : callValidate;\n if (schemaObj.schema.$async === true)\n callValidate.$async = true;\n return callValidate;\n }\n schemaObj.compiling = true;\n\n var currentOpts;\n if (schemaObj.meta) {\n currentOpts = this._opts;\n this._opts = this._metaOpts;\n }\n\n var v;\n try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }\n catch(e) {\n delete schemaObj.validate;\n throw e;\n }\n finally {\n schemaObj.compiling = false;\n if (schemaObj.meta) this._opts = currentOpts;\n }\n\n schemaObj.validate = v;\n schemaObj.refs = v.refs;\n schemaObj.refVal = v.refVal;\n schemaObj.root = v.root;\n return v;\n\n\n /* @this {*} - custom context, see passContext option */\n function callValidate() {\n /* jshint validthis: true */\n var _validate = schemaObj.validate;\n var result = _validate.apply(this, arguments);\n callValidate.errors = _validate.errors;\n return result;\n }\n}\n\n\nfunction chooseGetId(opts) {\n switch (opts.schemaId) {\n case 'auto': return _get$IdOrId;\n case 'id': return _getId;\n default: return _get$Id;\n }\n}\n\n/* @this Ajv */\nfunction _getId(schema) {\n if (schema.$id) this.logger.warn('schema $id ignored', s