diff --git a/src/cli.ts b/src/cli.ts index d58724ba..49671caa 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -141,9 +141,7 @@ export async function run(verb: string, files: string[]): Promise { case 'lint': case 'check': { try { - await execa('node', ['./node_modules/eslint/bin/eslint', ...flags], { - stdio: 'inherit', - }); + await execa('eslint', flags, {stdio: 'inherit'}); return true; } catch (e) { return false; @@ -152,13 +150,7 @@ export async function run(verb: string, files: string[]): Promise { case 'fix': { const fixFlag = options.dryRun ? '--fix-dry-run' : '--fix'; try { - await execa( - 'node', - ['./node_modules/eslint/bin/eslint', fixFlag, ...flags], - { - stdio: 'inherit', - } - ); + await execa('eslint', [fixFlag, ...flags], {stdio: 'inherit'}); return true; } catch (e) { console.error(e);