eslint/eslint — pull request #1579 by btmills (2014-12-15 21:58:36+00:00)
Title: Fix: yoda treats negative numbers as literals (fixes #1571)

Negative numbers like `-1` are represented in the AST as a numeric `Literal` node with positive one as the value, wrapped in a `UnaryExpression` node with `-` as the prefix operator to negate the literal. This PR treats both positive and negative numbers as normal literals.

Because the range test exception validates ranges to ensure that the left end of the range <= the right end of the range, it was necessary to combine the negating wrapper and literal into a single negative literal node rather than simply checking for the presence of the negating wrapper so that the actual negative value is available.

This brings test coverage of `lib/rules/yoda.js` back up to 100%.

It also fixes a spelling error in the docs pointed out by @ljharb.