From 69f0e61cda810466be34dbe46cbba51da3a7b13d Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Tue, 24 Feb 2026 09:20:44 +0100 Subject: [PATCH] [PM-32442] Enforce tsc-strict on desktop and CLI apps (#19058) * fix: ts-strict not applying to desktop * fix: ts-strict not applying to cli * fix: desktop ESM module resolution in storybook --- .storybook/tsconfig.json | 3 ++- apps/cli/src/commands/get.command.ts | 2 ++ apps/cli/src/utils.ts | 2 ++ apps/cli/src/vault/delete.command.ts | 2 ++ apps/cli/src/vault/models/attachment.response.ts | 2 ++ .../autofill/modal/credentials/fido2-create.component.ts | 2 ++ .../modal/credentials/fido2-excluded-ciphers.component.ts | 2 ++ .../autofill/modal/credentials/fido2-vault.component.ts | 2 ++ .../src/autofill/services/desktop-autofill.service.ts | 2 ++ .../services/desktop-fido2-user-interface.service.ts | 2 ++ apps/desktop/src/entry.ts | 2 ++ apps/desktop/src/main/updater.main.ts | 2 ++ .../assign-collections-desktop.component.ts | 2 ++ .../vault/vault-filter/filters/status-filter.component.ts | 2 ++ apps/desktop/src/vault/app/vault/vault-v2.component.ts | 2 ++ tsconfig.json | 8 ++++++-- 16 files changed, 36 insertions(+), 3 deletions(-) diff --git a/.storybook/tsconfig.json b/.storybook/tsconfig.json index 34acc9a740c..ab86c4179af 100644 --- a/.storybook/tsconfig.json +++ b/.storybook/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../tsconfig", "compilerOptions": { - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "moduleResolution": "bundler" }, "exclude": ["../src/test.setup.ts", "../apps/**/*.spec.ts", "../libs/**/*.spec.ts"], "files": [ diff --git a/apps/cli/src/commands/get.command.ts b/apps/cli/src/commands/get.command.ts index db070344628..cc01c21e0d0 100644 --- a/apps/cli/src/commands/get.command.ts +++ b/apps/cli/src/commands/get.command.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { filter, firstValueFrom, map, switchMap } from "rxjs"; import { CollectionService } from "@bitwarden/admin-console/common"; diff --git a/apps/cli/src/utils.ts b/apps/cli/src/utils.ts index 72746cb9b71..3aafcea6346 100644 --- a/apps/cli/src/utils.ts +++ b/apps/cli/src/utils.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import * as fs from "fs"; import * as path from "path"; diff --git a/apps/cli/src/vault/delete.command.ts b/apps/cli/src/vault/delete.command.ts index 8df1f8f316e..c92379e058f 100644 --- a/apps/cli/src/vault/delete.command.ts +++ b/apps/cli/src/vault/delete.command.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { firstValueFrom } from "rxjs"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; diff --git a/apps/cli/src/vault/models/attachment.response.ts b/apps/cli/src/vault/models/attachment.response.ts index c4450fa8def..c7e88df1c39 100644 --- a/apps/cli/src/vault/models/attachment.response.ts +++ b/apps/cli/src/vault/models/attachment.response.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { AttachmentView } from "@bitwarden/common/vault/models/view/attachment.view"; export class AttachmentResponse { diff --git a/apps/desktop/src/autofill/modal/credentials/fido2-create.component.ts b/apps/desktop/src/autofill/modal/credentials/fido2-create.component.ts index d18fb6752e3..d5b4984fae5 100644 --- a/apps/desktop/src/autofill/modal/credentials/fido2-create.component.ts +++ b/apps/desktop/src/autofill/modal/credentials/fido2-create.component.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { CommonModule } from "@angular/common"; import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from "@angular/core"; import { RouterModule, Router } from "@angular/router"; diff --git a/apps/desktop/src/autofill/modal/credentials/fido2-excluded-ciphers.component.ts b/apps/desktop/src/autofill/modal/credentials/fido2-excluded-ciphers.component.ts index 274956be0eb..b8aecafa92b 100644 --- a/apps/desktop/src/autofill/modal/credentials/fido2-excluded-ciphers.component.ts +++ b/apps/desktop/src/autofill/modal/credentials/fido2-excluded-ciphers.component.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { CommonModule } from "@angular/common"; import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from "@angular/core"; import { RouterModule, Router } from "@angular/router"; diff --git a/apps/desktop/src/autofill/modal/credentials/fido2-vault.component.ts b/apps/desktop/src/autofill/modal/credentials/fido2-vault.component.ts index 635ba3972cb..588f52ef6d3 100644 --- a/apps/desktop/src/autofill/modal/credentials/fido2-vault.component.ts +++ b/apps/desktop/src/autofill/modal/credentials/fido2-vault.component.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { CommonModule } from "@angular/common"; import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from "@angular/core"; import { RouterModule, Router } from "@angular/router"; diff --git a/apps/desktop/src/autofill/services/desktop-autofill.service.ts b/apps/desktop/src/autofill/services/desktop-autofill.service.ts index 473ce593cb6..24052a20b3c 100644 --- a/apps/desktop/src/autofill/services/desktop-autofill.service.ts +++ b/apps/desktop/src/autofill/services/desktop-autofill.service.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { Injectable, OnDestroy } from "@angular/core"; import { Subject, diff --git a/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts b/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts index 432448faba3..050332349a1 100644 --- a/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts +++ b/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { Router } from "@angular/router"; import { lastValueFrom, diff --git a/apps/desktop/src/entry.ts b/apps/desktop/src/entry.ts index 9f03a84e627..65b655c7478 100644 --- a/apps/desktop/src/entry.ts +++ b/apps/desktop/src/entry.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { spawn } from "child_process"; import * as path from "path"; diff --git a/apps/desktop/src/main/updater.main.ts b/apps/desktop/src/main/updater.main.ts index 60b4f282405..55f57c339fa 100644 --- a/apps/desktop/src/main/updater.main.ts +++ b/apps/desktop/src/main/updater.main.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { dialog, shell, Notification } from "electron"; import log from "electron-log"; import { autoUpdater, UpdateDownloadedEvent, VerifyUpdateSupport } from "electron-updater"; diff --git a/apps/desktop/src/vault/app/vault/assign-collections/assign-collections-desktop.component.ts b/apps/desktop/src/vault/app/vault/assign-collections/assign-collections-desktop.component.ts index 5af1f96a569..43531b603d1 100644 --- a/apps/desktop/src/vault/app/vault/assign-collections/assign-collections-desktop.component.ts +++ b/apps/desktop/src/vault/app/vault/assign-collections/assign-collections-desktop.component.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog"; import { Component, Inject } from "@angular/core"; diff --git a/apps/desktop/src/vault/app/vault/vault-filter/filters/status-filter.component.ts b/apps/desktop/src/vault/app/vault/vault-filter/filters/status-filter.component.ts index 95ffd3f0212..5b9c32291dd 100644 --- a/apps/desktop/src/vault/app/vault/vault-filter/filters/status-filter.component.ts +++ b/apps/desktop/src/vault/app/vault/vault-filter/filters/status-filter.component.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { Component, viewChild } from "@angular/core"; import { combineLatest, firstValueFrom, map, switchMap } from "rxjs"; diff --git a/apps/desktop/src/vault/app/vault/vault-v2.component.ts b/apps/desktop/src/vault/app/vault/vault-v2.component.ts index 458ddd666b8..ae049325d8b 100644 --- a/apps/desktop/src/vault/app/vault/vault-v2.component.ts +++ b/apps/desktop/src/vault/app/vault/vault-v2.component.ts @@ -1,3 +1,5 @@ +// FIXME: Update this file to be type safe and remove this and next line +// @ts-strict-ignore import { CommonModule } from "@angular/common"; import { ChangeDetectorRef, diff --git a/tsconfig.json b/tsconfig.json index 35200efa430..d085235dcba 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,10 @@ { "extends": "./tsconfig.base.json", "include": [ - "apps/web/src/**/*", "apps/browser/src/**/*", + "apps/cli/src/**/*", + "apps/desktop/src/**/*", + "apps/web/src/**/*", "libs/*/src/**/*", "libs/tools/send/**/src/**/*", "libs/dirt/card/src/**/*", @@ -10,8 +12,10 @@ "bitwarden_license/bit-common/src/**/*" ], "exclude": [ - "apps/web/src/**/*.spec.ts", "apps/browser/src/**/*.spec.ts", + "apps/cli/src/**/*.spec.ts", + "apps/desktop/src/**/*.spec.ts", + "apps/web/src/**/*.spec.ts", "libs/*/src/**/*.spec.ts", "**/*.spec-util.ts" ]