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"
26 noNestedTernary: "Do not nest ternary expressions."
33 ConditionalExpression(node) {
34 if (node.alternate.type === "ConditionalExpression" ||
35 node.consequent.type === "ConditionalExpression") {
38 messageId: "noNestedTernary"