function countTrailingLinebreaks(string) {
			const trailingWhitespace = string.match(/\s*$/u)[0];
			const linebreakMatches = trailingWhitespace.match(
				astUtils.createGlobalLinebreakMatcher(),
			);

			return linebreakMatches === null ? 0 : linebreakMatches.length;
		}
Counts the number of linebreaks that follow the last non-whitespace character in a string
@param {string} string The string to check
@returns {number} The number of JavaScript linebreaks that follow the last non-whitespace character,
or the total number of linebreaks if the string is all whitespace.