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
Copy file name to clipboardExpand all lines: CLAUDE.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,10 +62,13 @@ Payload is a monorepo structured around Next.js, containing the core CMS platfor
62
62
- Use JSDoc for complex functions; add tags only when justified beyond type signature
63
63
- Use `import type` for types, regular `import` for values, separate statements even from same module
64
64
- Prefix booleans with `is`/`has`/`can`/`should` (e.g., `isValid`, `hasData`) for clarity
65
+
- Prefer self describing function and variable names over generic names with comments to explain their purpose
65
66
- Commenting Guidelines
67
+
66
68
- Execution flow: Skip comments when code is self-documenting. Keep for complex logic, non-obvious "why", multi-line context, or if following a documented, multi-step flow.
67
69
- Top of file/module: Use sparingly; only for non-obvious purpose/context or an overview of complex logic.
68
70
- Type definitions: Property/interface documentation is always acceptable.
71
+
69
72
- Logger Usage (`payload.logger.error`)
70
73
- Valid: `payload.logger.error('message')` or `payload.logger.error({ msg: '...', err: error })`
71
74
- Invalid: `payload.logger.error('message', err)` - don't pass error as second argument
@@ -146,6 +149,8 @@ Screenshots are saved to `.playwright-mcp/` and displayed inline.
146
149
- If you create a database record in a test, you MUST delete it before the test completes
147
150
- For multiple tests with similar cleanup needs, use `afterEach` to centralize cleanup logic
148
151
- Track created resources (IDs, files, etc.) in a shared array within the `describe` block
152
+
- Do not use conditionals in tests where it can be avoided such as `if else`
153
+
- Do not use `try {} finally {}` in e2e tests; prefer Playwright cleanup hooks (`afterEach`, `afterAll`)
0 commit comments