Skip to content

Commit 96ec8a0

Browse files
further changes
1 parent a1f71b1 commit 96ec8a0

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/copilot-instructions.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Note: `npm run build` already runs lint.
2121

2222
Compiler and tooling settings are defined in `tsconfig.json` and `package.json`. Key conventions to follow:
2323

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
2425
* Prefer explicit types and avoid `any` in production code
2526
* Keep compliance with `noImplicitAny`, `noImplicitReturns`, `noUnusedLocals`, and `noUnusedParameters`
2627
* Respect `exactOptionalPropertyTypes`
@@ -30,14 +31,15 @@ Compiler and tooling settings are defined in `tsconfig.json` and `package.json`.
3031
* Keep the existing project copyright/license header at the top of TypeScript files under `src` and `scripts`.
3132
* For new source files under `src` or `scripts`, add the same copyright/license header format used by nearby files.
3233
* 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.
3335
* Do not remove or reformat license text unless intentionally updating headers repository-wide.
3436
* If a new source file is completely AI-generated, add `// generated with AI` directly after the header.
3537

3638
## Naming Conventions
3739

3840
* Variables and functions: `camelCase`
3941
* 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++)
4143
* File names should match exported functionality where applicable
4244

4345
## Architecture & Patterns
@@ -70,7 +72,6 @@ Compiler and tooling settings are defined in `tsconfig.json` and `package.json`.
7072
2. Internal modules
7173
* Avoid unused imports
7274
* Use consistent import style across the codebase
73-
* Follow lint-enforced style: 4-space indentation, single quotes, semicolons
7475
* Keep `eslint-disable` usage minimal, narrowly scoped, and justified when non-obvious
7576

7677
## Testing
@@ -96,7 +97,6 @@ Run the smallest relevant set first, then broaden when touching shared code:
9697

9798
## General Guidelines
9899

99-
* Follow existing patterns in the codebase
100100
* Maintain consistency with surrounding code
101101
* Do not introduce new libraries unless necessary
102102
* 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:
114114
## Notes for Copilot
115115

116116
* 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
117118
* Ensure all generated code builds, typechecks, and passes tests
118119
* 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

Comments
 (0)