Skip to content

Commit

Permalink
Update: deprecate no-negated-in-lhs rule (refs #2716)
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Jul 30, 2016
1 parent 23b9dac commit 5f130b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/rules/no-negated-in-lhs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# disallow negating the left operand in `in` expressions (no-negated-in-lhs)

This rule was **deprecated** in ESLint v3.3.0 and replaced by the [no-unsafe-negation](no-unsafe-negation.md) rule.

## Rule Details

Just as developers might type `-a + b` when they mean `-(a + b)` for the negative of a sum, they might type `!key in object` by mistake when they almost certainly mean `!(key in object)` to test that a key is not in an object.
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/no-negated-in-lhs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @fileoverview A rule to disallow negated left operands of the `in` operator
* @author Michael Ficarra
* @deprecated in ESLint v3.3.0
*/

"use strict";
Expand All @@ -14,8 +15,10 @@ module.exports = {
docs: {
description: "disallow negating the left operand in `in` expressions",
category: "Possible Errors",
recommended: true
recommended: true,
replacedBy: ["no-unsafe-negation"]
},
deprecated: true,

schema: []
},
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/no-negated-in-lhs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @fileoverview Tests for the no-negated-in-lhs rule
* @author Michael Ficarra
* @deprecated in ESLint v3.3.0
*/

"use strict";
Expand Down

0 comments on commit 5f130b5

Please sign in to comment.