Sha256: d3a806ae9c1e76efaa1cf26620da6246f81ece45a74c3615f157cc7b1554b68c

Contents?: true

Size: 1.27 KB

Versions: 6

Compression:

Stored size: 1.27 KB

Contents

/**
 * @fileoverview Rule to flag usage of __iterator__ property
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { getStaticPropertyName } = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../shared/types').Rule} */
module.exports = {
    meta: {
        type: "suggestion",

        docs: {
            description: "disallow the use of the `__iterator__` property",
            recommended: false,
            url: "https://eslint.org/docs/rules/no-iterator"
        },

        schema: [],

        messages: {
            noIterator: "Reserved name '__iterator__'."
        }
    },

    create(context) {

        return {

            MemberExpression(node) {

                if (getStaticPropertyName(node) === "__iterator__") {
                    context.report({
                        node,
                        messageId: "noIterator"
                    });
                }
            }
        };

    }
};

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-0.27.1 packages/webpacker/node_modules/eslint/lib/rules/no-iterator.js
decidim-0.26.4 packages/webpacker/node_modules/eslint/lib/rules/no-iterator.js
decidim-0.27.0 packages/webpacker/node_modules/eslint/lib/rules/no-iterator.js
decidim-0.26.3 packages/webpacker/node_modules/eslint/lib/rules/no-iterator.js
decidim-0.27.0.rc2 packages/webpacker/node_modules/eslint/lib/rules/no-iterator.js
decidim-0.27.0.rc1 packages/webpacker/node_modules/eslint/lib/rules/no-iterator.js