generated from coulomb/repo-seed
T01 Toolchain — vite + pnpm 9.15 + React 18 + strict TS (ADR-0001).
T02 Folder layout — src/{shared,engine,anchor,source,binder,work,app}/
mirroring the future subsystem split, with path aliases.
T03 Boundary lint — eslint-plugin-boundaries enforcing the dependency
edges from wiki/DependencyMap.md §4; verified by a violating fixture.
T04 Canonical normalization v1 — src/shared/text/normalize.ts with
NORMALIZE_VERSION=1; 10/10 vitest covering ligatures, CRLF, soft
hyphens (including line-break reassembly), mixed whitespace.
T05 PDF fixture corpus — 7 user-supplied German PDFs in fixtures/pdfs/
(gitignored binaries) plus a manifest with verbatim known-good
quotes and page counts, ready for CE-WP-0002 selector tests.
T06 README upgrade — umbrella README points at wiki/docs/workplans
and documents the dev workflow.
T07 ADR-0002..0006 stubs in docs/decisions/.
Toolchain end-to-end: pnpm install + lint + typecheck + test all green.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
72 lines
2.4 KiB
JavaScript
72 lines
2.4 KiB
JavaScript
// ESLint flat config (ESLint 9+).
|
|
// Enforces the partition dependency map in wiki/DependencyMap.md §4.
|
|
//
|
|
// Element types (folders) and allowed importers:
|
|
// shared : importable by every other element (no internal imports of its own).
|
|
// engine : imports shared.
|
|
// anchor : imports shared, engine.
|
|
// source : imports shared, engine.
|
|
// binder : imports shared, engine, anchor.
|
|
// work : imports shared, engine, anchor, source. (NOT binder.)
|
|
// app : imports anything.
|
|
//
|
|
// Path aliases (@shared/*, @engine/*, etc.) come from tsconfig.json paths and
|
|
// are resolved by eslint-import-resolver-typescript.
|
|
|
|
import js from "@eslint/js";
|
|
import tseslint from "typescript-eslint";
|
|
import boundaries from "eslint-plugin-boundaries";
|
|
import importPlugin from "eslint-plugin-import";
|
|
import globals from "globals";
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ["dist/", "node_modules/", "coverage/", "**/*.d.ts"],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ["src/**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: "module",
|
|
globals: { ...globals.browser, ...globals.node },
|
|
},
|
|
plugins: {
|
|
boundaries,
|
|
import: importPlugin,
|
|
},
|
|
settings: {
|
|
"import/resolver": {
|
|
typescript: { project: "./tsconfig.json" },
|
|
},
|
|
"boundaries/elements": [
|
|
{ type: "shared", pattern: "src/shared/**" },
|
|
{ type: "engine", pattern: "src/engine/**" },
|
|
{ type: "anchor", pattern: "src/anchor/**" },
|
|
{ type: "source", pattern: "src/source/**" },
|
|
{ type: "binder", pattern: "src/binder/**" },
|
|
{ type: "work", pattern: "src/work/**" },
|
|
{ type: "app", pattern: "src/app/**" },
|
|
],
|
|
},
|
|
rules: {
|
|
"boundaries/element-types": [
|
|
2,
|
|
{
|
|
default: "disallow",
|
|
rules: [
|
|
{ from: "shared", allow: [] },
|
|
{ from: "engine", allow: ["shared"] },
|
|
{ from: "anchor", allow: ["shared", "engine"] },
|
|
{ from: "source", allow: ["shared", "engine"] },
|
|
{ from: "binder", allow: ["shared", "engine", "anchor"] },
|
|
{ from: "work", allow: ["shared", "engine", "anchor", "source"] },
|
|
{ from: "app", allow: ["shared", "engine", "anchor", "source", "binder", "work"] },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
);
|