Loading...
Loading...
Use when initializing a new Vite + React (CSR) project or when an existing Vite React project needs missing configuration (ESLint, Prettier, TanStack Query, React Router, Zustand, Tailwind CSS, VSCode, Cursor, Antigravity settings, path aliases).
npx skill4agent add parkyoungwoong/skills react-vite-scaffold| 확인 대상 | 감지 방법 |
|---|---|
| 빈 디렉토리 여부 | 현재 디렉토리에 파일이 없거나 |
| Vite 프로젝트 | |
| TypeScript | |
| TanStack Query | |
| React Router | |
| Zustand | |
| Tailwind CSS | |
| ESLint 구성 | |
| Prettier 구성 | |
| VSCode 설정 | |
| 패키지 매니저 | |
{pm} create vite@latest .은 패키지 매니저 감지 규칙에 따라 결정된 패키지 매니저로 대체한다. (npm, pnpm, yarn, bun){pm}
.claude/{pm} install -D tailwindcss @tailwindcss/vitevite.config.tsimport { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [
react(),
tailwindcss()
],
resolve: {
alias: [
{ find: '@', replacement: '/src' }
]
}
})src/index.css@import 'tailwindcss';vite.config.tsresolve.aliasresolve: {
alias: [
{ find: '@', replacement: '/src' }
]
}tsconfig.app.json{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}{pm} install -D prettier eslint-config-prettier eslint-plugin-prettier prettier-plugin-tailwindcsseslint.config.jsimport prettierRecommended from 'eslint-plugin-prettier/recommended'
export default defineConfig([
{
extends: [
prettierRecommended
]
}
])extendsimport prettierRecommended from 'eslint-plugin-prettier/recommended'
import tanstackQuery from '@tanstack/eslint-plugin-query'
export default defineConfig([
{
extends: [
prettierRecommended,
tanstackQuery.configs.recommended
]
}
])| 패키지 | 설명 |
|---|---|
| ESLint 코어 패키지 (Vite에 포함) |
| Prettier 코어 패키지 |
| React 문법 분석 및 검사 (Vite에 포함) |
| ESLint와 Prettier의 충돌 방지 |
| Prettier 규칙을 ESLint 규칙으로 통합 |
| React Hooks 규칙 강제 (Vite에 포함) |
| React Refresh 규칙 (Vite에 포함) |
| Tailwind CSS 클래스 자동 정렬 |
| TanStack Query 규칙 (TanStack Query 사용 시) |
.prettierrc{
"semi": false,
"singleQuote": true,
"singleAttributePerLine": true,
"bracketSameLine": true,
"endOfLine": "auto",
"trailingComma": "none",
"arrowParens": "avoid",
"plugins": ["prettier-plugin-tailwindcss"]
}.vscode/settings.json{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}@tanstack/react-querypackage.json{pm} install @tanstack/react-query
{pm} install -D @tanstack/eslint-plugin-queryeslint.config.jssrc/App.tsximport { QueryClient, QueryClientProvider } from '@tanstack/react-query'
const queryClient = new QueryClient()
export default function App() {
return (
<QueryClientProvider client={queryClient}>
{/* 기존 컴포넌트 */}
</QueryClientProvider>
)
}react-routerpackage.json{pm} install react-routersrc/routes/index.tsximport { createBrowserRouter, RouterProvider } from 'react-router'
import Home from './pages/Home'
import About from './pages/About'
const router = createBrowserRouter([
{
path: '/',
element: <Home />
},
{
path: '/about',
element: <About />
}
])
export default function Router() {
return <RouterProvider router={router} />
}src/routes/pages/Home.tsxexport default function Home() {
return <h1>Home</h1>
}src/routes/pages/About.tsxexport default function About() {
return <h1>About</h1>
}src/main.tsxRouterimport { createRoot } from 'react-dom/client'
import Router from './routes'
createRoot(document.getElementById('root')!).render(<Router />)zustandpackage.json{pm} install zustandsrc/store/example.tsimport { create } from 'zustand'
interface ExampleStore {
count: number
increase: () => void
decrease: () => void
}
export const useExampleStore = create<ExampleStore>(set => ({
count: 0,
increase: () => set(state => ({ count: state.count + 1 })),
decrease: () => set(state => ({ count: state.count - 1 }))
}))pnpm-lock.yamlpnpmyarn.lockyarnbun.lockbbun.lockbunpackage-lock.jsonnpmnpm