@@ -36,6 +36,29 @@ const NODE_OS_PATH = {
3636const CHILD_PROCESS_BAN_ROOTS = [ 'src' , 'packages/host-kit/src' ] ;
3737const PROVIDER_BAN_ROOTS = [ 'src/commands' , 'src/cli/commands' ] ;
3838
39+ const MAX_FILE_LINES = 1000 ;
40+
41+ // Architecture debt: lower caps as files shrink; remove entries when files fit MAX_FILE_LINES.
42+ const LEGACY_FILE_LINE_CAPS = {
43+ 'packages/platform-android/src/__tests__/snapshot.test.ts' : 1416 ,
44+ 'packages/platform-apple/src/runner/__tests__/runner-client-command-retry.test.ts' : 1064 ,
45+ 'packages/platform-apple/src/runner/__tests__/runner-session.test.ts' : 1456 ,
46+ 'src/__tests__/agent-device-client.test.ts' : 1271 ,
47+ 'src/__tests__/cli-client-commands.test.ts' : 1234 ,
48+ 'src/__tests__/cli-config.test.ts' : 1282 ,
49+ 'src/__tests__/cli-network.test.ts' : 1092 ,
50+ 'src/__tests__/remote-connection.test.ts' : 2324 ,
51+ 'src/commands/interaction/runtime/settle.test.ts' : 2094 ,
52+ 'src/daemon-client/__tests__/daemon-client-lifecycle.test.ts' : 1169 ,
53+ 'src/daemon-client/__tests__/daemon-client.test.ts' : 1340 ,
54+ 'src/mcp/__tests__/command-tools.test.ts' : 1029 ,
55+ 'test/integration/provider-scenarios/android-lifecycle.test.ts' : 1227 ,
56+ 'packages/command-registry/src/registry.ts' : 2179 ,
57+ 'packages/host-kit/src/internal/exec.ts' : 1032 ,
58+ 'packages/react-native/src/metro/client-metro.ts' : 1123 ,
59+ 'src/cli/commands/connection-runtime.ts' : 1019 ,
60+ } ;
61+
3962export default defineConfig ( {
4063 env : {
4164 builtin : true ,
@@ -86,49 +109,22 @@ export default defineConfig({
86109 {
87110 files : [ '**/*.test.{ts,tsx,mjs}' ] ,
88111 rules : {
89- 'max-lines' : [ 'error' , { max : 1000 } ] ,
112+ 'max-lines' : [ 'error' , { max : MAX_FILE_LINES } ] ,
90113 } ,
91114 } ,
92115 {
93116 files : [ 'src/**/*.{ts,tsx,mjs}' , 'packages/*/src/**/*.{ts,tsx,mjs}' ] ,
94117 excludeFiles : [ '**/*.test.*' , '**/__tests__/**' , '**/*.fixtures.*' , '**/test-utils/**' ] ,
95118 rules : {
96- 'max-lines' : [ 'error' , { max : 1000 } ] ,
119+ 'max-lines' : [ 'error' , { max : MAX_FILE_LINES } ] ,
97120 } ,
98121 } ,
99- {
100- // Existing oversized test files are architecture debt; remove each entry after splitting.
101- files : [
102- 'packages/platform-android/src/__tests__/snapshot.test.ts' ,
103- 'packages/platform-apple/src/runner/__tests__/runner-client-command-retry.test.ts' ,
104- 'packages/platform-apple/src/runner/__tests__/runner-session.test.ts' ,
105- 'src/__tests__/agent-device-client.test.ts' ,
106- 'src/__tests__/cli-client-commands.test.ts' ,
107- 'src/__tests__/cli-config.test.ts' ,
108- 'src/__tests__/cli-network.test.ts' ,
109- 'src/__tests__/remote-connection.test.ts' ,
110- 'src/commands/interaction/runtime/settle.test.ts' ,
111- 'src/daemon-client/__tests__/daemon-client-lifecycle.test.ts' ,
112- 'src/daemon-client/__tests__/daemon-client.test.ts' ,
113- 'src/mcp/__tests__/command-tools.test.ts' ,
114- 'test/integration/provider-scenarios/android-lifecycle.test.ts' ,
115- ] ,
122+ ...Object . entries ( LEGACY_FILE_LINE_CAPS ) . map ( ( [ file , max ] ) => ( {
123+ files : [ file ] ,
116124 rules : {
117- 'max-lines' : 'off' ,
125+ 'max-lines' : [ 'error' , { max } ] as const ,
118126 } ,
119- } ,
120- {
121- // Existing oversized production files are architecture debt; remove each entry after splitting.
122- files : [
123- 'packages/command-registry/src/registry.ts' ,
124- 'packages/host-kit/src/internal/exec.ts' ,
125- 'packages/react-native/src/metro/client-metro.ts' ,
126- 'src/cli/commands/connection-runtime.ts' ,
127- ] ,
128- rules : {
129- 'max-lines' : 'off' ,
130- } ,
131- } ,
127+ } ) ) ,
132128 {
133129 files : [ 'scripts/**/*.ts' , 'scripts/**/*.mts' , 'scripts/**/*.cts' ] ,
134130 rules : {
0 commit comments