Skip to content

Commit

Permalink
fix(@angular/cli): ensure lint command auto-add exits after completion
Browse files Browse the repository at this point in the history
When no lint target is present for a project, the command will ask if linting should be added to the project.
However, after adding the package, the command incorrectly kept executing and then failing due to the lint command not being fully setup yet.
Instead, the command will now exit after adding the linting package. This also allows inspection and/or adjustment of the linting configuration prior to actually linting.

Fixes: #22937
  • Loading branch information
clydin committed Apr 4, 2022
1 parent bbe74b8 commit 49dc63d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/angular/cli/commands/lint-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ export class LintCommand extends ArchitectCommand<LintCommandSchema> {
if (error) {
throw error;
}

return status ?? 0;
}

// Return an exit code to force the command to exit after adding the package
return 1;
}
}

0 comments on commit 49dc63d

Please sign in to comment.