Translation files, step 0: typed text helper, checks and the baseline of the pages
Adds src/i18n (t, tList, tPlural over typed Dutch JSON, key and parameter checks), the first text (back to top) as proof, a baseline tool for the prerendered pages (pnpm baseline:save and baseline:check), a lint warning for text typed straight into JSX, and docs/translations.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
||||
import react from 'eslint-plugin-react';
|
||||
|
||||
// Alleen regels die fouten vinden; opmaak is aan Prettier
|
||||
export default tseslint.config(
|
||||
@@ -31,6 +32,43 @@ export default tseslint.config(
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
{
|
||||
// Texts of the site live in the language files (src/i18n), not in the
|
||||
// JSX. Warning for now while the pages are moved over, an error when
|
||||
// that is done. Left out: the hero (becomes a CMS module), tests and
|
||||
// the build-only helpers.
|
||||
files: ['src/components/**/*.tsx', 'src/routes/**/*.tsx'],
|
||||
ignores: [
|
||||
'src/components/Hero/**',
|
||||
// The privacy statement is its own feature, not moved yet
|
||||
'src/routes/privacyverklaring.tsx',
|
||||
'**/*.test.tsx',
|
||||
'src/routeTree.gen.ts',
|
||||
],
|
||||
plugins: { react },
|
||||
rules: {
|
||||
'react/jsx-no-literals': [
|
||||
'warn',
|
||||
{
|
||||
noStrings: false,
|
||||
ignoreProps: true,
|
||||
// Technical signs that are not words
|
||||
allowedStrings: [
|
||||
'/',
|
||||
'|',
|
||||
'·',
|
||||
'–',
|
||||
'—',
|
||||
'×',
|
||||
'+',
|
||||
'-',
|
||||
':',
|
||||
'…',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
// The copied cms-client package stays headless: it may only import
|
||||
// react and its own files (also enforced by its boundary test)
|
||||
|
||||
Reference in New Issue
Block a user