Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / eslint / lib / rules / no-proto.js
1 /**
2  * @fileoverview Rule to flag usage of __proto__ property
3  * @author Ilya Volodin
4  */
5
6 "use strict";
7
8 //------------------------------------------------------------------------------
9 // Rule Definition
10 //------------------------------------------------------------------------------
11
12 module.exports = {
13     meta: {
14         type: "suggestion",
15
16         docs: {
17             description: "disallow the use of the `__proto__` property",
18             category: "Best Practices",
19             recommended: false,
20             url: "https://eslint.org/docs/rules/no-proto"
21         },
22
23         schema: []
24     },
25
26     create(context) {
27
28         return {
29
30             MemberExpression(node) {
31
32                 if (node.property &&
33                         (node.property.type === "Identifier" && node.property.name === "__proto__" && !node.computed) ||
34                         (node.property.type === "Literal" && node.property.value === "__proto__")) {
35                     context.report({ node, message: "The '__proto__' property is deprecated." });
36                 }
37             }
38         };
39
40     }
41 };