function getFallthroughComment(
	caseWhichFallsThrough,
	subsequentCase,
	context,
	fallthroughCommentPattern,
) {
	const sourceCode = context.sourceCode;

	if (
		caseWhichFallsThrough.consequent.length === 1 &&
		caseWhichFallsThrough.consequent[0].type === "BlockStatement"
	) {
		const trailingCloseBrace = sourceCode.getLastToken(
			caseWhichFallsThrough.consequent[0],
		);
		const commentInBlock = sourceCode
			.getCommentsBefore(trailingCloseBrace)
			.pop();

		if (
			commentInBlock &&
			isFallThroughComment(
				commentInBlock.value,
				fallthroughCommentPattern,
			)
		) {
			return commentInBlock;
		}
	}

	const comment = sourceCode.getCommentsBefore(subsequentCase).pop();

	if (
		comment &&
		isFallThroughComment(comment.value, fallthroughCommentPattern)
	) {
		return comment;
	}

	return null;
}
Checks whether or not a given case has a fallthrough comment.
@param {ASTNode} caseWhichFallsThrough SwitchCase node which falls through.
@param {ASTNode} subsequentCase The case after caseWhichFallsThrough.
@param {RuleContext} context A rule context which stores comments.
@param {RegExp} fallthroughCommentPattern A pattern to match comment to.
@returns {null | object} the comment if the case has a valid fallthrough comment, otherwise null