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QAAQ,MAAM,2BAA2B,gCAC3C,GACD","file":"/npm/eslint-auto-fix@1.0.4/fix.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/eslint-auto-fix@1.0.4/fix.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","let cliEngine = new (require('eslint').CLIEngine)({fix: true})\nlet chokidar = require('chokidar')\nlet fs = require('fs')\nlet writingTo = {} // Paths we're currently writing fixed codez to\n\nmodule.exports = (globsToWatch, options) => {\n  let startupTime = new Date().getTime()\n  let verbose = options.verbose\n  let fixOnStartup = options['fix-on-startup']\n\n  if (!globsToWatch || !globsToWatch.length) {\n    globsToWatch = ['./**/*.js']\n  }\n\n  if (!Array.isArray(globsToWatch)) {\n    globsToWatch = [globsToWatch]\n  }\n\n  if (verbose) {\n    console.error(`eslint-auto-fix is watching ${globsToWatch.join(', ')} for file changes`)\n  }\n\n  chokidar.watch(globsToWatch)\n    .on('change', fix(verbose))\n    .on('add', path => {\n      if (fixOnStartup) {\n        fix(verbose)(path)\n      } else {\n        // When chokidar first starts watching, it emits an \"add\" event for each file\n        // it finds matching the glob. Fixing them all at that point might be undesirable.\n        fs.stat(path, (error, stats) => {\n          if (stats && startupTime < stats.birthtimeMs) {\n            fix(verbose)(path)\n          }\n        })\n      }\n    })\n}\n\nlet errorMessages = (fatalErrorResults, path) => {\n  fatalErrorResults.forEach(result => {\n    result.messages.forEach(({message, line, column}) => {\n      console.error(`${message} on line ${line}, column ${column} of ${path}`)\n    })\n  })\n}\n\nlet fatalErrors = results => results.filter(\n  result => Boolean(result.messages.filter(\n    message => message.fatal\n  ).length)\n)\n\nlet fix = verbose => path => {\n  if (writingTo[path] === undefined) {\n    let results = cliEngine.executeOnFiles([path]).results\n    let fatalErrorResults = fatalErrors(results)\n\n    if (fatalErrorResults.length !== 0) {\n      errorMessages(fatalErrorResults, path)\n    } else if(results[0].output) { // Something needed fixin'\n      writeOutput(path, results[0].output, verbose)\n    }\n  }\n}\n\nlet writeOutput = (path, output, verbose) => {\n  writingTo[path] = true\n\n  if (verbose) {\n    console.error(`ESLint is fixing ${path}`)\n  }\n\n  fs.writeFile(path, output, writeError => {\n    delete writingTo[path]\n    if (writeError) {\n      console.error(`Could not write to file ${path} to auto-fix it with ESLint.`)\n    }\n  })\n}\n"]}