1.6 KiB
1.6 KiB
Prepare CLAUDE CODE with Web Development Context
Task
Read the project’s CLAUDE.md. Ensure all web development rules below are present. If some are missing or partially present, reorganize and update CLAUDE.md so every rule is included clearly and unambiguously.
Web Development Rules
Language & Syntax
- Use TypeScript only (no plain JavaScript).
- Omit unnecessary semicolons—that is, do not add semicolons at statement ends unless required.
- Prefer arrow functions (
const f = () => ...) for concise, inline code and callbacks. Use function declarations for named or top-level functions wherethisor hoisting matters.
Typing & Imports
-
Always use explicit types, especially for function parameters and return values. Annotate returns and arguments when it improves readability.
-
Avoid
any. Useunknownor properly constrained generics instead—unknownforces safe type narrowing. -
Organize imports in this order:
react- third-party libraries
- local modules
-
Support absolute imports in
.ts/.tsxfiles, e.g.:import '@/components/MarkdownPreviewPanel'resolves to
src/components/MarkdownPreviewPanel.tsx.
React & Components
- In React components, always destructure
propsdirectly in function parameters. - Keep
README.mdupdated with essential information about React components—especially view or UI-related ones.
Documentation
- Document important functions, classes, and React components with inline docstrings or comments for clarity and maintainability.