function addProblemIfSameSeverityAndOptions(
	config,
	loc,
	problems,
	ruleId,
	ruleOptions,
	ruleOptionsInline,
	severity,
) {
	const existingConfigRaw = config.rules?.[ruleId];
	const existingConfig = existingConfigRaw
		? asArray(existingConfigRaw)
		: ["off"];
	const existingSeverity = normalizeSeverityToString(existingConfig[0]);
	const inlineSeverity = normalizeSeverityToString(ruleOptions[0]);
	const sameSeverity = existingSeverity === inlineSeverity;

	if (!sameSeverity) {
		return;
	}

	const alreadyConfigured = existingConfigRaw
		? `is already configured to '${existingSeverity}'`
		: "is not enabled so can't be turned off";
	let message;

	if (
		(existingConfig.length === 1 && ruleOptions.length === 1) ||
		existingSeverity === "off"
	) {
		message = `Unused inline config ('${ruleId}' ${alreadyConfigured}).`;
	} else if (
		!containsDifferentProperty(
			ruleOptions.slice(1),
			existingConfig.slice(1),
		)
	) {
		message =
			ruleOptionsInline.length === 1
				? `Unused inline config ('${ruleId}' ${alreadyConfigured}).`
				: `Unused inline config ('${ruleId}' ${alreadyConfigured} with the same options).`;
	}

	if (message) {
		problems.push(
			createLintingProblem({
				ruleId: null,
				message,
				loc,
				language: config.language,
				severity: normalizeSeverityToNumber(severity),
			}),
		);
	}
}
Pushes a problem to inlineConfigProblems if ruleOptions are redundant.
@param {Config} config Provided config.
@param {Object} loc A line/column location
@param {Array} problems Problems that may be added to.
@param {string} ruleId The rule ID.
@param {Array} ruleOptions The rule options, merged with the config's.
@param {Array} ruleOptionsInline The rule options from the comment.
@param {"error"|"warn"} severity The severity to report.
@returns {void}