Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NoNestedTernaryRule = rule.Rule{ Name: "no-nested-ternary", Run: func(ctx rule.RuleContext, options any) rule.RuleListeners { return rule.RuleListeners{ ast.KindConditionalExpression: func(node *ast.Node) { cond := node.AsConditionalExpression() if ast.IsConditionalExpression(ast.SkipParentheses(cond.WhenTrue)) || ast.IsConditionalExpression(ast.SkipParentheses(cond.WhenFalse)) { ctx.ReportNode(node, rule.RuleMessage{ Id: "noNestedTernary", Description: "Do not nest ternary expressions.", }) } }, } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.