TypeScript, React, and Next.js coding conventions for modern personal sites with Tailwind CSS and MDX. Emphasizes readability, latest features, and minimal dependencies.
Personal site & blog development conventions using Next.js, TypeScript, Tailwind CSS, and MDX.
**Example:**
```typescript
type ButtonProps = {
label: string;
onClick: () => void;
}
export function Button({ label, onClick }: ButtonProps) {
// Component logic
}
```
**Good:**
```typescript
export function UserProfile({ user }: UserProfileProps) {
if (!user) {
return <EmptyState />
}
return <ProfileCard user={user} />
}
```
**Avoid:**
```typescript
export function UserProfile({ user }: UserProfileProps) {
return user ? <ProfileCard user={user} /> : <EmptyState />
}
```
**Example:**
```typescript
async function fetchPosts() {
try {
const response = await fetch('/api/posts')
const data = await response.json()
return data
} catch (error) {
console.error('Failed to fetch posts:', error)
}
}
```
1. **Preserve comments** - When refactoring code, keep existing comments intact
2. **Minimal dependencies** - Avoid third-party libraries if native solutions exist
3. **Readability over optimization** - Prefer linear, readable code over micro-optimizations
4. **Modern approaches** - Choose latest patterns when multiple solutions exist
5. **Descriptive naming** - Use clear, descriptive names for variables, functions, and components
6. **Latest versions** - Always use the most recent stable versions of libraries
This guide optimizes for developer experience, code maintainability, and modern JavaScript ecosystem standards while building content-driven sites with Next.js.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/gouravio-nextjs-style-guide/raw