From b2be3832c0e0060b9a2e54573d7bf3c950c56482 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:04:10 -0400 Subject: [PATCH] fix(@angular/cli): ensure lint command auto-add exits after completion 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 --- packages/angular/cli/commands/lint-impl.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/angular/cli/commands/lint-impl.ts b/packages/angular/cli/commands/lint-impl.ts index e9fb4dc801b3..eb4c5d5fcfc1 100644 --- a/packages/angular/cli/commands/lint-impl.ts +++ b/packages/angular/cli/commands/lint-impl.ts @@ -50,8 +50,9 @@ export class LintCommand extends ArchitectCommand { if (error) { throw error; } - - return status ?? 0; } + + // Return an exit code to force the command to exit after adding the package + return 1; } }