function main( context ) {
	var requires = [];

	/**
	* Validates `require` statements.
	*
	* @private
	* @param {ASTNode} node - node to examine
	*/
	function validate( node ) {
		var requirePath;
		if (
			node.callee.name === 'require' &&
			node.arguments[ 0 ] &&
			node.arguments[ 0 ].type === 'Literal'
		) {
			requirePath = node.arguments[ 0 ].value;
			requires.push({
				'node': node,
				'path': requirePath,
				'isRelative': isRelativePath( requirePath )
			});
		}
	}

	/**
	* Reports the error message.
	*
	* @private
	* @param {Object} lastRequire - last `require` statement
	*/
	function report( lastRequire ) {
		context.report({
			'node': lastRequire.node,
			'message': 'Last `require` statement in example files must be a relative path'
		});
	}

	/**
	* Callback invoked upon program exit.
	*
	* @private
	*/
	function finish() {
		var lastRequire;
		if ( requires.length > 0 ) {
			lastRequire = requires[ requires.length - 1 ];
			if ( !lastRequire.isRelative ) {
				report( lastRequire );
			}
			requires.length = 0; // reset to ensure that the array is not used across multiple files
		}
	}

	return {
		'CallExpression': validate,
		'Program:exit': finish
	};
}
ESLint rule to enforce that the last `require` statement is a relative path.

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