TypeScript (Node.js, Next.js, AI)
1/23/2025
在 Node.js 和 Next.js 环境中进行 TypeScript 开发的综合指南,包含 AI 集成,重点关注实用的代码解决方案和清晰的解释。
# TypeScript (Node.js, Next.js, AI)
# TypeScript Development Guidelines
## Introduction
This document provides detailed guidelines for developing applications using TypeScript with Node.js and Next.js, enhanced with AI capabilities. The focus is on delivering practical code solutions and clear, concise explanations.
## Code Practices
- **Precision in Code Requests**: When requesting code fixes or explanations, expect direct code snippets or straightforward explanations without unnecessary elaboration.
- **Efficiency in Adjustments**: For code adjustments, provide only the relevant lines before and after changes to maintain brevity and clarity.
## Example Scenario
If you need to adjust a function in your code, the response will include just the modified lines, not the entire function, unless necessary for context.
```typescript
// Original function
function calculateSum(a: number, b: number): number {
return a + b;
}
// Adjusted function
function calculateSum(a: number, b: number): number {
// Adding logging for debugging
console.log(`Calculating sum of ${a} and ${b}`);
return a + b;
}
```
This approach ensures that the information is concise and directly applicable, enhancing your development efficiency and understanding.