Skip to content

Commit bf81bb6

Browse files
committed
docs: update React & add TypeScript inst. for project structure
- Added TypeScript instructions to clarify pnpm usage and directory conventions. - Updated React instructions for consistency and added form, skeleton, and code-style requirements. Generated-by: aiautocommit
1 parent 031db2e commit bf81bb6

4 files changed

Lines changed: 52 additions & 30 deletions

File tree

.cursor/rules/react.mdc

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ globs: *.tsx
44
alwaysApply: false
55
---
66

7-
1. Do not write any backend code. Just frontend logic.
8-
2. For any backend requirements, create mock responses. Use a function to return mock data so I can easily swap it out later.
9-
3. When creating mock data, always specify it in a dedicated `mock.ts` file
10-
4. Load mock data using a react router `clientLoader`. Use the Skeleton component to present a loading state.
11-
5. Store components for each major page or workflow in `src/components/$WORKFLOW_OR_PAGE_NAME`.
12-
6. Use lowercase dash separated words for file names.
13-
8. Use React 19, TypeScript, Tailwind CSS, and ShadCN components.
14-
9. Prefer functional components, hooks over classes.
15-
10. Break up large components into smaller components, but keep them in the same file unless they can be generalized.
16-
11. Put any "magic" strings like API keys, hosts, etc into a "constants.ts" file.
17-
12. Only use a separate interface for component props if there are more than 4 props.
18-
13. Internally, store all currency values as integers and convert them to floats when rendering visually
19-
14. use `pnpm` not `npm`
20-
15. Node libraries are not available
21-
16. Never edit the `components/ui/*.tsx` files
7+
- Do not write any backend code. Just frontend logic.
8+
- For any backend requirements, create mock responses. Use a function to return mock data so I can easily swap it out later.
9+
- When creating mock data, always specify it in a dedicated `mock.ts` file
10+
- Load mock data using a react router `clientLoader`. Use the Skeleton component to present a loading state.
11+
- If a complex skeleton is needed, create a component function `LoadingSkeleton` in the same file.
12+
- Store components for each major page or workflow in `src/components/$WORKFLOW_OR_PAGE_NAME`.
13+
- Use lowercase dash separated words for file names.
14+
- Use React 19, TypeScript, Tailwind CSS, and ShadCN components.
15+
- Prefer functional components, hooks over classes.
16+
- Break up large components into smaller components, but keep them in the same file unless they can be generalized.
17+
- Put any "magic" strings like API keys, hosts, etc into a "constants.ts" file.
18+
- Only use a separate interface for component props if there are more than 4 props.
19+
- Internally, store all currency values as integers and convert them to floats when rendering visually
20+
- Never edit the `components/ui/*.tsx` files
21+
- When building forms use React Hook Form.
22+
- Include a two line breaks between any `useHook()` calls and any `useState()` definitions for a component.
23+

.cursor/rules/typescript.mdc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description:
3+
globs: *.ts
4+
alwaysApply: false
5+
---
6+
7+
- Use `pnpm`, not `npm`
8+
- Node libraries are not available
9+
- Use `lib/` for generic code, `utils/` for project utilities, `hooks/` for React hooks, and `helpers/` for page-specific helpers.
10+

.github/instructions/react.instructions.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
applyTo: "**/*.tsx"
33
---
44

5-
1. Do not write any backend code. Just frontend logic.
6-
2. For any backend requirements, create mock responses. Use a function to return mock data so I can easily swap it out later.
7-
3. When creating mock data, always specify it in a dedicated `mock.ts` file
8-
4. Load mock data using a react router `clientLoader`. Use the Skeleton component to present a loading state.
9-
5. Store components for each major page or workflow in `src/components/$WORKFLOW_OR_PAGE_NAME`.
10-
6. Use lowercase dash separated words for file names.
11-
8. Use React 19, TypeScript, Tailwind CSS, and ShadCN components.
12-
9. Prefer functional components, hooks over classes.
13-
10. Break up large components into smaller components, but keep them in the same file unless they can be generalized.
14-
11. Put any "magic" strings like API keys, hosts, etc into a "constants.ts" file.
15-
12. Only use a separate interface for component props if there are more than 4 props.
16-
13. Internally, store all currency values as integers and convert them to floats when rendering visually
17-
14. use `pnpm` not `npm`
18-
15. Node libraries are not available
19-
16. Never edit the `components/ui/*.tsx` files
5+
- Do not write any backend code. Just frontend logic.
6+
- For any backend requirements, create mock responses. Use a function to return mock data so I can easily swap it out later.
7+
- When creating mock data, always specify it in a dedicated `mock.ts` file
8+
- Load mock data using a react router `clientLoader`. Use the Skeleton component to present a loading state.
9+
- If a complex skeleton is needed, create a component function `LoadingSkeleton` in the same file.
10+
- Store components for each major page or workflow in `src/components/$WORKFLOW_OR_PAGE_NAME`.
11+
- Use lowercase dash separated words for file names.
12+
- Use React 19, TypeScript, Tailwind CSS, and ShadCN components.
13+
- Prefer functional components, hooks over classes.
14+
- Break up large components into smaller components, but keep them in the same file unless they can be generalized.
15+
- Put any "magic" strings like API keys, hosts, etc into a "constants.ts" file.
16+
- Only use a separate interface for component props if there are more than 4 props.
17+
- Internally, store all currency values as integers and convert them to floats when rendering visually
18+
- Never edit the `components/ui/*.tsx` files
19+
- When building forms use React Hook Form.
20+
- Include a two line breaks between any `useHook()` calls and any `useState()` definitions for a component.
21+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
applyTo: "**/*.ts"
3+
---
4+
5+
- Use `pnpm`, not `npm`
6+
- Node libraries are not available
7+
- Use `lib/` for generic code, `utils/` for project utilities, `hooks/` for React hooks, and `helpers/` for page-specific helpers.
8+

0 commit comments

Comments
 (0)