2 * @fileoverview Rule to flag nested ternary expressions
3 * @author Ian Christian Myers
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
17 description: "disallow nested ternary expressions",
18 category: "Stylistic Issues",
20 url: "https://eslint.org/docs/rules/no-nested-ternary"
29 ConditionalExpression(node) {
30 if (node.alternate.type === "ConditionalExpression" ||
31 node.consequent.type === "ConditionalExpression") {
32 context.report({ node, message: "Do not nest ternary expressions." });