- Next.js 16 App Router (TS strict, src/), minimal placeholder page - ESLint (domain/ may not import server/ or next) + Prettier - SQLite via better-sqlite3 + Drizzle: WAL/foreign_keys/busy_timeout, migrations, idempotent seed, withTransaction (BEGIN IMMEDIATE) - Zod-validated env; startup exits on bad config and creates attachments dir - Vitest unit/integration tests with temp-DB helper (12 passing) - Playwright config + home e2e test (not yet verified passing) Tasks 1.1-5.1 done; 5.2, 6.x, 7.x pending. Co-Authored-By: Claude Opus 5.5 <[email protected]>
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
import { defineConfig, globalIgnores } from "eslint/config";
|
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
import nextTs from "eslint-config-next/typescript";
|
|
import prettier from "eslint-config-prettier/flat";
|
|
|
|
const eslintConfig = defineConfig([
|
|
...nextVitals,
|
|
...nextTs,
|
|
prettier,
|
|
// domain/ 是純函式業務邏輯,不得依賴伺服器端程式或 Next.js,才能單獨單元測試。
|
|
{
|
|
files: ["src/domain/**/*.{ts,tsx}"],
|
|
rules: {
|
|
"no-restricted-imports": [
|
|
"error",
|
|
{
|
|
patterns: [
|
|
{
|
|
group: ["@/server", "@/server/*", "**/server/*", "next", "next/*"],
|
|
message: "src/domain 必須是純函式,不得 import src/server 或 Next.js。",
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
// Override default ignores of eslint-config-next.
|
|
globalIgnores([
|
|
// Default ignores of eslint-config-next:
|
|
".next/**",
|
|
"out/**",
|
|
"build/**",
|
|
"next-env.d.ts",
|
|
// Generated / local output:
|
|
"src/server/db/migrations/**",
|
|
"playwright-report/**",
|
|
"test-results/**",
|
|
"coverage/**",
|
|
]),
|
|
]);
|
|
|
|
export default eslintConfig;
|