| Summary: | invalid 'Expected a conditional expression and instead saw an assignment' error | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Grant Gayed <grant_gayed> |
| Component: | JS Tools | Assignee: | Project Inbox <orion.client-inbox> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public |
| Version: | 12.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
Syntactically valid, but it is marked as an error because it is a potential programming problem. http://eslint.org/docs/rules/no-cond-assign Closing as INVALID. We should strongly discourage this pattern, but the option can be turned off under JavaScript Validation settings. |
Minimal snippet that shows the problem, the following should be valid (assign b to a then check for truthiness) but is marked as an error: var a; var b=1; if (a=b) {}