function main( context ) {
	/**
	* Reports lint error.
	*
	* @private
	* @param {ASTNode} node - node to report
	*/
	function report( node ) {
		context.report({
			'node': node,
			'message': 'module requires itself'
		});
	}

	/**
	* Tests whether a node requires the current file.
	*
	* @private
	* @param {Object} context - ESLint context
	* @param {ASTNode} node - node to examine
	* @param {string} id - module identifier
	*/
	function isSelfRequire( context, node, id ) {
		var filePath = context.getFilename();
		if ( filePath && id && filePath === resolve( id ) ) {
			report( node );
		}
	}

	/**
	* Tests whether an import statement attempts to import the current file.
	*
	* @private
	* @param {ASTNode} node - node to examine
	*/
	function validateImport( node ) {
		isSelfRequire( context, node, node.source.value );
	}

	/**
	* Checks whether a require expression attempts to load the current file.
	*
	* @private
	* @param {ASTNode} node - node to examine
	*/
	function validateRequire( node ) {
		if ( node.callee.name === 'require' ) {
			isSelfRequire( context, node, node.arguments[ 0 ].value );
		}
	}

	return {
		'ImportDeclaration': validateImport,
		'CallExpression': validateRequire
	};
}
Rule for validating that modules do not require themselves.

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