Server IP : 150.95.80.236 / Your IP : 18.224.67.0 Web Server : Apache System : Linux host-150-95-80-236 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : social-telecare ( 10000) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/pcu.in.th/api-uat.pcu.in.th/node_modules/eslint/lib/rules/ |
Upload File : |
/** * @fileoverview Rule to check that spaced function application * @author Matt DuVall <http://www.mattduvall.com> * @deprecated in ESLint v3.3.0 */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "layout", docs: { description: "Disallow spacing between function identifiers and their applications (deprecated)", recommended: false, url: "https://eslint.org/docs/latest/rules/no-spaced-func" }, deprecated: true, replacedBy: ["func-call-spacing"], fixable: "whitespace", schema: [], messages: { noSpacedFunction: "Unexpected space between function name and paren." } }, create(context) { const sourceCode = context.sourceCode; /** * Check if open space is present in a function name * @param {ASTNode} node node to evaluate * @returns {void} * @private */ function detectOpenSpaces(node) { const lastCalleeToken = sourceCode.getLastToken(node.callee); let prevToken = lastCalleeToken, parenToken = sourceCode.getTokenAfter(lastCalleeToken); // advances to an open parenthesis. while ( parenToken && parenToken.range[1] < node.range[1] && parenToken.value !== "(" ) { prevToken = parenToken; parenToken = sourceCode.getTokenAfter(parenToken); } // look for a space between the callee and the open paren if (parenToken && parenToken.range[1] < node.range[1] && sourceCode.isSpaceBetweenTokens(prevToken, parenToken) ) { context.report({ node, loc: lastCalleeToken.loc.start, messageId: "noSpacedFunction", fix(fixer) { return fixer.removeRange([prevToken.range[1], parenToken.range[0]]); } }); } } return { CallExpression: detectOpenSpaces, NewExpression: detectOpenSpaces }; } };