Skip to content

Commit

Permalink
Merge pull request #1 from calvium/hoist-compatibility
Browse files Browse the repository at this point in the history
fix: run eslint from PATH
  • Loading branch information
Nystya authored Jan 3, 2023
2 parents 068edbd + fb41801 commit 06ce50b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ export async function run(verb: string, files: string[]): Promise<boolean> {
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;
Expand All @@ -152,13 +150,7 @@ export async function run(verb: string, files: string[]): Promise<boolean> {
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);
Expand Down

0 comments on commit 06ce50b

Please sign in to comment.