Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### General

- Read `docs/CONTRIBUTING.md` for details on setting up the repository for development
- Unless stated otherwise, avoid Node.js
- Apply our latest coding style to every file changed
- Avoid spaghetti code: on new feature with a similar existing feature, refactor existing one before writing new feature
Expand All @@ -23,6 +24,9 @@
- Prefer uppercase for acronyms instead of Pascal case, e.g. `getURL()` over `getUrl()`
- The only exception is `id`, e.g. `getId()` over `getID()`
- Use fewer shorthands, only allow `min`, `max`, `num`
- All new/changed production code must have test cases, look at `__tests__/html2/**`
- Code coverage for new/changed code should reach 80%
- Deprecation notes should mark the date as 2 years from now

### Design

Expand All @@ -48,7 +52,11 @@
- Use `{ readonly value: string }` instead of `Readonly<{ value: string }>`
- Use as much `readonly` as possible

### React template
### React

- Always add `displayName`

Follow the template below.

```tsx
import { reactNode, validateProps } from '@msinternal/botframework-webchat-react-valibot';
Expand Down Expand Up @@ -100,6 +108,8 @@ export { MyComponentPropsSchema, type MyComponentProps };
- Use `@testduet/given-when-then` package instead of xUnit style `describe`/`before`/`test`/`after`
- Prefer integration/end-to-end testing than unit testing
- Use as realistic setup as possible, such as using `msw` than mocking calls
- MUST NOT modify/update any existing snapshots, let human review the test failures, they could be failing legitimately
- MUST NOT use `-u` to update snapshots, delete the snapshots and rerun `npm test` instead

## PR instructions

Expand Down
Loading