Sha256: d8da8c42738ee20615640e28a4b93e9e0d39a68ce35e500dd6e07243c87f364f
Contents?: true
Size: 1014 Bytes
Versions: 45
Compression:
Stored size: 1014 Bytes
Contents
/** * @fileoverview Rule to flag usage of __proto__ property * @author Ilya Volodin */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = { meta: { docs: { description: "disallow the use of the `__proto__` property", category: "Best Practices", recommended: false }, schema: [] }, create: function(context) { return { MemberExpression: function(node) { if (node.property && (node.property.type === "Identifier" && node.property.name === "__proto__" && !node.computed) || (node.property.type === "Literal" && node.property.value === "__proto__")) { context.report(node, "The '__proto__' property is deprecated."); } } }; } };
Version data entries
45 entries across 45 versions & 2 rubygems