Lint: fix all ESLint errors (391 -> 0), lint and typecheck tests

Mostly perfectionist import/key sorting and curly braces from --fix, plus:
- spread instead of .apply() in the Meta Pixel stub
- non-capturing group in the locale-code pattern
- React 19 use(Context) / <Context value> in TurnstileProvider
- email regex rewritten without super-linear backtracking (covered by a test)
- console.warn/error allowed (deliberate server diagnostics)
- test/tsconfig.json so the project service and tsc see test files

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-15 23:56:18 +02:00
co-authored by Claude Opus 5.5
parent ce0a390351
commit 4544cac69c
48 changed files with 642 additions and 589 deletions
@@ -14,7 +14,7 @@ import { useState } from 'react'
export const TestEmailButton = () => {
const [to, setTo] = useState('')
const [status, setStatus] = useState<
{ kind: 'idle' } | { kind: 'sending' } | { kind: 'ok'; msg: string } | { kind: 'error'; msg: string }
{ kind: 'error'; msg: string } | { kind: 'idle' } | { kind: 'ok'; msg: string } | { kind: 'sending' }
>({ kind: 'idle' })
const send = async () => {
@@ -25,10 +25,10 @@ export const TestEmailButton = () => {
setStatus({ kind: 'sending' })
try {
const res = await fetch('/api/ipal/test-email', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ to: to.trim() }),
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
method: 'POST',
})
const data = await res.json()
if (data.ok) {
@@ -44,23 +44,23 @@ export const TestEmailButton = () => {
return (
<div className="field-type" style={{ marginTop: '1rem' }}>
<label className="field-label">Send a test email</label>
<p style={{ opacity: 0.7, fontSize: '.85rem', marginTop: 0 }}>
<p style={{ fontSize: '.85rem', marginTop: 0, opacity: 0.7 }}>
Sends through the transport selected above. Save your changes first.
</p>
<div style={{ display: 'flex', gap: '.5rem', alignItems: 'center', flexWrap: 'wrap' }}>
<div style={{ alignItems: 'center', display: 'flex', flexWrap: 'wrap', gap: '.5rem' }}>
<input
type="email"
placeholder="[email protected]"
value={to}
onChange={(e) => setTo(e.target.value)}
placeholder="[email protected]"
style={{ flex: 1, minWidth: '220px' }}
type="email"
value={to}
/>
<button
type="button"
onClick={send}
disabled={status.kind === 'sending'}
className="btn btn--style-secondary"
disabled={status.kind === 'sending'}
onClick={send}
style={{ whiteSpace: 'nowrap' }}
type="button"
>
{status.kind === 'sending' ? 'Sending…' : 'Send test'}
</button>