add guidance for Copilot on code style and testing practices

This commit is contained in:
Göran Sander
2025-09-24 20:28:44 +02:00
parent d48e98d1a2
commit 62da06ad3d
3 changed files with 37 additions and 11 deletions

View File

@@ -2,19 +2,22 @@
applyTo: '**'
---
# Formatting and indentention of files
# copilot-instructions.md
DO NOT fix code indentation or formatting as part of work done by Copilot.
Other tools will handle that.
This file provides guidance to Copilot when working with code in this repository.
# JSDoc comments
## 📚 Onboarding
- Describe what the function does
- List all paramters, including (if possible) what properties object parameters have
- List possible return values, including Primises and data types. Insert empty line between parameters and return value descriptions.
At the start of each session, read:
# Unit tests
1. Any `**/README.md` docs across the project
2. Any `**/README.*.md` docs across the project
- Verify tests work after creation new test files.
- Do not fix linting or formatting issues in tests. These will be handled later using other tools.
- Run tests using "npm run test".
## ✅ Quality Gates
When writing code, Copilot must not finish until all of these succeed:
1. `npm run lint:fix`
2. All unit tests (`npm run test`) pass
If any check fails, fix the issues and run checks again.

14
docs/README.codestyle.md Normal file
View File

@@ -0,0 +1,14 @@
# README.codestyle.md
This file provides guidance to Copilot about code style and conventions in this repository.
## Formatting and indentation of files
DO NOT fix code indentation or formatting as part of work done by Copilot.
Other tools will handle that.
## JSDoc comments
- Describe what the function does
- List all parameters, including (if possible) what properties object parameters have
- List possible return values, including Promises and data types. Insert empty line between parameters and return value descriptions.

9
docs/README.testing.md Normal file
View File

@@ -0,0 +1,9 @@
# README.testing.md
This file provides guidance to Copilot about testing practices in this repository.
## Unit tests
- Verify tests work after creation new test files.
- Do not fix linting or formatting issues in tests. These will be handled later using other tools.
- Run tests using "npm run test".