These rules apply to work under frontend/.
This is a Vite + React + TypeScript app using TanStack Query, Tailwind CSS, Framer Motion, Radix UI-style components, MDX, and Zustand.
Use only scripts that exist in package.json:
npm run dev
npm run build
npm run lint
npm run preview
npm run build runs tsc -b && vite build, and postbuild runs node scripts/generate-sitemap.js.
There is currently no test script in package.json. Do not run or report npm test unless a test script is added.
After frontend changes, run:
npm run build
npm run lint
If either command cannot be run or fails, report the exact command and failure.
tsconfig.app.json enables strict, noUnusedLocals, noUnusedParameters, erasableSyntaxOnly, noFallthroughCasesInSwitch, and noUncheckedSideEffectImports.import type for type-only imports.src/types.ts before adding local duplicate types.FC; match nearby file style when editing.src/pages.src/components.react-router-dom route params and navigation patterns already present in src/App.tsx.encodeURIComponent.@tanstack/react-query for server state.src/lib/queryKeys.ts; add key builders there instead of using ad hoc arrays in components.src/lib, such as posts.ts, tags.ts, or wiki.ts.useQueryClient().invalidateQueries with the shared root keys when mutations affect cached lists or detail views.QueryClient is configured in src/main.tsx; do not create additional clients in feature code.src/lib/api.ts for HTTP calls.X-Transfer-Code from localStorage and converts non-blob responses to camelCase.responseType: 'blob' so the wrapper does not camelCase the body.@ alias points to frontend/src.@/... imports for app code instead of long relative paths.import type.src/**/*.{html,js,ts,jsx,tsx,mdx}.cn from src/lib/utils.ts for conditional class names and class merging.src/components/common, src/components/layout, and src/components/ui before adding new primitives.tailwind.config.js safelist if the class cannot be statically detected.@eslint/js, typescript-eslint, eslint-plugin-react-hooks, and eslint-plugin-react-refresh.react-refresh/only-export-components is enabled as a warning with allowConstantExport.dist/ output directly.node_modules/ unless explicitly needed.