docs: 全文档合规检查与修正 - 代码示例规范/行数准确性/路径一致性/状态同步
This commit is contained in:
@@ -183,7 +183,7 @@ interface UserCardProps {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
export function UserCard({ user, onSelect, children }: UserCardProps) {
|
||||
export function UserCard({ user, onSelect, children }: UserCardProps): JSX.Element {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
@@ -291,7 +291,7 @@ import type { User } from "@/shared/types/permissions";
|
||||
import { UserList } from "@/modules/users/components/user-list";
|
||||
import { getUsers } from "@/modules/users/data-access";
|
||||
|
||||
export default async function UsersPage() {
|
||||
export default async function UsersPage(): Promise<JSX.Element> {
|
||||
const users = await getUsers();
|
||||
return <UserList users={users} />;
|
||||
}
|
||||
@@ -432,10 +432,10 @@ export type ActionState<T = void> = {
|
||||
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { z } from "zod";
|
||||
import { ActionState } from "@/shared/types/action-state";
|
||||
import { requirePermission, PermissionDeniedError } from "@/shared/lib/auth-guard";
|
||||
import { Permissions } from "@/shared/types/permissions";
|
||||
import { createExam, persistExamDraft } from "./data-access";
|
||||
import { createExam } from "./data-access";
|
||||
import type { ActionState } from "@/shared/types/action-state";
|
||||
|
||||
const ExamCreateSchema = z.object({
|
||||
title: z.string().min(1),
|
||||
@@ -749,12 +749,12 @@ export default eslintConfig;
|
||||
|
||||
### 15.2 Prettier
|
||||
|
||||
**建议配置**(`.prettierrc`,待创建):
|
||||
**当前配置**(`.prettierrc`):
|
||||
|
||||
```json
|
||||
{
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"singleQuote": false,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "all",
|
||||
"printWidth": 100,
|
||||
|
||||
Reference in New Issue
Block a user