diff --git a/AGENTS.md b/AGENTS.md index 168db54..e4704c2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -122,6 +122,42 @@ Do not write or report `npm test` as a repository command unless a `test` script - Keep page-level code under `frontend/src/pages` and shared UI/feature code under `frontend/src/components` unless existing patterns point elsewhere. - Match existing Tailwind, component, and import alias conventions. +### Frontend TSX style + +- Preserve the local TSX formatting style. Do not normalize TSX to common Prettier-style React formatting unless explicitly asked. +- Prefer `const` arrow functions for TypeScript/TSX component and helper declarations. +- Put two blank lines before and after top-level `const` function declarations, unless imports, exports, or file boundaries make that awkward. +- In TSX, indent nested tag attributes with one tab relative to the tag line. With the project tab width, this visually appears as 4 spaces. +- Keep a tag's closing marker on the same line as the final prop when the tag spans multiple lines. Do not put `/>` or `>` on its own line unless the existing surrounding code does so. +- Keep JSX closing parentheses in the existing compact style, for example `)` rather than moving `)` onto a separate line. + +Preferred: + +```tsx +const PostFormTagsArea: FC = ({ tags, setTags, errors, ...rest }) => { + return ( +