Open History to see the last commit
1import "vite-plus/test/config";
2import { defineConfig } from "vite-plus";
3import * as NodeURL from "node:url";
4
5export default defineConfig({
6 resolve: {
7 alias: {
8 "~": NodeURL.fileURLToPath(new URL("./apps/web/src", import.meta.url)),
9 },
10 },
11 test: {
12 environment: "node",
13 exclude: [
14 "**/.repos/**",
15 "**/node_modules/**",
16 "**/dist/**",
17 "**/dist-electron/**",
18 "**/.{idea,git,cache,output,temp}/**",
19 ],
20 hookTimeout: 60_000,
21 testTimeout: 60_000,
22 setupFiles: [
23 NodeURL.fileURLToPath(
24 new URL("./packages/shared/src/testing/longTempDir.ts", import.meta.url),
25 ),
26 ],
27 },
28 staged: {
29 // Formatter only for now — no lint or typecheck on commit.
30 "*": "vp fmt --no-error-on-unmatched-pattern",
31 },
32 fmt: {
33 ignorePatterns: [
34 ".repos/**",
35 ".alchemy",
36 "dist",
37 "dist-electron",
38 "node_modules",
39 "pnpm-lock.yaml",
40 "*.tsbuildinfo",
41 "**/routeTree.gen.ts",
42 "apps/mobile/android/**",
43 "apps/mobile/ios/**",
44 "apps/mobile/uniwind-types.d.ts",
45 "*.icon/**",
46 ],
47 sortPackageJson: {},
48 overrides: [
49 {
50 files: [".devcontainer/devcontainer.json"],
51 options: {
52 trailingComma: "none",
53 },
54 },
55 ],
56 },
57 lint: {
58 ignorePatterns: [
59 ".repos",
60 ".repos/**",
61 "dist",
62 "dist-electron",
63 "node_modules",
64 "pnpm-lock.yaml",
65 "*.tsbuildinfo",
66 "**/routeTree.gen.ts",
67 "apps/mobile/android/**",
68 "apps/mobile/ios/**",
69 "apps/mobile/uniwind-types.d.ts",
70 ],
71 plugins: ["eslint", "oxc", "react", "unicorn", "typescript"],
72 jsPlugins: ["./oxlint-plugin-t3code/index.ts"],
73 categories: {
74 correctness: "warn",
75 suspicious: "warn",
76 perf: "warn",
77 },
78 rules: {
79 "unicorn/no-array-sort": "off",
80 "unicorn/consistent-function-scoping": "off",
81 "oxc/no-map-spread": "off",
82 "react-in-jsx-scope": "off",
83 "react-hooks/exhaustive-deps": "off",
84 "eslint/no-shadow": "off",
85 "eslint/no-await-in-loop": "off",
86 "eslint/no-underscore-dangle": "off",
87 "typescript/consistent-return": "off",
88 "typescript/no-base-to-string": "off",
89 "typescript/no-duplicate-type-constituents": "off",
90 "typescript/no-floating-promises": "off",
91 "typescript/no-implied-eval": "off",
92 "typescript/no-meaningless-void-operator": "off",
93 "typescript/no-redundant-type-constituents": "off",
94 "typescript/no-unnecessary-boolean-literal-compare": "off",
95 "typescript/no-unnecessary-type-conversion": "off",
96 "typescript/no-unnecessary-type-arguments": "off",
97 "typescript/no-unnecessary-type-assertion": "off",
98 "typescript/no-unnecessary-type-parameters": "off",
99 "typescript/no-unsafe-type-assertion": "off",
100 "typescript/await-thenable": "off",
101 "typescript/require-array-sort-compare": "off",
102 "typescript/restrict-template-expressions": "off",
103 "typescript/unbound-method": "off",
104 "eslint/no-restricted-imports": [
105 "error",
106 {
107 paths: [
108 {
109 name: "@t3tools/client-runtime",
110 message:
111 "Import from an explicit @t3tools/client-runtime/* subpath. The package has no root export.",
112 },
113 {
114 name: "@pierre/diffs/react",
115 importNames: ["CodeView"],
116 message:
117 "Use StyledDiffCodeView so web diff surfaces share styling and virtualized geometry.",
118 },
119 ],
120 },
121 ],
122 "t3code/no-global-process-runtime": "error",
123 "t3code/no-inline-schema-compile": "warn",
124 "t3code/no-manual-effect-runtime-in-tests": "error",
125 "t3code/no-native-title-tooltip": "error",
126 "t3code/namespace-node-imports": "error",
127 },
128 overrides: [
129 {
130 // The one place that reads the host platform to seed the injected references.
131 files: ["packages/shared/src/hostProcess.ts"],
132 rules: { "t3code/no-global-process-runtime": "off" },
133 },
134 {
135 files: ["apps/mobile/src/**"],
136 rules: { "t3code/no-mobile-uniwind-theme-escape-hatches": "error" },
137 },
138 {
139 // Reviewed native and third-party interop boundaries that cannot consume a className.
140 files: [
141 "apps/mobile/src/features/archive/ArchivedThreadsScreen.tsx",
142 "apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx",
143 "apps/mobile/src/features/files/FileMarkdownPreview.tsx",
144 "apps/mobile/src/features/files/SourceFileSurface.tsx",
145 "apps/mobile/src/features/files/AttachmentFileScreen.tsx",
146 "apps/mobile/src/features/files/ThreadFilesRouteScreen.tsx",
147 "apps/mobile/src/features/files/thread-file-navigator-pane.tsx",
148 "apps/mobile/src/features/home/HomeHeader.tsx",
149 "apps/mobile/src/features/review/ReviewSheet.tsx",
150 "apps/mobile/src/features/review/useNativeReviewDiffBridge.ts",
151 "apps/mobile/src/features/settings/SettingsEnvironmentsRouteScreen.tsx",
152 "apps/mobile/src/features/settings/appearance/components/AppearancePreviews.tsx",
153 "apps/mobile/src/features/threads/GitActionProgressOverlay.tsx",
154 "apps/mobile/src/features/threads/NewTaskDraftScreen.tsx",
155 "apps/mobile/src/features/threads/ThreadComposer.tsx",
156 "apps/mobile/src/features/threads/ThreadFeed.tsx",
157 "apps/mobile/src/features/review/ReviewCommentCard.tsx",
158 "apps/mobile/src/features/threads/ThreadSettingsSheet.tsx",
159 "apps/mobile/src/features/threads/git/GitOverviewSheet.tsx",
160 "apps/mobile/src/features/threads/thread-list-items.tsx",
161 "apps/mobile/src/features/threads/thread-list-v2-items.tsx",
162 "apps/mobile/src/lib/useMobileNavigationTheme.ts",
163 "apps/mobile/src/native/T3ComposerEditor.ios.tsx",
164 "apps/mobile/src/native/T3ComposerEditor.native.tsx",
165 ],
166 rules: {
167 "t3code/no-mobile-uniwind-theme-escape-hatches": ["error", { allowUniwindTheme: true }],
168 },
169 },
170 // Legacy manual Effect runners tracked as debt: no net-new occurrences.
171 // Lower a ceiling when you migrate a file, and delete its entry at zero.
172 ...Object.entries({
173 "apps/server/src/orchestration/Layers/CheckpointReactor.test.ts": 42,
174 "apps/server/src/orchestration/Layers/OrchestrationEngine.test.ts": 5,
175 "apps/server/src/orchestration/Layers/OrchestrationReactor.test.ts": 4,
176 "apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts": 66,
177 "apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts": 29,
178 "apps/server/src/orchestration/Layers/ThreadDeletionReactor.test.ts": 2,
179 "apps/server/src/orchestration/commandInvariants.test.ts": 5,
180 "apps/server/src/orchestration/projector.test.ts": 20,
181 "apps/server/src/provider/Layers/CodexAdapter.test.ts": 1,
182 "apps/server/src/provider/Layers/CodexSessionRuntime.test.ts": 5,
183 "apps/server/src/provider/Layers/CursorAdapter.test.ts": 1,
184 "apps/server/src/provider/Layers/CursorProvider.test.ts": 1,
185 "apps/server/src/provider/Layers/ProviderService.test.ts": 2,
186 "apps/server/src/provider/Layers/ProviderSessionReaper.test.ts": 12,
187 "apps/server/src/provider/acp/CursorAcpSupport.test.ts": 1,
188 }).map(([file, maxOccurrences]) => {
189 const rule: ["error", { maxOccurrences: number }] = ["error", { maxOccurrences }];
190 return { files: [file], rules: { "t3code/no-manual-effect-runtime-in-tests": rule } };
191 }),
192 ],
193 options: {
194 reportUnusedDisableDirectives: "error",
195 // Revisit once Oxlint's tsgolint path can integrate with @effect/tsgo diagnostics.
196 typeAware: false,
197 typeCheck: false,
198 },
199 },
200});