function main( context ) {
	var source = context.getSourceCode();

	/**
	* Reports the error message.
	*
	* @private
	* @param {Object} loc - error location info
	* @param {string} msg - error message
	*/
	function report( loc, msg ) {
		context.report({
			'node': null,
			'message': msg,
			'loc': loc
		});
	}

	/**
	* Checks whether return annotations in the current program follow marker style conventions.
	*
	* @private
	* @param {ASTNode} node - node to examine
	*/
	function validate( node ) {
		var comments;
		var current;
		var offset;
		var prev;
		var msg;
		var i;

		comments = source.getAllComments( node );
		if ( comments.length > 0 ) {
			current = comments[ 0 ];
			msg = checkComment( current, node, 0 );
			if ( msg ) {
				report( current.loc, msg );
			}
			for ( i = 1; i < comments.length; i++ ) {
				prev = comments[ i-1 ];
				current = comments[ i ];
				offset = 0;

				// Check whether previous comment sits one line before the current one; if so, adjust offset for finding last node:
				if ( current.loc.start.line === prev.loc.end.line + 1 ) {
					offset = prev.loc.end.column - prev.loc.start.column + 1;
				}
				msg = checkComment( current, node, offset );
				if ( msg ) {
					report( current.loc, msg );
				}
			}
		}
	}

	/**
	* Checks whether a comment is a return annotation and, if so, whether it follows marker style conventions.
	*
	* @private
	* @param {string} comment - comment to examine
	* @param {ASTNode} ast - node to examine
	* @param {integer} offset - non-zero if previous line ends with a comment
	* @returns {(string|null)} error message or null
	*/
	function checkComment( comment, ast, offset ) {
		var matches;
		var node;
		var prev;
		var type;

		matches = comment.value.match( RE_ANNOTATION );
		if ( matches ) {
			offset += 1 + comment.loc.start.column;
			prev = walk.findNodeAt( ast, null, comment.start-offset );
			type = matches[ 1 ];
			if ( !prev ) {
				// Handle case when comment refers to node on the same line:
				if ( walk.findNodeAt( ast, null, comment.start-1 ) ) {
					return null;
				}
				return 'Encountered an orphaned return annotation without a preceding node';
			}
			node = prev.node;
			switch ( type ) {
			case 'returns':
				if (
					node.type !== 'VariableDeclaration' &&
					( node.type !== 'ExpressionStatement' || node.expression.type !== 'AssignmentExpression' )
				) {
					return 'Only include `// returns` after variable declarations or assignment expressions (use `=>` after `console.log`)';
				}
				break;
			case '=>':
				if (
					node.type === 'VariableDeclaration' ||
					( node.type === 'ExpressionStatement' && node.expression === 'AssignmentExpression' )
				) {
					return 'Use `// returns` after variable declarations or assignment expressions instead of `=>`';
				}
				break;
			default:
				break;
			}
		}
		return null;
	}

	return {
		'Program': validate
	};
}
Rule for validating that return annotations follow marker style conventions.

@param {Object} context - ESLint context
@returns {Object} validators