Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
): Promise<{
results: AggregatedResult;
globalConfig: Config.GlobalConfig;
}> => {
const realFs = require('fs');
const fs = require('graceful-fs');
fs.gracefulify(realFs);
let results: AggregatedResult | undefined;
// If we output a JSON object, we can't write anything to stdout, since
// it'll break the JSON structure and it won't be valid.
const outputStream =
argv.json || argv.useStderr ? process.stderr : process.stdout;
const {globalConfig, configs, hasDeprecationWarnings} = readConfigs(
argv,
projects,
);
if (argv.debug) {
logDebugMessages(globalConfig, configs, outputStream);
}
if (argv.showConfig) {
logDebugMessages(globalConfig, configs, process.stdout);
exit(0);
}
if (argv.clearCache) {
configs.forEach(config => {
rimraf.sync(config.cacheDirectory);