Skip to content

Commit eb2993b

Browse files
committed
chore(config): configure max-file-length rule
Add max-file-length rule configuration: - Default: 750 lines (error level) - Test files: 1000 lines (warning level) - Exclusions: theme files (*theme.ts), generated files (*.gen.ts, *.generated.ts) Encourages modular architecture and reduces cognitive load.
1 parent fdd351e commit eb2993b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

eslint.config.base.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export default tseslint.config([
177177
"custom/no-duplicate-reexports": "error",
178178
"custom/no-reexport-from-non-barrel": "error", // Keep - prevents re-exports from non-barrels
179179
"custom/no-redundant-assignment": "off", // Turned off - less critical
180+
"custom/max-file-length": ["error", { max: 750 }], // Enforce maximum file length
180181

181182
// Import rules (from recommended + custom)
182183
...importPlugin.configs.recommended.rules,
@@ -314,6 +315,8 @@ export default tseslint.config([
314315
"no-console": "off",
315316
"custom/no-deprecated": "off",
316317
"jsdoc/require-jsdoc": "off",
318+
// File length limit relaxed for test files
319+
"custom/max-file-length": ["warn", { max: 1000 }],
317320
// Disable overly strict rules that conflict with test patterns
318321
"sonarjs/no-nested-functions": "off", // Test helpers often nest functions deeply
319322
"vitest/no-conditional-expect": "off", // Conditional expects are valid in parameterized tests
@@ -356,6 +359,13 @@ export default tseslint.config([
356359
"@tanstack/query/no-rest-destructuring": "off", // Rest destructuring is acceptable for non-reactive query properties
357360
},
358361
},
362+
// Theme files and generated files - exclude from file length limit
363+
{
364+
files: ["**/*theme.ts", "**/*.gen.ts", "**/*.generated.ts"],
365+
rules: {
366+
"custom/max-file-length": "off", // Theme and generated files are legitimately long
367+
},
368+
},
359369
// React rules using @eslint-react (using recommended-typescript)
360370
{
361371
files: ["**/*.tsx"],

0 commit comments

Comments
 (0)