Sha256: 990fadc3b2b3c5c0e32ba88dfa794b1aeecf60891824b8d3b5baf614a061f29e
Contents?: true
Size: 1.04 KB
Versions: 43
Compression:
Stored size: 1.04 KB
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, url: "https://eslint.org/docs/rules/no-proto" }, schema: [] }, create(context) { return { MemberExpression(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, message: "The '__proto__' property is deprecated." }); } } }; } };
Version data entries
43 entries across 43 versions & 1 rubygems