How to use the @lhci/utils/src/lighthouserc.js.findRcFile function in @lhci/utils

To help you get started, we’ve selected a few @lhci/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GoogleChrome / lighthouse-ci / packages / cli / src / cli.js View on Github external
function createYargsConfigArguments() {
  const simpleArgv = yargsParser(process.argv.slice(2), {envPrefix: 'LHCI'});
  /** @type {[string, (path: string) => LHCI.YargsOptions]} */
  const configOption = ['config', loadAndParseRcFile];
  // If they're using the config option or opting out of auto-detection, use the config option.
  if (simpleArgv.config || hasOptedOutOfRcDetection()) return configOption;
  const rcFile = findRcFile();
  // If they don't currently have an rc file, use the config option for awareness.
  if (!rcFile) return configOption;
  return [loadAndParseRcFile(rcFile)];
}