!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/pmb/node_modules/eslint-plugin-testing-library/rules/   drwxr-xr-x
Free 12.98 GB of 57.97 GB (22.39%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     prefer-wait-for.js (6.11 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RULE_NAME = void 0;
const utils_1 = require("@typescript-eslint/utils");
const create_testing_library_rule_1 = require("../create-testing-library-rule");
const node_utils_1 = require("../node-utils");
exports.RULE_NAME = 'prefer-wait-for';
const DEPRECATED_METHODS = ['wait', 'waitForElement', 'waitForDomChange'];
exports.default = (0, create_testing_library_rule_1.createTestingLibraryRule)({
    name: exports.RULE_NAME,
    meta: {
        type: 'suggestion',
        docs: {
            description: 'Use `waitFor` instead of deprecated wait methods',
            recommendedConfig: {
                dom: false,
                angular: false,
                react: false,
                vue: false,
                marko: false,
            },
        },
        messages: {
            preferWaitForMethod: '`{{ methodName }}` is deprecated in favour of `waitFor`',
            preferWaitForImport: 'import `waitFor` instead of deprecated async utils',
            preferWaitForRequire: 'require `waitFor` instead of deprecated async utils',
        },
        fixable: 'code',
        schema: [],
    },
    defaultOptions: [],
    create(context, _, helpers) {
        let addWaitFor = false;
        const reportRequire = (node) => {
            context.report({
                node,
                messageId: 'preferWaitForRequire',
                fix(fixer) {
                    const excludedImports = [...DEPRECATED_METHODS, 'waitFor'];
                    const newAllRequired = node.properties
                        .filter((s) => (0, node_utils_1.isProperty)(s) &&
                        utils_1.ASTUtils.isIdentifier(s.key) &&
                        !excludedImports.includes(s.key.name))
                        .map((s) => s.key.name);
                    newAllRequired.push('waitFor');
                    return fixer.replaceText(node, `{ ${newAllRequired.join(',')} }`);
                },
            });
        };
        const reportImport = (node) => {
            context.report({
                node,
                messageId: 'preferWaitForImport',
                fix(fixer) {
                    const excludedImports = [...DEPRECATED_METHODS, 'waitFor'];
                    const newImports = node.specifiers
                        .map((specifier) => (0, node_utils_1.isImportSpecifier)(specifier) &&
                        !excludedImports.includes(specifier.imported.name) &&
                        specifier.imported.name)
                        .filter(Boolean);
                    newImports.push('waitFor');
                    const newNode = `import { ${newImports.join(',')} } from '${node.source.value}';`;
                    return fixer.replaceText(node, newNode);
                },
            });
        };
        const reportWait = (node) => {
            context.report({
                node,
                messageId: 'preferWaitForMethod',
                data: {
                    methodName: node.name,
                },
                fix(fixer) {
                    const callExpressionNode = (0, node_utils_1.findClosestCallExpressionNode)(node);
                    if (!callExpressionNode) {
                        return null;
                    }
                    const [arg] = callExpressionNode.arguments;
                    const fixers = [];
                    if (arg) {
                        fixers.push(fixer.replaceText(node, 'waitFor'));
                        if (node.name === 'waitForDomChange') {
                            fixers.push(fixer.insertTextBefore(arg, '() => {}, '));
                        }
                    }
                    else {
                        let methodReplacement = 'waitFor(() => {})';
                        if ((0, node_utils_1.isMemberExpression)(node.parent) &&
                            utils_1.ASTUtils.isIdentifier(node.parent.object)) {
                            methodReplacement = `${node.parent.object.name}.${methodReplacement}`;
                        }
                        const newText = methodReplacement;
                        fixers.push(fixer.replaceText(callExpressionNode, newText));
                    }
                    return fixers;
                },
            });
        };
        return {
            'CallExpression > MemberExpression'(node) {
                const isDeprecatedMethod = utils_1.ASTUtils.isIdentifier(node.property) &&
                    DEPRECATED_METHODS.includes(node.property.name);
                if (!isDeprecatedMethod) {
                    return;
                }
                if (!helpers.isNodeComingFromTestingLibrary(node)) {
                    return;
                }
                addWaitFor = true;
                reportWait(node.property);
            },
            'CallExpression > Identifier'(node) {
                if (!DEPRECATED_METHODS.includes(node.name)) {
                    return;
                }
                if (!helpers.isNodeComingFromTestingLibrary(node)) {
                    return;
                }
                addWaitFor = true;
                reportWait(node);
            },
            'Program:exit'() {
                var _a;
                if (!addWaitFor) {
                    return;
                }
                const testingLibraryNode = (_a = helpers.getCustomModuleImportNode()) !== null && _a !== void 0 ? _a : helpers.getTestingLibraryImportNode();
                if ((0, node_utils_1.isCallExpression)(testingLibraryNode)) {
                    const parent = testingLibraryNode.parent;
                    if (!(0, node_utils_1.isObjectPattern)(parent.id)) {
                        return;
                    }
                    reportRequire(parent.id);
                }
                else if (testingLibraryNode) {
                    if (testingLibraryNode.specifiers.length === 1 &&
                        (0, node_utils_1.isImportNamespaceSpecifier)(testingLibraryNode.specifiers[0])) {
                        return;
                    }
                    reportImport(testingLibraryNode);
                }
            },
        };
    },
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0211 ]--