* @property {string} filePath The path to the current configuration.
* @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
* @property {string} name The name of the current configuration.
* @property {string} pluginBasePath The base path to resolve plugins.
* @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors.
* @property {string} filePath The path to the current configuration.
* @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
* @property {string} name The name of the current configuration.
* @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors.
* @param {ConfigArrayFactoryOptions} [options] The map for additional plugins.
*/
constructor({
additionalPluginPool=newMap(),
cwd=process.cwd(),
resolvePluginsRelativeTo,
builtInRules,
resolver=ModuleResolver,
eslintAllPath,
eslintRecommendedPath
}={}){
internalSlotsMap.set(this,{
additionalPluginPool,
cwd,
resolvePluginsRelativeTo:
resolvePluginsRelativeTo&&
path.resolve(cwd,resolvePluginsRelativeTo),
builtInRules,
resolver,
eslintAllPath,
eslintRecommendedPath
});
}
/**
* Create `ConfigArray` instance from a config data.
* @param {ConfigData|null} configData The config data to create.
* @param {Object} [options] The options.
* @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
* @param {string} [options.filePath] The path to this config data.
* @param {string} filePath The path to a config file.
* @param {Object} [options] The options.
* @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
* Load the config file on a given directory if exists.
* @param {string} directoryPath The path to a directory.
* @param {Object} [options] The options.
* @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
* @param {string} [options.name] The config name.
* @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.
thrownewError(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu,"\"").replace(/\n/gu,"")}').\n`);
}
/**
* Validates the non-severity options passed to a rule, based on its schema.
* @param {{create: Function}} rule The rule to validate
* @param {Array} localOptions The options for the rule, excluding severity
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: