chore(architecture): enforce app data boundaries

This commit is contained in:
2026-06-30 17:37:53 +08:00
parent 8d5ee68e5f
commit e75865865f
3 changed files with 44 additions and 2 deletions
+31
View File
@@ -5,6 +5,37 @@ import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
{
files: ["src/app/**/*.{ts,tsx}"],
ignores: ["src/app/api/**", "src/app/**/route.ts"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: [
"@/data/repositories",
"@/data/repositories/*",
"@/data/repositories/**",
],
message:
"App UI should depend on stores or lib use-case helpers instead of repositories.",
},
{
group: [
"@/data/storage",
"@/data/storage/*",
"@/data/storage/**",
],
message:
"App UI should not access storage directly; move persistence behind lib or stores.",
},
],
},
],
},
},
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next: