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:
@@ -2,14 +2,14 @@
|
||||
export type TitleOrder = 'page-first' | 'site-first'
|
||||
|
||||
type ComposeTitleArgs = {
|
||||
/** Page-specific title, e.g. 'About Us'. */
|
||||
pageTitle?: string | null
|
||||
/** Site name, e.g. 'Acme Inc'. */
|
||||
siteName?: string | null
|
||||
/** Separator between page title and site name. Defaults to ' | '. */
|
||||
separator?: string
|
||||
/** Defaults to 'page-first' — the page title is what a visitor scans for. */
|
||||
order?: TitleOrder
|
||||
/** Page-specific title, e.g. 'About Us'. */
|
||||
pageTitle?: null | string
|
||||
/** Separator between page title and site name. Defaults to ' | '. */
|
||||
separator?: string
|
||||
/** Site name, e.g. 'Acme Inc'. */
|
||||
siteName?: null | string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,10 +24,10 @@ type ComposeTitleArgs = {
|
||||
* Pure function — no dependency on Payload or request state.
|
||||
*/
|
||||
export function composeTitle({
|
||||
pageTitle,
|
||||
siteName,
|
||||
separator = ' | ',
|
||||
order = 'page-first',
|
||||
pageTitle,
|
||||
separator = ' | ',
|
||||
siteName,
|
||||
}: ComposeTitleArgs): string {
|
||||
const page = pageTitle?.trim()
|
||||
const site = siteName?.trim()
|
||||
|
||||
Reference in New Issue
Block a user