2 * @fileoverview Rule to flag nested ternary expressions
3 * @author Ian Christian Myers
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
12 module.exports = function(context) {
15 "ConditionalExpression": function(node) {
16 if (node.alternate.type === "ConditionalExpression" ||
17 node.consequent.type === "ConditionalExpression") {
18 context.report(node, "Do not nest ternary expressions");