diff --git a/apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.stories.ts b/apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.stories.ts index faf1b796b0..88132e5638 100644 --- a/apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.stories.ts +++ b/apps/web/src/app/layouts/product-switcher/navigation-switcher/navigation-switcher.stories.ts @@ -30,6 +30,8 @@ import { NavigationProductSwitcherComponent } from "./navigation-switcher.compon selector: "[mockOrgs]", standalone: false, }) +// FIXME(https://bitwarden.atlassian.net/browse/PM-28232): Use Directive suffix +// eslint-disable-next-line @angular-eslint/directive-class-suffix class MockOrganizationService implements Partial { private static _orgs = new BehaviorSubject([]); @@ -49,6 +51,8 @@ class MockOrganizationService implements Partial { selector: "[mockProviders]", standalone: false, }) +// FIXME(https://bitwarden.atlassian.net/browse/PM-28232): Use Directive suffix +// eslint-disable-next-line @angular-eslint/directive-class-suffix class MockProviderService implements Partial { private static _providers = new BehaviorSubject([]); diff --git a/apps/web/src/app/layouts/product-switcher/product-switcher.stories.ts b/apps/web/src/app/layouts/product-switcher/product-switcher.stories.ts index 4c6af71346..4581f5981e 100644 --- a/apps/web/src/app/layouts/product-switcher/product-switcher.stories.ts +++ b/apps/web/src/app/layouts/product-switcher/product-switcher.stories.ts @@ -30,6 +30,8 @@ import { ProductSwitcherService } from "./shared/product-switcher.service"; selector: "[mockOrgs]", standalone: false, }) +// FIXME(https://bitwarden.atlassian.net/browse/PM-28232): Use Directive suffix +// eslint-disable-next-line @angular-eslint/directive-class-suffix class MockOrganizationService implements Partial { private static _orgs = new BehaviorSubject([]); @@ -49,6 +51,8 @@ class MockOrganizationService implements Partial { selector: "[mockProviders]", standalone: false, }) +// FIXME(https://bitwarden.atlassian.net/browse/PM-28232): Use Directive suffix +// eslint-disable-next-line @angular-eslint/directive-class-suffix class MockProviderService implements Partial { private static _providers = new BehaviorSubject([]); diff --git a/eslint.config.mjs b/eslint.config.mjs index 7f9bb2284f..1e12e0e1e1 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -63,7 +63,7 @@ export default tseslint.config( // TODO: Enable these. "@angular-eslint/component-class-suffix": "error", "@angular-eslint/contextual-lifecycle": "error", - "@angular-eslint/directive-class-suffix": 0, + "@angular-eslint/directive-class-suffix": "error", "@angular-eslint/no-empty-lifecycle-method": 0, "@angular-eslint/no-input-rename": 0, "@angular-eslint/no-inputs-metadata-property": "error", diff --git a/libs/angular/src/auth/components/user-verification.component.ts b/libs/angular/src/auth/components/user-verification.component.ts index 1f0659a92f..a2cee2f109 100644 --- a/libs/angular/src/auth/components/user-verification.component.ts +++ b/libs/angular/src/auth/components/user-verification.component.ts @@ -24,6 +24,8 @@ import { KeyService } from "@bitwarden/key-management"; selector: "app-user-verification", standalone: false, }) +// FIXME(https://bitwarden.atlassian.net/browse/PM-28232): Use Directive suffix +// eslint-disable-next-line @angular-eslint/directive-class-suffix export class UserVerificationComponent implements ControlValueAccessor, OnInit, OnDestroy { private _invalidSecret = false; // FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals diff --git a/libs/angular/src/directives/cipherListVirtualScroll.directive.ts b/libs/angular/src/directives/cipherListVirtualScroll.directive.ts index 442e01c1c7..8e7b5cc204 100644 --- a/libs/angular/src/directives/cipherListVirtualScroll.directive.ts +++ b/libs/angular/src/directives/cipherListVirtualScroll.directive.ts @@ -45,6 +45,8 @@ export function _cipherListVirtualScrollStrategyFactory(cipherListDir: CipherLis }, ], }) +// FIXME(https://bitwarden.atlassian.net/browse/PM-28232): Use Directive suffix +// eslint-disable-next-line @angular-eslint/directive-class-suffix export class CipherListVirtualScroll extends CdkFixedSizeVirtualScroll { _scrollStrategy: CipherListVirtualScrollStrategy; diff --git a/libs/components/src/form-control/form-control.module.ts b/libs/components/src/form-control/form-control.module.ts index 2646f36ecd..d87284adbc 100644 --- a/libs/components/src/form-control/form-control.module.ts +++ b/libs/components/src/form-control/form-control.module.ts @@ -1,11 +1,11 @@ import { NgModule } from "@angular/core"; import { FormControlComponent } from "./form-control.component"; -import { BitHintComponent } from "./hint.component"; +import { BitHintDirective } from "./hint.directive"; import { BitLabelComponent } from "./label.component"; @NgModule({ - imports: [BitLabelComponent, FormControlComponent, BitHintComponent], - exports: [FormControlComponent, BitLabelComponent, BitHintComponent], + imports: [BitLabelComponent, FormControlComponent, BitHintDirective], + exports: [FormControlComponent, BitLabelComponent, BitHintDirective], }) export class FormControlModule {} diff --git a/libs/components/src/form-control/hint.component.ts b/libs/components/src/form-control/hint.directive.ts similarity index 90% rename from libs/components/src/form-control/hint.component.ts rename to libs/components/src/form-control/hint.directive.ts index c1f21bf254..110aefc30e 100644 --- a/libs/components/src/form-control/hint.component.ts +++ b/libs/components/src/form-control/hint.directive.ts @@ -9,6 +9,6 @@ let nextId = 0; class: "tw-text-muted tw-font-normal tw-inline-block tw-mt-1 tw-text-xs", }, }) -export class BitHintComponent { +export class BitHintDirective { @HostBinding() id = `bit-hint-${nextId++}`; } diff --git a/libs/components/src/form-field/form-field.component.ts b/libs/components/src/form-field/form-field.component.ts index 3d49a58b1f..10cf33b825 100644 --- a/libs/components/src/form-field/form-field.component.ts +++ b/libs/components/src/form-field/form-field.component.ts @@ -15,7 +15,7 @@ import { import { I18nPipe } from "@bitwarden/ui-common"; -import { BitHintComponent } from "../form-control/hint.component"; +import { BitHintDirective } from "../form-control/hint.directive"; import { BitLabelComponent } from "../form-control/label.component"; import { inputBorderClasses } from "../input/input.directive"; @@ -31,7 +31,7 @@ import { BitFormFieldControl } from "./form-field-control"; }) export class BitFormFieldComponent implements AfterContentChecked { readonly input = contentChild.required(BitFormFieldControl); - readonly hint = contentChild(BitHintComponent); + readonly hint = contentChild(BitHintDirective); readonly label = contentChild(BitLabelComponent); readonly prefixContainer = viewChild>("prefixContainer"); diff --git a/libs/components/src/switch/switch.component.ts b/libs/components/src/switch/switch.component.ts index 30e1ac59d4..a93e274e8b 100644 --- a/libs/components/src/switch/switch.component.ts +++ b/libs/components/src/switch/switch.component.ts @@ -13,7 +13,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms"; import { AriaDisableDirective } from "../a11y"; import { FormControlModule } from "../form-control/form-control.module"; -import { BitHintComponent } from "../form-control/hint.component"; +import { BitHintDirective } from "../form-control/hint.directive"; import { BitLabelComponent } from "../form-control/label.component"; let nextId = 0; @@ -56,7 +56,7 @@ export class SwitchComponent implements ControlValueAccessor, AfterViewInit { protected readonly disabled = model(false); protected readonly disabledReasonText = input(null); - private readonly hintComponent = contentChild(BitHintComponent); + private readonly hintComponent = contentChild(BitHintDirective); protected readonly disabledReasonTextId = `bit-switch-disabled-text-${nextId++}`; diff --git a/libs/components/src/table/table-scroll.component.ts b/libs/components/src/table/table-scroll.component.ts index fcdd401a1a..1ccb49a85e 100644 --- a/libs/components/src/table/table-scroll.component.ts +++ b/libs/components/src/table/table-scroll.component.ts @@ -35,7 +35,7 @@ import { TableComponent } from "./table.component"; @Directive({ selector: "[bitRowDef]", }) -export class BitRowDef { +export class BitRowDefDirective { constructor(public template: TemplateRef) {} } @@ -69,7 +69,7 @@ export class TableScrollComponent /** Optional trackBy function. */ readonly trackBy = input | undefined>(); - protected readonly rowDef = contentChild(BitRowDef); + protected readonly rowDef = contentChild(BitRowDefDirective); /** * Height of the thead element (in pixels). diff --git a/libs/components/src/table/table.module.ts b/libs/components/src/table/table.module.ts index 6899361277..5e44f60448 100644 --- a/libs/components/src/table/table.module.ts +++ b/libs/components/src/table/table.module.ts @@ -5,14 +5,14 @@ import { NgModule } from "@angular/core"; import { CellDirective } from "./cell.directive"; import { RowDirective } from "./row.directive"; import { SortableComponent } from "./sortable.component"; -import { BitRowDef, TableScrollComponent } from "./table-scroll.component"; +import { BitRowDefDirective, TableScrollComponent } from "./table-scroll.component"; import { TableBodyDirective, TableComponent } from "./table.component"; @NgModule({ imports: [ CommonModule, ScrollingModule, - BitRowDef, + BitRowDefDirective, CellDirective, RowDirective, SortableComponent, @@ -21,7 +21,7 @@ import { TableBodyDirective, TableComponent } from "./table.component"; TableScrollComponent, ], exports: [ - BitRowDef, + BitRowDefDirective, CellDirective, RowDirective, SortableComponent, diff --git a/libs/vault/src/directives/readonly-textarea.directive.ts b/libs/vault/src/directives/readonly-textarea.directive.ts index 65bd9d6e35..17c5f865fb 100644 --- a/libs/vault/src/directives/readonly-textarea.directive.ts +++ b/libs/vault/src/directives/readonly-textarea.directive.ts @@ -8,6 +8,8 @@ import { firstValueFrom } from "rxjs"; providers: [TextFieldModule], hostDirectives: [CdkTextareaAutosize], }) +// FIXME(https://bitwarden.atlassian.net/browse/PM-28232): Use Directive suffix +// eslint-disable-next-line @angular-eslint/directive-class-suffix export class VaultAutosizeReadOnlyTextArea implements AfterViewInit { constructor( @Host() private autosize: CdkTextareaAutosize,