-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
145 lines (144 loc) · 4.17 KB
/
Copy patheslint.config.js
File metadata and controls
145 lines (144 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
export default tseslint.config(
{ ignores: ["**/dist/**"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2022,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
},
},
{
files: ["src/PublicDesktop.tsx", "src/features/public-desktop/**/*.{ts,tsx}", "src/lib/public-desktop.ts", "src/ui/public-desktop-layout.ts"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["**/sync", "**/opfs", "**/outbox", "**/platform/storage/**"],
message: "The public desktop must remain independent of authenticated storage, synchronization, and outbox modules.",
},
],
},
],
},
},
{
files: ["src/domain/**/*.{ts,tsx}"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["react", "react/**", "../components/**", "../ui/**", "../lib/**", "../apps/**", "../platform/**"],
message: "Domain contracts must remain independent of React, UI, features, and platform implementations.",
},
],
},
],
},
},
{
files: ["src/lib/opfs*.{ts,tsx}", "src/platform/storage/**/*.{ts,tsx}", "src/apps/host/**/*.{ts,tsx}", "packages/app-runtime/**/*.{ts,tsx}"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["**/ui/**", "**/components/**"],
message: "Persistence and app-host implementations must not depend on UI modules.",
},
{
group: ["**/lib/opfs"],
message: "App-host services must depend on neutral domain ports rather than the OPFS implementation.",
},
{
group: ["@hiraya-team/app-cli"],
message: "The app runtime must depend on package contracts rather than CLI implementation types.",
},
],
},
],
},
},
{
files: ["src/platform/sync/**/*.{ts,tsx}"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["**/ui/**", "**/components/**", "**/App", "**/PublicDesktop"],
message: "Synchronization platform modules must remain independent of React UI and composition roots.",
},
],
},
],
},
},
{
files: ["src/platform/storage/**/*.{ts,tsx}"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["react", "react/**", "**/components/**", "**/ui/**", "**/features/**", "**/platform/sync/**", "**/apps/host/**"],
message: "Browser storage must remain independent of React, UI, features, synchronization, and app-host implementations.",
},
],
},
],
},
},
{
files: ["src/components/**/*.{ts,tsx}"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["**/features/**", "**/platform/**", "**/App", "**/PublicDesktop"],
message: "Shared components must not depend on product features, platform adapters, or composition roots.",
},
],
},
],
},
},
{
files: ["src/features/**/*.{ts,tsx}"],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["**/App", "**/PublicDesktop"],
message: "Features must remain independent of application composition roots.",
},
],
},
],
},
},
);