diff --git a/packages/angular/src/generators/ng-add/migrate-from-angular-cli.ts b/packages/angular/src/generators/ng-add/migrate-from-angular-cli.ts index 4be4020d52113..b2553846cb8ef 100755 --- a/packages/angular/src/generators/ng-add/migrate-from-angular-cli.ts +++ b/packages/angular/src/generators/ng-add/migrate-from-angular-cli.ts @@ -78,7 +78,7 @@ export async function migrateFromAngularCli( createRootKarmaConfig(tree); } if (workspaceRootFileTypesInfo.eslint) { - updateRootEsLintConfig(tree, eslintConfig, options.unitTestRunner); + await updateRootEsLintConfig(tree, eslintConfig, options.unitTestRunner); cleanupEsLintPackages(tree); } diff --git a/packages/angular/src/generators/ng-add/utilities/workspace.ts b/packages/angular/src/generators/ng-add/utilities/workspace.ts index 9989987c6dcac..118c9f29178c6 100644 --- a/packages/angular/src/generators/ng-add/utilities/workspace.ts +++ b/packages/angular/src/generators/ng-add/utilities/workspace.ts @@ -9,7 +9,7 @@ import { updateNxJson, writeJson, } from '@nx/devkit'; -import { Linter, lintInitGenerator } from '@nx/eslint'; +import { lintInitGenerator } from '@nx/eslint'; import { setupRootEsLint } from '@nx/eslint/src/generators/lint-project/setup-root-eslint'; import { getRootTsConfigPathInTree, @@ -185,12 +185,12 @@ export function updatePackageJson(tree: Tree): void { }); } -export function updateRootEsLintConfig( +export async function updateRootEsLintConfig( tree: Tree, existingEsLintConfig: any | undefined, unitTestRunner?: string -): void { - lintInitGenerator(tree, {}); +): Promise { + await lintInitGenerator(tree, {}); if (!existingEsLintConfig) { // There was no eslint config in the root, so we set it up and use it as-is diff --git a/packages/eslint/src/generators/init/init.ts b/packages/eslint/src/generators/init/init.ts index 56fbd535256b7..a2f03f7fe2f97 100644 --- a/packages/eslint/src/generators/init/init.ts +++ b/packages/eslint/src/generators/init/init.ts @@ -117,7 +117,7 @@ async function initEsLint( } if (options.updatePackageScripts) { - updatePackageScripts(tree, createNodes); + await updatePackageScripts(tree, createNodes); } return runTasksInSerial(...tasks);