You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiler and tooling settings are defined in `tsconfig.json` and `package.json`. Key conventions to follow:
23
23
24
+
* Generated code must comply with the project's ESLint and TypeScript rules from the start — do not rely on the linter or formatter to fix style after the fact
24
25
* Prefer explicit types and avoid `any` in production code
25
26
* Keep compliance with `noImplicitAny`, `noImplicitReturns`, `noUnusedLocals`, and `noUnusedParameters`
26
27
* Respect `exactOptionalPropertyTypes`
@@ -30,14 +31,15 @@ Compiler and tooling settings are defined in `tsconfig.json` and `package.json`.
30
31
* Keep the existing project copyright/license header at the top of TypeScript files under `src` and `scripts`.
31
32
* For new source files under `src` or `scripts`, add the same copyright/license header format used by nearby files.
32
33
* When editing a file, update the copyright header year or year range if it is outdated.
34
+
A single year becomes a range (e.g. `2025` -> `2025-2026`); an existing range extends to the current year.
33
35
* Do not remove or reformat license text unless intentionally updating headers repository-wide.
34
36
* If a new source file is completely AI-generated, add `// generated with AI` directly after the header.
35
37
36
38
## Naming Conventions
37
39
38
40
* Variables and functions: `camelCase`
39
41
* Classes, interfaces, and types: `PascalCase`
40
-
* Constants: `UPPER_SNAKE_CASE` for stable constants
42
+
* Constants: `UPPER_SNAKE_CASE` for module-level or static readonly values that act as fixed configuration (analogous to `#define` in C/C++)
41
43
* File names should match exported functionality where applicable
42
44
43
45
## Architecture & Patterns
@@ -70,7 +72,6 @@ Compiler and tooling settings are defined in `tsconfig.json` and `package.json`.
70
72
2. Internal modules
71
73
* Avoid unused imports
72
74
* Use consistent import style across the codebase
73
-
* Follow lint-enforced style: 4-space indentation, single quotes, semicolons
74
75
* Keep `eslint-disable` usage minimal, narrowly scoped, and justified when non-obvious
75
76
76
77
## Testing
@@ -96,7 +97,6 @@ Run the smallest relevant set first, then broaden when touching shared code:
96
97
97
98
## General Guidelines
98
99
99
-
* Follow existing patterns in the codebase
100
100
* Maintain consistency with surrounding code
101
101
* Do not introduce new libraries unless necessary
102
102
* Keep changes focused on the task; avoid unrelated changes, but do not shy away from refactoring internal APIs when it leads to a cleaner design
@@ -114,5 +114,7 @@ When guidelines conflict, apply this priority order:
114
114
## Notes for Copilot
115
115
116
116
* Align with existing project structure and patterns, but flag and fix poor patterns rather than reproducing them
117
+
* When unsure, prioritize correctness and type safety over consistency
117
118
* Ensure all generated code builds, typechecks, and passes tests
118
119
* Prefer existing helpers/factories/utilities over duplicating logic
120
+
* When a fix touches shared or upstream code, prefer improving the shared API over patching around it locally
0 commit comments