"use strict";exports.__esModule=true;exports.verifyAndLint=verifyAndLint;var _chalk=_interopRequireDefault(require("chalk"));var _jestWorker=require("jest-worker");var _fs=require("fs");var _path=require("path");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}async function verifyAndLint(dir,configLintDirs,numWorkers,enableWorkerThreads){try{const lintWorkers=new _jestWorker.Worker(require.resolve('./eslint/runLintCheck'),{numWorkers,enableWorkerThreads});lintWorkers.getStdout().pipe(process.stdout);lintWorkers.getStderr().pipe(process.stderr);const lintDirs=(configLintDirs!=null?configLintDirs:['pages','components','lib']).reduce((res,d)=>{const currDir=(0,_path.join)(dir,d);if(!(0,_fs.existsSync)(currDir))return res;res.push(currDir);return res;},[]);const lintResults=await lintWorkers.runLintCheck(dir,lintDirs,true);if(lintResults){console.log(lintResults);}lintWorkers.end();}catch(err){if(err.type==='CompileError'){console.error(_chalk.default.red('\nFailed to compile.'));console.error(err.message);process.exit(1);}else if(err.type==='FatalError'){console.error(err.message);process.exit(1);}throw err;}}
//# sourceMappingURL=verifyAndLint.js.map