@@ -15,7 +15,7 @@ applyTo: '**/*.ts'
1515## General Guardrails
1616
1717- Target TypeScript 5.x / ES2021 and prefer native features over polyfills.
18- - Use pure ES modules; never emit ` require ` , ` module.exports ` , or CommonJS helpers.
18+ - Use pure ES modules; always emit only ES module syntax, not ` require ` , ` module.exports ` , or CommonJS helpers.
1919- Rely on the project's build, lint, and test scripts unless asked otherwise.
2020- Note design trade-offs when intent is not obvious.
2121
@@ -25,7 +25,7 @@ applyTo: '**/*.ts'
2525- Use kebab-case filenames (e.g., ` user-session.ts ` , ` data-service.ts ` ) unless told otherwise.
2626- Keep tests, types, and helpers near their implementation when it aids discovery.
2727- Reuse or extend shared utilities when it reduces duplication and keeps responsibilities focused.
28- - Create new utilities when they serve a distinct purpose; avoid bloated "Utils" classes that mix unrelated concerns.
28+ - Create new utilities when they serve a distinct purpose; keep "Utils" classes focused on related concerns only .
2929
3030## Naming & Style
3131
@@ -46,7 +46,7 @@ applyTo: '**/*.ts'
4646- Use discriminated unions for real-time events and state machines.
4747- Centralise shared contracts instead of duplicating shapes.
4848- Express intent with TypeScript utility types (e.g., ` Readonly ` , ` Partial ` , ` Record ` ).
49- - Prefer ` type ` over ` interface ` for defining shapes; use ` interface ` only when a class must implement it.
49+ - Prefer ` type ` over ` interface ` for defining shapes; use ` interface ` when a class must implement it.
5050
5151## Async, Events & Error Handling
5252
@@ -68,13 +68,13 @@ applyTo: '**/*.ts'
6868## External Integrations
6969
7070- Instantiate clients outside hot paths and inject them for testability.
71- - Never hardcode secrets; load them from secure sources.
71+ - Always load secrets from secure sources instead of hardcoding them .
7272- Normalise external responses and map errors to domain shapes.
7373
7474## Security Practices
7575
7676- Validate and sanitise external input with schema validators or type guards.
77- - Avoid dynamic code execution and untrusted template rendering except on plugins.
77+ - Permit dynamic code execution and untrusted template rendering only on plugins.
7878- Encode untrusted content before rendering HTML; use framework escaping or trusted types.
7979- Use parameterised queries or prepared statements to block injection.
8080- Favor immutable flows and defensive copies for sensitive data.
@@ -96,7 +96,7 @@ applyTo: '**/*.ts'
9696
9797- Add or update unit tests with the project's framework and naming style.
9898- Expand integration or end-to-end suites when behavior crosses modules or platform APIs.
99- - Avoid brittle timing assertions; prefer fake timers or injected clocks.
99+ - Use fake timers or injected clocks instead of brittle timing assertions .
100100
101101## Performance & Reliability
102102
0 commit comments