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
+8 -7
View File
@@ -2,11 +2,10 @@ import type { BasePayload } from 'payload'
import type { ContentOption } from '../content/index.js'
import type { I18nConfig } from '../i18n/index.js'
import type { ClientIpOptions } from '../shared/rateLimit.js'
import { createMarkdownRenderer, searchContent } from '../content/index.js'
import { getDefaultLocale, isValidLocale } from '../i18n/index.js'
import type { ClientIpOptions } from '../shared/rateLimit.js'
import { clientIp, consumeRateLimit, tooManyRequests } from '../shared/rateLimit.js'
/**
@@ -249,11 +248,13 @@ export function createMcpRoute(args: CreateMcpRouteArgs) {
}
// No server→client SSE stream in this read-only server.
async function GET(): Promise<Response> {
return new Response('Method Not Allowed — POST JSON-RPC to this endpoint.', {
headers: { allow: 'POST' },
status: 405,
})
function GET(): Promise<Response> {
return Promise.resolve(
new Response('Method Not Allowed — POST JSON-RPC to this endpoint.', {
headers: { allow: 'POST' },
status: 405,
}),
)
}
return { GET, POST }