function main( context ) {
	var source = context.getSourceCode();

	/**
	* Reports the error message.
	*
	* @private
	* @param {ASTNode} node - node to report
	*/
	function report( node ) {
		context.report({
			'node': node,
			'message': 'parentheses required around ternary conditions',
			'fix': fix
		});

		/**
		* Fixes the lint error.
		*
		* @private
		* @param {Function} fixer - ESLint fixer
		* @returns {(Object|null)} fix or null
		*/
		function fix( fixer ) {
			var start;
			var end;
			var str;

			start = node.range[ 0 ];
			end = node.range[ 1 ];
			str = source.text.slice( start, end );
			str = '( ' + str + ' )';
			return fixer.replaceTextRange( [ start, end ], str );
		}
	}

	/**
	* Checks that a ternary condition is parenthesized.
	*
	* @private
	* @param {ASTNode} node - node to examine
	*/
	function validate( node ) {
		var before;
		var after;
		var test;

		test = node.test;
		if ( test ) {
			before = source.getTokenBefore( test );
			after = source.getTokenAfter( test );
			if ( before.value !== '(' || after.value !== ')' ) {
				report( test );
			}
		}
	}

	return {
		'ConditionalExpression': validate
	};
}
Rule for validating that ternary conditions are wrapped with parentheses.

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