feat: foundations for the manager conversion (platform-v2 step 6.1)
- Backend: every HTTPException in routers/ is an error code now (260 raises, ~105 new codes, texts in en + el); XeniaError(detail=...) keeps the three v1-shaped answers old pages read; bad / unknown tokens answer auth.session_ended; test_errors refuses new HTTPExceptions. - Manager: v2.json is the list of pages on the v2 rules: scripts/lint.mjs lints them, tests/v2-guards.test.mjs refuses Greek and colour literals, `strict` paths make set-state-in-effect an error. - src/live/useLiveQuery.js (react-query + live events + refresh on reconnect); Signed in now uses it. - Dead manager files removed (3.1k lines unreachable from main.jsx). - Tests: backend 544 passed, manager unit 33, run-all (no Android) passed (manager's live bell check passed on a rerun). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
// ESLint for the manager (plan step 2.99b): the waiter's rules (React Hooks 7, react-refresh).
|
||||
// `npm run lint` checks the code written or converted in platform v2 (the list in V2 below).
|
||||
// Older pages break these rules in places (e.g. setState in effects); phase 6 adds each page
|
||||
// to V2 as it converts it. `npx eslint src` shows everything.
|
||||
// `npm run lint` (scripts/lint.mjs) checks the code on the v2 rules: v2.json `paths`. Older pages
|
||||
// break these rules in places (e.g. setState in effects); phase 6 adds each page to v2.json as
|
||||
// it converts it. The `strict` paths load data with useLiveQuery / react-query, so setState in
|
||||
// an effect is an error there (6.1). `npx eslint src` shows everything.
|
||||
import { readFileSync } from 'node:fs'
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
|
||||
const v2 = JSON.parse(readFileSync(new URL('./v2.json', import.meta.url), 'utf8'))
|
||||
const strict = v2.strict.map(p => (/\.[jt]sx?$/.test(p) ? p : `${p}/**/*.{js,jsx}`))
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist', 'dev-dist']),
|
||||
{
|
||||
@@ -34,7 +39,11 @@ export default defineConfig([
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['tests/**/*.mjs', '*.config.js'],
|
||||
files: strict,
|
||||
rules: { 'react-hooks/set-state-in-effect': 'error' },
|
||||
},
|
||||
{
|
||||
files: ['tests/**/*.mjs', 'scripts/**/*.mjs', '*.config.js'],
|
||||
languageOptions: { globals: globals.node },
|
||||
},
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user