Changeset 0c6b92a for imaps-frontend/node_modules/eslint-plugin-react/lib/rules/prefer-stateless-function.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/eslint-plugin-react/lib/rules/prefer-stateless-function.js
rd565449 r0c6b92a 71 71 body.length === 1 72 72 && body[0].type === 'ExpressionStatement' 73 && body[0].expression.type === 'CallExpression'73 && astUtil.isCallExpression(body[0].expression) 74 74 && body[0].expression.callee.type === 'Super' 75 75 ); … … 192 192 * Check if a given AST node have any other properties the ones available in stateless components 193 193 * @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. 195 195 */ 196 196 function hasOtherProperties(node) { … … 355 355 scope = scope.upper; 356 356 } 357 const isRender = blockNode && blockNode.key && blockNode.key.name === 'render'; 357 const isRender = blockNode 358 && blockNode.key 359 && blockNode.key.name === 'render'; 358 360 const allowNull = testReactVersion(context, '>= 15.0.0'); // Stateless components can return null since React 15 359 361 const isReturningJSX = utils.isReturningJSX(node, !allowNull);
Note:
See TracChangeset
for help on using the changeset viewer.