code: function printResults(engine, results, format, outputFile) {
      let formatter;
      let rules;
  
      try {
          formatter = engine.getFormatter(format);
          rules = engine.getRules();
      } catch (e) {
          log.error(e.message);
          return false;
      }
  
      const rulesMeta = {};
  
      rules.forEach((rule, ruleId) => {
          rulesMeta[ruleId] = rule.meta;
      });
  
      const output = formatter(results, { rulesMeta });
  
      if (output) {
          if (outputFile) {
              const filePath = path.resolve(process.cwd(), outputFile);
  
              if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) {
                  log.error("Cannot write to output file path, it is a directory: %s", outputFile);
                  return false;
              }
  
              try {
                  mkdirp.sync(path.dirname(filePath));
                  fs.writeFileSync(filePath, output);
              } catch (ex) {
                  log.error("There was a problem writing the output file:\n%s", ex);
                  return false;
              }
          } else {
              log.info(output);
          }
      }
  
      return true;
  
  }
docs: Outputs the results of the linting.
  @param {CLIEngine} engine The CLIEngine to use.
  @param {LintResult[]} results The results to print.
  @param {string} format The name of the formatter to use or the path to the formatter.
  @param {string} outputFile The path for the output file.
  @returns {boolean} True if the printing succeeds, false if not.
  @private