Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function executeCommandLine() {
const argv = minimist(process.argv.slice(2), { '--': true }) as unknown as ParsedArgs
const showVersion = argv.v || argv.version
if (showVersion) {
showToolVersion()
return
}
suppressError = argv.suppressError
const { correctCount, totalCount, anys } = await lint(
argv.p || argv.project || '.',
{
debug: argv.debug,
strict: argv.strict,
enableCache: argv.cache,
ignoreCatch: argv['ignore-catch'],
ignoreFiles: argv['ignore-files']
}
)
const percent = Math.floor(10000 * correctCount / totalCount) / 100
const atLeast = await getAtLeast(argv)
const failed = atLeast && percent < atLeast
if (argv.detail || failed) {
for (const { file, line, character, text } of anys) {
console.log(`${path.resolve(process.cwd(), file)}:${line + 1}:${character + 1}: ${text}`)
}