chore: Enforce a few house rules via eslint (#2539)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent 5572ec728e
commit 921d45e577
100 changed files with 479 additions and 295 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ Commands: `yarn install`, `yarn run build`, `yarn run test`, `yarn run coverage`
## Code Style
- Conventional Commits (used by semantic-release).
- Comments explain **why**, not what — only when intent isn't obvious from code.
- Comments explain **why**, not what -- only when intent isn't obvious from code.
## TypeScript
@@ -32,7 +32,7 @@ Commands: `yarn install`, `yarn run build`, `yarn run test`, `yarn run coverage`
## Architecture
- Consolidate duplicate logic when adding helpers; don't leave redundant inline expressions.
- **Naming consistency:** Renames span all layers — schema, types, CSS, localization keys, templates, docs. All schema fields must appear in the documentation table.
- **Naming consistency:** Renames span all layers -- schema, types, CSS, localization keys, templates, docs. All schema fields must appear in the documentation table.
- **Separation of concerns:** `components/` renders only; logic in `components-lib/` controllers (using `ReactiveController` where needed).
- **Manager pattern:** `CardController` orchestrates managers (`ConfigManager`, `HASSManager`, `ViewManager`, etc.). New cross-cutting concerns → new manager.
- **Module conventions:** `types.ts` for types/schemas, `*-manager.ts` for coordinators, `*-controller.ts` for logic, `utils/` for helpers.
@@ -40,7 +40,7 @@ Commands: `yarn install`, `yarn run build`, `yarn run test`, `yarn run coverage`
## Preferences
- Think through UX states and edge cases **before** writing code.
- No re-exports or pass-through files — import from source directly.
- No re-exports or pass-through files -- import from source directly.
- Derive TypeScript types from Zod schemas (`z.infer<typeof schema>`); no parallel interfaces.
- User-facing schemas: only user-configurable fields. Internal fields go in a derived interface (`interface InternalFoo extends Foo { ... }`).
- Shared schemas go in `config/schema/common/` from the start.