docs: function writeStatsFile(statsFilePath, statsObject, callback) { // eslint-disable-line
    if (typeof statsFilePath !== 'string') {
      return callback();
    }
  
    if (utils.filenameExtension(statsFilePath) !== 'json') {
      throw new Error('Your stats output file must be a JSON file (i.e. --stats ./stats.json)');
    }
  
    fs.writeFile(path.resolve(statsFilePath), JSON.stringify(statsObject, null, 2), (writeStatsFileError) => {
      if (writeStatsFileError) {
        throw new Error(`while writting stats JSON file ${statsFilePath}: ${writeStatsFileError}`);
      }
  
      callback();
    });
  }