Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: run eslint from PATH #654

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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