Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const args = Object.keys(options).reduce(
(args, option) => {
if (typeof options[option] === 'string') {
return args.concat(['--' + option, options[option] as string]);
} else if (typeof options[option] === 'boolean') {
return args.concat(['--' + option]);
}
return args;
},
[tscCmd]
);
const cmd = encodeArgs([process.execPath, ...args]).join(' ');
logger.info(`Executing: ${cmd}`);
return exec(cmd);
} else {
Promise.resolve();
}
};
}
const args = [
'--project',
projectFile,
'-t',
'stylish',
'-r',
path.dirname(resolve('tslint-microsoft-contrib') || '')
];
if (options.fix) {
args.push('--fix');
}
const cmd = encodeArgs([process.execPath, tslintCmd, ...args]).join(' ');
logger.info(cmd);
return exec(cmd, { stdout: process.stdout, stderr: process.stderr });
} else {
return Promise.resolve();
}
};
}