Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NoSequencesRule = rule.Rule{ Name: "no-sequences", Run: func(ctx rule.RuleContext, rawOptions any) rule.RuleListeners { opts := parseOptions(rawOptions) return rule.RuleListeners{ ast.KindBinaryExpression: func(node *ast.Node) { if !isCommaBinary(node) { return } parent, child, parenDepth := walkUpSkippingParens(node) if isCommaBinary(parent) { return } if isForInitOrUpdate(parent, child) { return } if opts.allowInParentheses { required := 1 if isGrammarParenArrowBody(parent, child) { required = 2 } if parenDepth >= required { return } } commaToken := firstCommaToken(node) if commaToken == nil { return } ctx.ReportRange( utils.TrimNodeTextRange(ctx.SourceFile, commaToken), rule.RuleMessage{ Id: "unexpectedCommaExpression", Description: "Unexpected use of comma operator.", }, ) }, } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.