Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/eslint-plugin-react/lib/rules/prefer-stateless-function.js

    rd565449 r0c6b92a  
    7171        body.length === 1
    7272        && body[0].type === 'ExpressionStatement'
    73         && body[0].expression.type === 'CallExpression'
     73        && astUtil.isCallExpression(body[0].expression)
    7474        && body[0].expression.callee.type === 'Super'
    7575      );
     
    192192     * Check if a given AST node have any other properties the ones available in stateless components
    193193     * @param {ASTNode} node The AST node being checked.
    194      * @returns {Boolean} True if the node has at least one other property, false if not.
     194     * @returns {boolean} True if the node has at least one other property, false if not.
    195195     */
    196196    function hasOtherProperties(node) {
     
    355355          scope = scope.upper;
    356356        }
    357         const isRender = blockNode && blockNode.key && blockNode.key.name === 'render';
     357        const isRender = blockNode
     358          && blockNode.key
     359          && blockNode.key.name === 'render';
    358360        const allowNull = testReactVersion(context, '>= 15.0.0'); // Stateless components can return null since React 15
    359361        const isReturningJSX = utils.isReturningJSX(node, !allowNull);
Note: See TracChangeset for help on using the changeset viewer.