function main( context ) {
	var options;
	var source;
	var opts;

	opts = copy( DEFAULTS );
	options = context.options[ 0 ];
	if ( hasOwnProp( options, 'whitelist' ) ) {
		opts.whitelist = options.whitelist.slice();
	}
	source = context.getSourceCode();

	return {
		'FunctionExpression:exit': validate,
		'FunctionDeclaration:exit': validate,
		'VariableDeclaration:exit': validate,
		'ExpressionStatement:exit': validate
	};

	/**
	* Checks whether JSDoc comments have a capitalized description that ends with a period.
	*
	* @private
	* @param {ASTNode} node - AST node
	* @returns {void}
	*/
	function validate( node ) {
		var flags;
		var found;
		var jsdoc;
		var desc;
		var word;
		var idx;
		var ast;
		var i;

		jsdoc = findJSDoc( source, node );
		if ( isObject( jsdoc ) ) {
			ast = parseJSDoc( jsdoc.value, DOPTS );
			desc = ast.description;
			idx = desc.search( reEOL.REGEXP );
			if ( idx !== -1 ) {
				// Only first line contains the description:
				desc = desc.substr( 0, idx );
			}
			// Do not raise an error for JSDoc comments without descriptions:
			if ( desc.length ) {
				flags = {};
				if ( !endsWith( desc, '.' ) ) {
					flags.missingPeriod = true;
				}
				if ( !isCapitalized( desc ) && !desc.match( RE_NUM ) ) {
					// Check whether description starts with a word from the whitelist:
					found = false;
					for ( i = 0; i < opts.whitelist.length; i++ ) {
						word = opts.whitelist[ i ];
						if ( startsWith( desc, word+' ' ) ) {
							found = true;
							break;
						}
					}
					// If not, raise an error:
					if ( !found ) {
						flags.missingCapital = true;
					}
				}
				if ( flags.missingPeriod || flags.missingCapital ) {
					return report( jsdoc, desc, flags );
				}
			}
		}
	}

	/**
	* Reports the error message.
	*
	* @private
	* @param {Object} jsdoc - JSDoc comment node
	* @param {string} desc - JSDoc description
	* @param {Object} flags - options object containing error flags (e.g., `missingPeriod`)
	*/
	function report( jsdoc, desc, flags ) {
		context.report({
			'node': null,
			'message': 'Description must start with an uppercase letter or number and end with a period',
			'loc': jsdoc.loc,
			'fix': fix
		});

		/**
		* Fixes the leading description sentence.
		*
		* @private
		* @param {Object} fixer - ESLint fixer
		* @returns {Object} fix
		*/
		function fix( fixer ) {
			var newDesc;
			var start;
			var end;
			var str;

			start = jsdoc.range[ 0 ];
			end = jsdoc.range[ 1 ];
			str = source.text.slice( start, end );

			newDesc = ( flags.missingCapital ) ? capitalize( desc ) : desc;
			if ( flags.missingPeriod ) {
				newDesc += '.';
			}

			// Replace the description with a capitalized version:
			str = str.replace( desc, newDesc );
			return fixer.replaceTextRange( [ start, end ], str );
		}
	}
}
Rule for validating that JSDoc descriptions start with an uppercase letter or number and end with a period.

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