function* iterateRuleDeprecationWarnings(usedConfigArrays) {
	const processedRuleIds = new Set();

	// Flatten used configs.
	/** @type {ExtractedConfig[]} */
	const configs = usedConfigArrays.flatMap(getUsedExtractedConfigs);

	// Traverse rule configs.
	for (const config of configs) {
		for (const [ruleId, ruleConfig] of Object.entries(config.rules)) {
			// Skip if it was processed.
			if (processedRuleIds.has(ruleId)) {
				continue;
			}
			processedRuleIds.add(ruleId);

			// Skip if it's not used.
			if (!ConfigOps.getRuleSeverity(ruleConfig)) {
				continue;
			}
			const rule = getRule(ruleId, usedConfigArrays);

			// Skip if it's not deprecated.
			if (!(rule && rule.meta && rule.meta.deprecated)) {
				continue;
			}

			// This rule was used and deprecated.
			yield {
				ruleId,
				replacedBy: rule.meta.replacedBy || [],
			};
		}
	}
}
Collect used deprecated rules.
@param {ConfigArray[]} usedConfigArrays The config arrays which were used.
@returns {IterableIterator<DeprecatedRuleInfo>} Used deprecated rules.