constructor(options = {}) {
		const defaultConfigs = [];
		const processedOptions = processOptions(options);
		const warningService = new WarningService();
		const linter = new Linter({
			cwd: processedOptions.cwd,
			configType: "flat",
			flags: mergeEnvironmentFlags(processedOptions.flags),
			warningService,
		});

		const cacheFilePath = getCacheFile(
			processedOptions.cacheLocation,
			processedOptions.cwd,
		);

		const lintResultCache = processedOptions.cache
			? new LintResultCache(cacheFilePath, processedOptions.cacheStrategy)
			: null;

		const configLoaderOptions = {
			cwd: processedOptions.cwd,
			baseConfig: processedOptions.baseConfig,
			overrideConfig: processedOptions.overrideConfig,
			configFile: processedOptions.configFile,
			ignoreEnabled: processedOptions.ignore,
			ignorePatterns: processedOptions.ignorePatterns,
			defaultConfigs,
			hasUnstableNativeNodeJsTSConfigFlag: linter.hasFlag(
				"unstable_native_nodejs_ts_config",
			),
			warningService,
		};

		this.#configLoader = linter.hasFlag("unstable_config_lookup_from_file")
			? new ConfigLoader(configLoaderOptions)
			: new LegacyConfigLoader(configLoaderOptions);

		debug(`Using config loader ${this.#configLoader.constructor.name}`);

		privateMembers.set(this, {
			options: processedOptions,
			linter,
			cacheFilePath,
			lintResultCache,
			defaultConfigs,
			configs: null,
			configLoader: this.#configLoader,
		});

		/**
		 * If additional plugins are passed in, add that to the default
		 * configs for this instance.
		 */
		if (options.plugins) {
			const plugins = {};

			for (const [pluginName, plugin] of Object.entries(
				options.plugins,
			)) {
				plugins[getShorthandName(pluginName, "eslint-plugin")] = plugin;
			}

			defaultConfigs.push({
				plugins,
			});
		}

		// Check for the .eslintignore file, and warn if it's present.
		if (existsSync(path.resolve(processedOptions.cwd, ".eslintignore"))) {
			warningService.emitESLintIgnoreWarning();
		}
	}
Creates a new instance of the main ESLint API.
@param {ESLintOptions} options The options for this instance.