src/config/resolveConfig.js
function getCLIParamsConfig(config, commander) {
  let {
    file,
    pathFile,
    dir,
    useJsModules,
    landBase,
    numWorkers,
    skipVerify,
    decaffeinatePath,
    jscodeshiftPath,
    eslintPath,
  } = commander;
  // As a special case, specifying files to process from the CLI should cause
  // any equivalent config file settings to be ignored.
  if ((file && file.length > 0) || dir || pathFile) {
    config.filesToProcess = null;
    config.searchDirectory = null;
    config.pathFile = null;
  }

  if (file && file.length > 0) {
    config.filesToProcess = file;
  }
  if (dir) {
    config.searchDirectory = dir;
  }
  if (pathFile) {
    config.pathFile = pathFile;
  }
  if (useJsModules) {
    config.useJSModules = true;
  }
  if (landBase) {
    config.landBase = landBase;
  }
  if (numWorkers) {
    config.numWorkers = numWorkers;
  }
  if (skipVerify) {
    config.skipVerify = true;
  }
  if (decaffeinatePath) {
    config.decaffeinatePath = decaffeinatePath;
  }
  if (jscodeshiftPath) {
    config.jscodeshiftPath = jscodeshiftPath;
  }
  if (eslintPath) {
    config.eslintPath = eslintPath;
  }
  return config;
}
function getCLIParamsConfig(config, commander) {
  let {
    file,
    pathFile,
    dir,
    useJsModules,
    landBase,
    numWorkers,
    skipVerify,
    decaffeinatePath,
    jscodeshiftPath,
    eslintPath,
  } = commander;
  // As a special case, specifying files to process from the CLI should cause
  // any equivalent config file settings to be ignored.
  if ((file && file.length > 0) || dir || pathFile) {
    config.filesToProcess = null;
    config.searchDirectory = null;
    config.pathFile = null;
  }

  if (file && file.length > 0) {
    config.filesToProcess = file;
  }
  if (dir) {
    config.searchDirectory = dir;
  }
  if (pathFile) {
    config.pathFile = pathFile;
  }
  if (useJsModules) {
    config.useJSModules = true;
  }
  if (landBase) {
    config.landBase = landBase;
  }
  if (numWorkers) {
    config.numWorkers = numWorkers;
  }
  if (skipVerify) {
    config.skipVerify = true;
  }
  if (decaffeinatePath) {
    config.decaffeinatePath = decaffeinatePath;
  }
  if (jscodeshiftPath) {
    config.jscodeshiftPath = jscodeshiftPath;
  }
  if (eslintPath) {
    config.eslintPath = eslintPath;
  }
  return config;
}
function getCLIParamsConfig ( config , commander ) { let { file , pathFile , dir , useJsModules , landBase , numWorkers , skipVerify , decaffeinatePath , jscodeshiftPath , eslintPath , } = commander ; // As a special case, specifying files to process from the CLI should cause // any equivalent config file settings to be ignored. if ( ( file && file . length > 0 ) || dir || pathFile ) { config . filesToProcess = null ; config . searchDirectory = null ; config . pathFile = null ; } if ( file && file . length > 0 ) { config . filesToProcess = file ; } if ( dir ) { config . searchDirectory = dir ; } if ( pathFile ) { config . pathFile = pathFile ; } if ( useJsModules ) { config . useJSModules = true ; } if ( landBase ) { config . landBase = landBase ; } if ( numWorkers ) { config . numWorkers = numWorkers ; } if ( skipVerify ) { config . skipVerify = true ; } if ( decaffeinatePath ) { config . decaffeinatePath = decaffeinatePath ; } if ( jscodeshiftPath ) { config . jscodeshiftPath = jscodeshiftPath ; } if ( eslintPath ) { config . eslintPath = eslintPath ; } return config ; }
Fill in a configuration from the CLI arguments.
Fill in a configuration from the CLI arguments .