From b57580e50b0988ed4b99afbbd0d43170e41fcdce Mon Sep 17 00:00:00 2001 From: Santosh Mahto Date: Sun, 6 Jun 2021 13:53:00 +0530 Subject: [PATCH] fix(@schematics/angular): working with formatting (cherry picked from commit d13a8661046023419d74c2d626a6b2adc4027c90) --- packages/schematics/angular/web-worker/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/schematics/angular/web-worker/index.ts b/packages/schematics/angular/web-worker/index.ts index e1437ecc17c9..50f27fce63ee 100644 --- a/packages/schematics/angular/web-worker/index.ts +++ b/packages/schematics/angular/web-worker/index.ts @@ -105,6 +105,7 @@ function addSnippet(options: WebWorkerOptions): Rule { export default function (options: WebWorkerOptions): Rule { return async (host: Tree) => { const workspace = await getWorkspace(host); + if (!options.project) { throw new SchematicsException('Option "project" is required.'); } @@ -124,8 +125,7 @@ export default function (options: WebWorkerOptions): Rule { if (!projectTarget) { throw new Error(`Target is not defined for this project.`); } - const projectTargetOptions = ((projectTarget.options || - {}) as unknown) as BrowserBuilderOptions; + const projectTargetOptions = (projectTarget.options || {}) as unknown as BrowserBuilderOptions; if (options.path === undefined) { options.path = buildDefaultPath(project); @@ -143,8 +143,8 @@ export default function (options: WebWorkerOptions): Rule { const projectTestTarget = project.targets.get('test'); if (projectTestTarget) { - const projectTestTargetOptions = ((projectTestTarget.options || - {}) as unknown) as BrowserBuilderOptions; + const projectTestTargetOptions = (projectTestTarget.options || + {}) as unknown as BrowserBuilderOptions; const needWebWorkerConfig = !projectTestTargetOptions.webWorkerTsConfig; if (needWebWorkerConfig) {