lib/compiler.js
/**
 * Attempts to require a specified reporter. Tries the local built-ins first,
 * and if that fails, attempts to load an npm module that exports a reporter
 * handler function, and if that fails, attempts to load the reporter relative
 * to the current working directory.
 */
Attempts to require a specified reporter. Tries the local built-ins first,
and if that fails, attempts to load an npm module that exports a reporter
handler function, and if that fails, attempts to load the reporter relative
to the current working directory.
Attempts to require a specified reporter . Tries the local built - ins first and if that fails attempts to load an npm module that exports a reporter handler function and if that fails attempts to load the reporter relative to the current working directory .
function requireReporter(name) {
  const prefix = capitalize(camelcase(name));
  const locations = [`./reporters/${prefix}Reporter`, name, path.resolve(name)];
  let result = null;
  for (const location of locations) {
    try {
      result = require(location);
    } catch (e) {
    }
    if (result) {
      break;
    }
  }
  return result;
}
function requireReporter ( name ) { const prefix = capitalize ( camelcase ( name ) ) ; const locations = [ ` ${ prefix } ` , name , path . resolve ( name ) ] ; let result = null ; for ( const location of locations ) { try { result = require ( location ) ; } catch ( e ) { } if ( result ) { break ; } } return result ; }
Attempts to require a specified reporter.
Attempts to require a specified reporter .
// eslint-disable-next-line import/no-dynamic-require, global-require // noop