Files
Nitro-V3/package.json
T
simoleo89 a029ee63cb fix(catalog,ci): catch hook-order violations + add CI gate
Two follow-ups to the CatalogPurchaseWidgetView fix (6bf3366):

1. CatalogItemGridWidgetView had the same shape — four useCallback
   declarations (handleDragStart / handleDragOver / handleDrop /
   handleDragEnd) sat below an `if(!currentPage) return null` early
   return. When currentPage flipped from null to a real page the hook
   count jumped by 4 and React would have thrown "Rendered more hooks
   than during the previous render" the moment any consumer rendered
   the grid in admin mode. Moved the four useCallback declarations
   above the early-return; their bodies are safe pre-load (only
   currentPage?.offers is accessed inside handleDrop, optional-chained
   already).

2. CI gate — the existing GitHub Actions workflow runs `yarn
   typecheck` and `yarn test`, but NOT `yarn eslint`. That's why this
   pattern slipped through twice in a row: ESLint flags it locally
   but no PR check enforces it. Full `yarn eslint` emits ~900
   pre-existing baseline errors (brace-style, indentation,
   recommended TS rules — out of scope for this branch), so a blanket
   step would always fail. Instead added a focused
   `eslint.hooks.config.mjs` + `yarn lint:hooks` script that runs
   ESLint with ONLY `react-hooks/rules-of-hooks: error`. Wired into
   ci.yml between `typecheck` and `test`. The local repo now has
   zero violations of the rule.

3. useSessionSnapshots.test.tsx — added eslint-disable-next-line
   comments on the three lines that intentionally violate the rule
   (they're the assertions that the broken pattern crashes). Without
   the comments the new CI gate would fail on the regression-guard
   suite.

Verification: yarn lint:hooks green, yarn typecheck clean, yarn test
209/209.
2026-05-19 17:57:28 +02:00

73 lines
2.6 KiB
JSON

{
"name": "nitro-react",
"version": "2.2",
"homepage": ".",
"private": true,
"scripts": {
"configure": "node scripts/configure-json.mjs",
"prestart": "node scripts/configure-json.mjs --if-missing",
"prebuild": "node scripts/configure-json.mjs --if-missing && node scripts/write-asset-loader.mjs",
"start": "vite --host",
"build": "vite build && node scripts/minify-dist.mjs",
"build:prod": "npx browserslist@latest --update-db && yarn build",
"preview": "vite preview --host",
"eslint": "eslint ./src",
"lint:hooks": "eslint --config eslint.hooks.config.mjs ./src",
"typecheck": "tsgo --noEmit",
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@babel/runtime": "^7.29.2",
"@emoji-mart/data": "^1.2.1",
"@emoji-mart/react": "^1.1.1",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-slider": "^1.3.6",
"@tanstack/react-query": "5",
"@tanstack/react-query-devtools": "5",
"@tanstack/react-virtual": "^3.13.24",
"dompurify": "^3.4.2",
"emoji-mart": "^5.6.0",
"emoji-toolkit": "10.0.0",
"framer-motion": "^12.38.0",
"json5": "^2.2.3",
"react": "^19.2.5",
"react-colorful": "^5.7.0",
"react-dom": "^19.2.5",
"react-error-boundary": "^6.1.1",
"react-icons": "^5.6.0",
"react-player": "^2.16.0",
"use-between": "^1.4.0",
"zustand": "^5.0.13"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/postcss": "^4.2.4",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/node": "^25.6.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.59.1",
"@typescript-eslint/parser": "^8.59.1",
"@typescript/native-preview": "^7.0.0-dev.20260509.2",
"@vitejs/plugin-react": "^6.0.1",
"babel-plugin-react-compiler": "^1.0.0",
"eslint": "^10.2.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-compiler": "19.1.0-rc.2",
"eslint-plugin-react-hooks": "^7.1.1",
"jsdom": "^29.1.1",
"postcss": "^8.5.12",
"postcss-nested": "^7.0.2",
"sass": "^1.99.0",
"sirv": "^3.0.2",
"tailwindcss": "^4.2.4",
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.1",
"vite": "^8.0.10",
"vitest": "^3"
}
}