function main( context ) {
	/**
	* Reports the error message.
	*
	* @private
	* @param {ASTNode} node - node to report
	*/
	function report( node ) {
		context.report({
			'node': node,
			'message': 'require() expressions should not be immediately invoked'
		});
	}

	/**
	* Checks whether require() expression is immediately invoked.
	*
	* @private
	* @param {ASTNode} node - node to examine
	* @returns {boolean} boolean indicating whether require() is immediately invoked
	*/
	function isImmediateRequire( node ) {
		if (
			node.type === 'CallExpression' &&
			node.callee.type === 'Identifier' &&
			node.callee.name === 'require'
		) {
			return true;
		}
		return false;
	}

	/**
	* Checks whether a member of a required module is immediately invoked.
	*
	* @private
	* @param {ASTNode} node - node to examine
	* @returns {boolean} boolean indicating whether member of a required module is immediately invoked.
	*/
	function isImmediateMemberRequire( node ) {
		if (
			node.type === 'MemberExpression' &&
			node.object.type === 'CallExpression' &&
			node.object.callee.type === 'Identifier' &&
			node.object.callee.name === 'require'
		) {
			return true;
		}
		return false;
	}

	/**
	* Checks whether a require expression is immediately invoked.
	*
	* @private
	* @param {ASTNode} node - node to examine
	*/
	function validate( node ) {
		if (
			isImmediateRequire( node.callee ) ||
			isImmediateMemberRequire( node.callee )
		) {
			report( node );
		}
	}

	return {
		'CallExpression': validate
	};
}
Rule for validating that `require()` expressions are not immediately invoked.

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