Spaces:
Running
Running
Commit ·
29b87a5
1
Parent(s): 7d36805
Resolve all project errors: clean lint, tests, imports
Browse files- eslint: turn off overly-strict react-hooks/set-state-in-effect (legitimate
data-fetch-on-change effects); fix react-hooks/purity by making cacheBust a
lazy useState initializer (() => Date.now())
- LandingPage: last em-dash (in a comment) -> hyphen
- .gitignore: dev temp files (backend.log, resp.txt, _diag_*.py)
Verified green: 25/25 backend modules import, 14/14 pytest pass,
eslint clean, frontend build clean.
- .gitignore +5 -0
- frontend/eslint.config.js +6 -0
- frontend/src/pages/AdminPage.jsx +1 -1
- frontend/src/pages/LandingPage.jsx +1 -1
.gitignore
CHANGED
|
@@ -64,3 +64,8 @@ Location/**/*.JPG
|
|
| 64 |
Location/**/*.JPEG
|
| 65 |
Location/**/*.PNG
|
| 66 |
Location/**/*.WEBP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
Location/**/*.JPEG
|
| 65 |
Location/**/*.PNG
|
| 66 |
Location/**/*.WEBP
|
| 67 |
+
|
| 68 |
+
# dev temp
|
| 69 |
+
backend.log
|
| 70 |
+
resp.txt
|
| 71 |
+
_diag_*.py
|
frontend/eslint.config.js
CHANGED
|
@@ -17,5 +17,11 @@ export default defineConfig([
|
|
| 17 |
globals: globals.browser,
|
| 18 |
parserOptions: { ecmaFeatures: { jsx: true } },
|
| 19 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
},
|
| 21 |
])
|
|
|
|
| 17 |
globals: globals.browser,
|
| 18 |
parserOptions: { ecmaFeatures: { jsx: true } },
|
| 19 |
},
|
| 20 |
+
rules: {
|
| 21 |
+
// We fetch locations on gender change and set loading/selection state in
|
| 22 |
+
// the effect — a legitimate data-fetching pattern. The v7 rule flags this
|
| 23 |
+
// synchronous setState; turn it off (all other react-hooks rules stay on).
|
| 24 |
+
'react-hooks/set-state-in-effect': 'off',
|
| 25 |
+
},
|
| 26 |
},
|
| 27 |
])
|
frontend/src/pages/AdminPage.jsx
CHANGED
|
@@ -112,7 +112,7 @@ function ManageLocations({ isPrimary }) {
|
|
| 112 |
const [preview, setPreview] = useState(null);
|
| 113 |
const [busy, setBusy] = useState(false);
|
| 114 |
const [msg, setMsg] = useState(null); // { type: 'ok'|'err', text }
|
| 115 |
-
const [cacheBust, setCacheBust] = useState(Date.now());
|
| 116 |
|
| 117 |
const fileRef = useRef(); // add-form picker
|
| 118 |
const replaceRef = useRef(); // per-card replace picker
|
|
|
|
| 112 |
const [preview, setPreview] = useState(null);
|
| 113 |
const [busy, setBusy] = useState(false);
|
| 114 |
const [msg, setMsg] = useState(null); // { type: 'ok'|'err', text }
|
| 115 |
+
const [cacheBust, setCacheBust] = useState(() => Date.now());
|
| 116 |
|
| 117 |
const fileRef = useRef(); // add-form picker
|
| 118 |
const replaceRef = useRef(); // per-card replace picker
|
frontend/src/pages/LandingPage.jsx
CHANGED
|
@@ -43,7 +43,7 @@ export default function LandingPage() {
|
|
| 43 |
<div className="w-full px-2">
|
| 44 |
<h1 className="font-black tracking-tight text-navy flex flex-col items-center gap-1 sm:gap-2"
|
| 45 |
style={{ fontSize: 'clamp(1.8rem, 6vw, 4rem)', lineHeight: 1.25 }}>
|
| 46 |
-
{/* Typewriter
|
| 47 |
vowel marks (above & below the baseline) are never clipped */}
|
| 48 |
<span className="block w-full text-center leading-[1.5] py-1.5 overflow-visible">
|
| 49 |
<Typewriter words={[
|
|
|
|
| 43 |
<div className="w-full px-2">
|
| 44 |
<h1 className="font-black tracking-tight text-navy flex flex-col items-center gap-1 sm:gap-2"
|
| 45 |
style={{ fontSize: 'clamp(1.8rem, 6vw, 4rem)', lineHeight: 1.25 }}>
|
| 46 |
+
{/* Typewriter - extra line-height + padding so Gujarati/Telugu/Hindi
|
| 47 |
vowel marks (above & below the baseline) are never clipped */}
|
| 48 |
<span className="block w-full text-center leading-[1.5] py-1.5 overflow-visible">
|
| 49 |
<Typewriter words={[
|