form-validation by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill form-validation实现全面的表单验证,包括客户端验证、服务端同步以及具有 TypeScript 类型安全的实时错误反馈。
最小工作示例:
// types/form.ts
export interface LoginFormData {
email: string;
password: string;
rememberMe: boolean;
}
export interface RegisterFormData {
email: string;
password: string;
confirmPassword: string;
name: string;
terms: boolean;
}
// components/LoginForm.tsx
import { useForm, SubmitHandler } from 'react-hook-form';
import { LoginFormData } from '../types/form';
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
export const LoginForm: React.FC = () => {
const {
register,
handleSubmit,
// ... (完整实现请参阅参考指南)
references/ 目录下的详细实现:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 指南 | 内容 |
|---|---|
| React Hook Form with TypeScript | 使用 TypeScript 的 React Hook Form |
| Formik with Yup Validation | 使用 Yup 验证的 Formik |
| Vue Vee-Validate | Vue Vee-Validate |
| Custom Validator Hook | 自定义验证器钩子 |
| Server-Side Validation Integration | 服务端验证集成 |
每周安装数
129
代码仓库
GitHub 星标数
127
首次出现
2026年1月21日
安全审计
安装于
opencode107
gemini-cli104
codex100
claude-code97
cursor93
github-copilot82
Implement comprehensive form validation including client-side validation, server-side synchronization, and real-time error feedback with TypeScript type safety.
Minimal working example:
// types/form.ts
export interface LoginFormData {
email: string;
password: string;
rememberMe: boolean;
}
export interface RegisterFormData {
email: string;
password: string;
confirmPassword: string;
name: string;
terms: boolean;
}
// components/LoginForm.tsx
import { useForm, SubmitHandler } from 'react-hook-form';
import { LoginFormData } from '../types/form';
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
export const LoginForm: React.FC = () => {
const {
register,
handleSubmit,
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| React Hook Form with TypeScript | React Hook Form with TypeScript |
| Formik with Yup Validation | Formik with Yup Validation |
| Vue Vee-Validate | Vue Vee-Validate |
| Custom Validator Hook | Custom Validator Hook |
| Server-Side Validation Integration | Server-Side Validation Integration |
Weekly Installs
129
Repository
GitHub Stars
127
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode107
gemini-cli104
codex100
claude-code97
cursor93
github-copilot82
TanStack Query v5 完全指南:React 数据管理、乐观更新、离线支持
2,500 周安装