Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / eslint / lib / rules / no-negated-in-lhs.js
1 /**
2  * @fileoverview A rule to disallow negated left operands of the `in` operator
3  * @author Michael Ficarra
4  * @deprecated in ESLint v3.3.0
5  */
6
7 "use strict";
8
9 //------------------------------------------------------------------------------
10 // Rule Definition
11 //------------------------------------------------------------------------------
12
13 module.exports = {
14     meta: {
15         type: "problem",
16
17         docs: {
18             description: "disallow negating the left operand in `in` expressions",
19             category: "Possible Errors",
20             recommended: false,
21             url: "https://eslint.org/docs/rules/no-negated-in-lhs"
22         },
23
24         replacedBy: ["no-unsafe-negation"],
25
26         deprecated: true,
27         schema: []
28     },
29
30     create(context) {
31
32         return {
33
34             BinaryExpression(node) {
35                 if (node.operator === "in" && node.left.type === "UnaryExpression" && node.left.operator === "!") {
36                     context.report({ node, message: "The 'in' expression's left operand is negated." });
37                 }
38             }
39         };
40
41     }
42 };