function convertRcFileToYargsOptions(rcFile, pathToRcFile) {
  const ci = flattenRcToConfig(rcFile);
  /** @type {LHCI.YargsOptions} */
  let merged = {...ci.wizard, ...ci.assert, ...ci.collect, ...ci.upload, ...ci.server};
  if (ci.extends) {
    const extendedRcFilePath = path.resolve(path.dirname(pathToRcFile), ci.extends);
    const extensionBase = loadAndParseRcFile(extendedRcFilePath);
    merged = _.merge(extensionBase, merged);
  }

  return merged;
}
@param {LHCI.LighthouseRc} rcFile
@param {string} pathToRcFile
@return {LHCI.YargsOptions}