function main( context ) {
	var isNamespaceIndex;
	var source;

	source = context.getSourceCode();
	return {
		'Program:exit': validate
	};

	/**
	* Extracts the package path from the `@see` tag.
	*
	* @private
	* @param {Array} tags - array of tags
	* @returns {string} package path
	*/
	function extractPackagePath( tags ) {
		var descr;
		var tag;
		var i;
		if ( tags.length === 0 ) {
			return null;
		}
		for ( i = tags.length - 1; i > 0; i-- ) {
			tag = tags[ i ];
			if ( tag.title === 'see' ) {
				descr = tag.description;
				return descr.substring( 14, descr.length - 1 );
			}
		}
		return null;
	}

	/**
	* Checks whether program is a namespace `index.js` file and if so, if packages are listed in alphabetical order.
	*
	* @private
	*/
	function validate() {
		var comments;
		var comment;
		var prevPkg;
		var ast;
		var pkg;
		var i;
		var j;

		comments = source.getAllComments();
		for ( i = 0; i < comments.length; i++ ) {
			comment = comments[ i ];
			if ( contains( comment.value, ORDER_COMMENT ) ) {
				isNamespaceIndex = true;
				break;
			}
		}
		if ( isNamespaceIndex ) {
			for ( j = i; j < comments.length; j++ ) {
				comment = comments[ j ];
				ast = parseJSDoc( comment.value, OPTS );
				pkg = extractPackagePath( ast.tags );
				if ( pkg && prevPkg ) {
					if ( pkg.localeCompare( prevPkg, 'en', OPTS_COMPARE ) < 0 ) {
						report( prevPkg, pkg, comment.loc );
					} else {
						prevPkg = pkg;
					}
				} else if ( pkg ) {
					prevPkg = pkg;
				}
			}
		}
	}

	/**
	* Reports the error message.
	*
	* @private
	* @param {string} last - name of first package
	* @param {string} current - name of second package
	* @param {Object} loc - lines of code (object with `start` and `end` properties)
	*/
	function report( last, current, loc ) {
		context.report({
			'node': null,
			'message': '"'+current+'" should come before "'+last+'"',
			'loc': loc
		});
	}
}
Rule for validating that packages in a namespace `index.js` file are listed in alphabetical order.

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