diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 5ef17b59..037353b8 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -106,6 +106,31 @@ export default defineConfig( ] } }, + { + // Forbid test fixtures (*.test-fixture.svelte) from being imported by + // production code. Tree-shaking keeps them out of the production bundle + // today (no route reaches them), but a lint rule makes the boundary + // explicit so an accidental autocomplete import in a route or component + // fails fast. Test files (*.spec.ts / *.test.ts) and the fixtures + // themselves are exempt — see the next block. Nora #2 on PR #629 + // round 3. + files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js', '**/*.ts'], + ignores: ['**/*.spec.ts', '**/*.test.ts', '**/*.test-fixture.svelte'], + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: [ + { + group: ['**/*.test-fixture.svelte'], + message: + 'Test fixtures (*.test-fixture.svelte) are test-only — do not import from production code. Tracked by #637.' + } + ] + } + ] + } + }, { plugins: { boundaries }, settings: {