Skip to content

sequences

Reports using the comma operator in expressions.

✅ This rule is included in the ts untyped preset.

The comma operator evaluates each of its operands and returns the value of the last operand. It can hide side effects and make code harder to read. Prefer writing separate expressions or statements instead.

const result = (doSideEffect(), computeValue());

This rule is not configurable.

Some developers prefer the succinct style of sequences and find it more readable. If you explicitly prefer sequences then you can disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.