lib/rules/require-super-in-init.js
function findStmtNodes(nodeBody) {
  const nodes = [];
  const fnExpressions = utils.findNodes(nodeBody, 'ExpressionStatement');
  const returnStatement = utils.findNodes(nodeBody, 'ReturnStatement');

  if (fnExpressions.length !== 0) {
    fnExpressions.forEach((item) => {
      nodes.push(item);
    });
  }

  if (returnStatement.length !== 0) {
    returnStatement.forEach((item) => {
      nodes.push(item);
    });
  }

  return nodes;
}
function findStmtNodes(nodeBody) {
  const nodes = [];
  const fnExpressions = utils.findNodes(nodeBody, 'ExpressionStatement');
  const returnStatement = utils.findNodes(nodeBody, 'ReturnStatement');

  if (fnExpressions.length !== 0) {
    fnExpressions.forEach((item) => {
      nodes.push(item);
    });
  }

  if (returnStatement.length !== 0) {
    returnStatement.forEach((item) => {
      nodes.push(item);
    });
  }

  return nodes;
}
function findStmtNodes ( nodeBody ) { const nodes = [ ] ; const fnExpressions = utils . findNodes ( nodeBody , 'ExpressionStatement' ) ; const returnStatement = utils . findNodes ( nodeBody , 'ReturnStatement' ) ; if ( fnExpressions . length !== 0 ) { fnExpressions . forEach ( ( item ) => { nodes . push ( item ) ; } ) ; } if ( returnStatement . length !== 0 ) { returnStatement . forEach ( ( item ) => { nodes . push ( item ) ; } ) ; } return nodes ; }
Locates nodes with either an ExpressionStatement or ReturnStatement
given name.
@param {Node[]} nodeBody Array of nodes.
@returns {Node[]} Array of nodes with given names.
Locates nodes with either an ExpressionStatement or ReturnStatement given name .