getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) {
		const namePattern = new RegExp(
			`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`,
			"gu",
		);

		// To ignore the first text "global".
		namePattern.lastIndex = comment.value.indexOf("global") + 6;

		// Search a given variable name.
		const match = namePattern.exec(comment.value);

		// Convert the index to loc.
		const start = sourceCode.getLocFromIndex(
			comment.range[0] + "/*".length + (match ? match.index + 1 : 0),
		);
		const end = {
			line: start.line,
			column: start.column + (match ? name.length : 1),
		};

		return { start, end };
	}
Get the `loc` object of a given name in a `/*globals` directive comment.
@param {SourceCode} sourceCode The source code to convert index to loc.
@param {Comment} comment The `/*globals` directive comment which include the name.
@param {string} name The name to find.
@returns {SourceLocation} The `loc` object.