function getOrFindUsedDeprecatedRules(cliEngine, maybeFilePath) {
	const {
		configArrayFactory,
		options: { cwd },
	} = getCLIEngineInternalSlots(cliEngine);
	const filePath = path.isAbsolute(maybeFilePath)
		? maybeFilePath
		: path.join(cwd, "__placeholder__.js");
	const configArray = configArrayFactory.getConfigArrayForFile(filePath);
	const config = configArray.extractConfig(filePath);

	// Most files use the same config, so cache it.
	if (!usedDeprecatedRulesCache.has(config)) {
		const pluginRules = configArray.pluginRules;
		const retv = [];

		for (const [ruleId, ruleConf] of Object.entries(config.rules)) {
			if (getRuleSeverity(ruleConf) === 0) {
				continue;
			}
			const rule = pluginRules.get(ruleId) || BuiltinRules.get(ruleId);
			const meta = rule && rule.meta;

			if (meta && meta.deprecated) {
				retv.push({ ruleId, replacedBy: meta.replacedBy || [] });
			}
		}

		usedDeprecatedRulesCache.set(config, Object.freeze(retv));
	}

	return usedDeprecatedRulesCache.get(config);
}
Create used deprecated rule list.
@param {CLIEngine} cliEngine The CLIEngine instance.
@param {string} maybeFilePath The absolute path to a lint target file or `"<text>"`.
@returns {DeprecatedRuleInfo[]} The used deprecated rule list.