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

	options = context.options[ 0 ];
	opts = copy( DEFAULTS );
	if ( hasOwnProp( options, 'types' ) ) {
		opts.types = options.types;
	}

	/**
	* Checks whether tags likely have typos in type definitions.
	*
	* @private
	* @param {Object} section - parameters or return section
	*/
	function tagTypes( section ) {
		var correction;
		var type;
		var tag;
		var i;

		for ( i = 0; i < section.tags.length; i++ ) {
			tag = section.tags[ i ];
			type = tag.type;
			if ( type.type === 'UnionType' ) {
				checkUnion( type, section );
			}
			if ( type.type === 'TypedObject' ) {
				checkTypedObject( type, section );
			}
			if ( type.name && indexOf( opts.types, type.name ) === -1 ) {
				correction = correctTypedef( type.name );
				if ( correction ) {
					context.report( '"'+type.name+'" type definition should be "'+correction+'"', section );
				}
			}
		}
	}
	return {
		'parameters': tagTypes,
		'returns': tagTypes
	};

	/**
	* Checks the type definitions of a union definition such as `(string|null)` for typos.
	*
	* @private
	* @param {Object} val - union definition
	* @param {Object} section - function documentation section
	*/
	function checkUnion( val, section ) {
		var correction;
		var elem;
		var i;
		for ( i = 0; i < val.elements.length; i++ ) {
			elem = val.elements[ i ];
			if ( elem.name ) {
				correction = correctTypedef( elem.name );
				if ( correction ) {
					context.report( '"'+elem.name+'" type definition should be "'+correction+'"', section );
				}
			}
		}
	}

	/**
	* Checks the type definitions of a typed object definition such as `Array<number>` for typos.
	*
	* @private
	* @param {Object} val - typed object definition
	* @param {Object} section - function documentation section
	*/
	function checkTypedObject( val, section ) {
		var correction = correctTypedef( val.name );
		if ( correction ) {
			context.report( '"'+val.name+'" type definition should be "'+correction+'"', section );
		}
		correction = correctTypedef( val.of );
		if ( correction ) {
			context.report( '"'+val.of+'" type definition should be "'+correction+'"', section );
		}
	}

	/**
	* Returns a corrected type definition if supplied a type definition with a typo.
	*
	* @private
	* @param {string} typedef - type definition
	* @returns {(string|null)} correct type definition or `null`
	*/
	function correctTypedef( typedef ) {
		var diff;
		var min;
		var val;
		var i;

		min = PINF;
		for ( i = 0; i < opts.types.length; i++ ) {
			diff = editDistance( typedef, opts.types[ i ] );
			if ( diff === 0 ) {
				return null;
			}
			if ( diff < min ) {
				min = diff;
				val = opts.types[ i ];
			}
		}
		if ( min <= THRESHOLD ) {
			return val;
		}
		return null;
	}
}
Rule for catching typos in type annotations.

@param {Context} context - lint context
@returns {Object} validators