470a67607bf528ddcc3dcb0d2a7ea59548874aba
react-hooks/set-state-in-effect and react-hooks/purity had been demoted to warnings "so CI passes", and CI ran without --max-warnings 0, so all 22 violations were invisible there. Both rules are back at error. - Confetti is rolled once per mount instead of during render, where it re-rolled on every re-render and made pieces visibly jump. - Loading flags are derived from a "last settled request" key rather than set synchronously inside an effect. That also adds the cancellation these fetches were missing, so a resolved request can no longer write into a unmounted or superseded view. - Effect dependency arrays corrected; the two eslint-disable-line comments in Profile.tsx are gone, and the split of its two effects removes the guard that silently never re-ran. - GameCompletionModal derives visibility from status instead of mirroring it into state, with a ref so the sound and localStorage write fire once. - ValidationFeedback adjusts state during render, the documented pattern, instead of paying an extra committed render per link. - The three react-refresh suppressions in ui/ are resolved properly by extracting the variants into their own modules, so the component files export only components. badgeVariants had no consumers and is no longer exported. - Drops a stale eslint-disable directive in sw.js. The lint script now fails on warnings so this cannot quietly regress.
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
Languages
TypeScript
97.7%
CSS
0.8%
JavaScript
0.7%
Shell
0.4%
Dockerfile
0.2%
Other
0.2%