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

Version Path
govuk_publishing_components-16.19.0 node_modules/eslint/lib/rules/no-proto.js
govuk_publishing_components-16.18.0 node_modules/eslint/lib/rules/no-proto.js
govuk_publishing_components-16.17.0 node_modules/eslint/lib/rules/no-proto.js
guard-sass-lint-0.1.2 node_modules/eslint/lib/rules/no-proto.js
guard-sass-lint-0.1.1 node_modules/eslint/lib/rules/no-proto.js