1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-06 19:53:59 +00:00

Moved enums adr

This commit is contained in:
Anders Åberg
2026-01-15 13:22:41 +01:00
parent 91e3b7af8c
commit 9a9ce571fd
2 changed files with 16 additions and 16 deletions

View File

@@ -291,6 +291,22 @@ describe("MyComponent", () => {
| Constants | SCREAMING_SNAKE_CASE | `MAX_RETRY_COUNT` |
| Observables | camelCase with `$` suffix | `ciphers$` |
### No TypeScript Enums (ADR-0025):
```typescript
// ✅ Correct
export const CipherType = Object.freeze({
Login: 1,
SecureNote: 2,
} as const);
export type CipherType = (typeof CipherType)[keyof typeof CipherType];
// ❌ Wrong - don't add new enums
enum CipherType {
Login = 1,
}
```
## Anti-Patterns
### DO

View File

@@ -24,22 +24,6 @@ constructor() {
Use Angular Signals only in components and presentational services. Use RxJS for cross-client services and complex reactive workflows.
## No TypeScript Enums (ADR-0025):
```typescript
// ✅ Correct
export const CipherType = Object.freeze({
Login: 1,
SecureNote: 2,
} as const);
export type CipherType = (typeof CipherType)[keyof typeof CipherType];
// ❌ Wrong - don't add new enums
enum CipherType {
Login = 1,
}
```
## Component Change Detection
Use `OnPush` change detection strategy for all components.