Query module WhitespaceContradictsPrecedence

name
Whitespace contradicts operator precedence
description
Nested expressions where the formatting contradicts the grouping enforced by operator precedence are difficult to read and may even indicate a bug.
kind
problem
problem.severity
warning
id
js/whitespace-contradicts-precedence
tags
maintainability correctness statistical non-attributable external/cwe/cwe-783
precision
very-high

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Predicates

interestingNesting

Holds if inner is an operand of outer, and the relative precedence may not be immediately clear, but is important for the semantics of the expression (that is, the operators are not associative).

Classes

AssocNestedExpr

A nested associative expression.

HarmlessNestedExpr

A binary expression nested inside another binary expression where the relative precedence of the two operators is unlikely to cause confusion.