code: function (node) {
        let property;
        switch (node.type) {
          case 'ReturnStatement':
            property = 'argument';
            break;
          case 'ArrowFunctionExpression':
            property = 'body';
            break;
          default:
            return false;
        }
  
        const returnsJSX =
          node[property] &&
          node[property].type === 'JSXElement'
        ;
        const returnsReactCreateElement =
          node[property] &&
          node[property].callee &&
          node[property].callee.property &&
          node[property].callee.property.name === 'createElement'
        ;
  
        return Boolean(returnsJSX || returnsReactCreateElement);
      }
docs: Check if the node is returning JSX
  
  @param {ASTNode} node The AST node being checked (must be a ReturnStatement).
  @returns {Boolean} True if the node is returning JSX, false if not