Files
AndreaSlopFotografie/web/eslint.config.js
T
SluijsensandClaude Sonnet 5.5 246ebe5fd6 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>
2026-11-15 17:34:18 +01:00

104 lines
3.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import js from '@eslint/js';
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(
{
ignores: [
'dist',
'coverage',
'.lighthouseci',
'lighthouse-reports',
'.agents',
'.claude',
'.junie',
'.tanstack',
'src/routeTree.gen.ts',
],
},
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
jsxA11y.flatConfigs.recommended,
],
languageOptions: {
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)
files: ['src/cms-client/**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['@/*'],
message: 'cms-client must not import from the app',
},
],
},
],
},
},
{
files: ['config/**/*.ts', 'e2e/**/*.ts', 'vitest.e2e.config.ts'],
languageOptions: {
globals: globals.node,
},
},
{
files: ['*.{js,cjs}'],
extends: [js.configs.recommended],
languageOptions: {
globals: globals.node,
},
},
);