Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
702 lines (693 loc) · 28.4 KB
/
Copy patheslint.config.js
File metadata and controls
702 lines (693 loc) · 28.4 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import { fixupPluginRules } from '@eslint/compat';
import i18next from 'eslint-plugin-i18next';
import boundaries from 'eslint-plugin-boundaries';
import tseslint from 'typescript-eslint';
import { defineConfig, globalIgnores } from 'eslint/config';
import noInitTimeImportedCall from './eslint-rules/no-init-time-imported-call.js';
// i18next@6.1.5 anchors each words.exclude entry as a raw `^…$` regex source, so
// literal metacharacters (+, ., $, ~) must be escaped to match the intended text
// and to avoid crashing the linter on bare quantifiers like "+".
const literal = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
// Shared files that import a feature from before the rule that bans it (see the
// no-restricted-imports override for src/shared). Remove an entry once its file is clean.
const SHARED_FEATURE_IMPORTERS = [
'src/shared/components/AppVersionButton/AppVersionButton.tsx',
'src/shared/constants/bin.ts',
'src/shared/constants/lidKeepout.ts',
'src/shared/constraints/rules.ts',
'src/shared/generation/bridge.ts',
'src/shared/generation/directMesh.ts',
'src/shared/generation/export.ts',
'src/shared/generation/floorPatternMetrics.ts',
'src/shared/generation/lowProfileBase.ts',
'src/shared/generation/splitUtils.ts',
'src/shared/generation/wallPatternMetrics.ts',
'src/shared/hooks/useDrawerCeiling.ts',
'src/shared/hooks/useLabelPlateCounts.ts',
'src/shared/hooks/useLinkedDesignDividers.ts',
'src/shared/hooks/useLinkedDesignKinds.ts',
'src/shared/hooks/useLinkedDesignMeshes.ts',
'src/shared/hooks/useLinkedDesignOverhangs.ts',
'src/shared/items/bin/descriptor.ts',
'src/shared/printSettings/assembledHeight.ts',
'src/shared/sync/useSignOutFlow.tsx',
'src/shared/types/bin.ts',
'src/shared/types/generation.ts',
'src/shared/utils/communityPrintCost.ts',
'src/shared/utils/cutoutArray.ts',
'src/shared/utils/cutoutRepeatDetect.ts',
'src/shared/utils/detachableFeetPlan.ts',
'src/shared/utils/dividerRailPlan.ts',
'src/shared/utils/fitTestOutlinePlan.ts',
'src/shared/utils/fitTestPlan.ts',
'src/shared/utils/floorTextHost.ts',
'src/shared/utils/handleCutoutClip.ts',
'src/shared/utils/hingeLidPlan.ts',
'src/shared/utils/labelTabPlan.ts',
'src/shared/utils/lidCutoutPlan.ts',
'src/shared/utils/lidInteriorRelief.ts',
'src/shared/utils/placedCaption.ts',
'src/shared/utils/scoopCalculations.ts',
'src/shared/utils/slideLidCatch.ts',
'src/shared/utils/slideLidPlan.ts',
];
export default defineConfig([
// `.worktrees` / `.claude/worktrees` hold git worktrees — each is a full copy
// of the repo. Both are gitignored, but flat config does not read .gitignore,
// so without these `eslint .` type-checks every checkout at once and OOMs.
globalIgnores([
'dist',
'coverage',
'e2e',
'scripts',
// The VitePress docs site: build tooling and Markdown, with its own build.
'apps/docs',
'benchmarks',
'reports',
'brep-parts',
'playwright.config.ts',
'playwright.smoke.config.ts',
'playwright-ct.config.ts',
'playwright',
'**/*.visual.tsx',
'src/test/setup.ts',
'.worktrees',
'.claude/worktrees',
]),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.strictTypeChecked,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
jsxA11y.flatConfigs.recommended,
],
plugins: {
i18next: fixupPluginRules(i18next),
local: { rules: { 'no-init-time-imported-call': noInitTimeImportedCall } },
},
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
project: [
'tsconfig.app.json',
'tsconfig.node.json',
'tsconfig.api.json',
'tsconfig.test.json',
'packages/branded-types/tsconfig.json',
],
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// Catch chunk-init capture hazards (#1466, #1558).
'local/no-init-time-imported-call': 'error',
// TypeScript strict rules
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
},
],
'@typescript-eslint/no-non-null-assertion': 'error',
// Pragmatic type-checked rule tuning
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowNumber: true,
allowBoolean: true,
},
],
'@typescript-eslint/no-confusing-void-expression': 'off',
// `void x;` is the house idiom for an intentional discard: `void error`
// for an unused catch binding, `void _exhaustive` for a `never`
// exhaustiveness sentinel. This rule flags those as meaningless and its
// autofix strips the `void`, which then trips no-unused-expressions.
'@typescript-eslint/no-meaningless-void-operator': 'off',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-deprecated': 'warn',
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: { attributes: false },
},
],
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/restrict-plus-operands': [
'error',
{
allowNumberAndString: true,
},
],
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unnecessary-type-arguments': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
'@typescript-eslint/no-unnecessary-type-parameters': 'warn',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-misused-spread': 'error',
// Accessibility
'jsx-a11y/click-events-have-key-events': 'error',
'jsx-a11y/no-static-element-interactions': 'error',
'jsx-a11y/no-noninteractive-element-interactions': 'error',
'jsx-a11y/no-autofocus': 'error',
'jsx-a11y/interactive-supports-focus': 'error',
// role="list" on <ul> is not redundant in practice: Safari/iOS VoiceOver
// strips list semantics once list-style:none is applied.
'jsx-a11y/no-redundant-roles': ['error', { ul: ['list'] }],
// React anti-patterns
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
// General code quality
'no-console': ['warn', { allow: ['warn', 'error'] }],
'prefer-const': 'error',
'no-var': 'error',
eqeqeq: ['error', 'always'],
'max-lines': ['warn', { max: 500, skipBlankLines: true, skipComments: true }],
// Force every lazy() through lazyWithRetry so chunk-load failures on
// stale clients retry + reload instead of leaking to PostHog as
// unhandled rejections. See PR #1703. Two rules cover the two shapes:
// - `import { lazy } from 'react'` → no-restricted-imports (resolves
// through module graph, won't false-flag a locally-named `lazy`).
// - `React.lazy(...)` member call → no-restricted-syntax.
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'react',
importNames: ['lazy'],
message:
'Use lazyWithRetry() from @/shared/utils/lazyWithRetry instead of React.lazy() — raw lazy() leaks chunk-load failures to PostHog as unhandled rejections.',
},
],
},
],
'no-restricted-syntax': [
'error',
{
selector:
'CallExpression[callee.type="MemberExpression"][callee.property.name="lazy"][callee.object.name="React"]',
message:
'Use lazyWithRetry() from @/shared/utils/lazyWithRetry instead of React.lazy() — raw lazy() leaks chunk-load failures to PostHog as unhandled rejections.',
},
],
// i18n: Enforce localization of user-facing strings
'i18next/no-literal-string': [
'error',
{
mode: 'jsx-only',
'jsx-attributes': {
include: ['title', 'aria-label', 'placeholder', 'alt'],
},
'jsx-components': {
exclude: ['code', 'kbd', 'Kbd', 'pre'],
},
words: {
exclude: [
// Symbols and punctuation
'×',
'·',
'—',
'→',
'←',
'↔',
'↑',
'↓',
'½',
'~',
'•',
'%',
'+',
'/',
', ',
':',
// Technical terms kept in English
'Gridfinity',
'STL',
'3MF',
'PLA',
'JSON',
'TSV',
'CSV',
'3D',
// Unit abbreviations and numeric fragments
'mm',
'px',
'u',
'm',
'h',
'x',
'pcs',
'.5',
'+.5',
'g',
// Ordered-list markers and loading ellipsis (presentational, not translatable)
'1.',
'2.',
'3.',
'...',
// CSS/SVG values
'normal',
'0.02em',
'100%',
'xMidYMid meet',
'xMinYMin meet',
'xMinYMid meet',
'xMidYMax meet',
// Currency symbol
'$',
// Numeric indicators
'9+',
// Brand names
'Zack Freedman',
'Andy Aragon',
// Keyboard shortcuts displayed as-is
'Ctrl',
'Shift',
'Esc',
'Enter',
'Space',
'WASD',
'H',
'R',
'V',
'L',
'M',
// Arrow key display
'↑↓←→',
].map(literal),
},
callees: {
exclude: ['t', 'console.log', 'console.warn', 'console.error', 'Error', 'TypeError'],
},
},
],
},
},
// Architectural boundaries: enforce import rules between modules
{
files: ['src/**/*.{ts,tsx}'],
ignores: ['**/*.test.{ts,tsx}', '**/test/**/*.{ts,tsx}'],
plugins: { boundaries },
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
// Whole-folder patterns (not `src/core/*`): with subfolder globs, files
// sitting directly at a layer root (e.g. src/core/types.ts) belong to no
// element and their imports silently escape every policy.
'boundaries/elements': [
{ type: 'core', pattern: ['src/core'] },
{ type: 'shared', pattern: ['src/shared'] },
{ type: 'design-system', pattern: ['src/design-system'] },
{ type: 'feature', pattern: ['src/features/*'], capture: ['featureName'] },
{ type: 'shell', pattern: ['src/shell'] },
{ type: 'i18n', pattern: ['src/i18n'] },
{ type: 'test-infra', pattern: ['src/test'] },
],
// Default dependency-nodes (import, export, require, dynamicImport).
// Do not pin this to a list: the pre-v6 value `dynamic-import` was
// silently ignored after the rename to `dynamicImport`, which is how
// dynamic-import violations escaped the rule for months.
},
rules: {
// Layer rules. Three kinds of constraint coexist:
// 1. Cross-feature: features cannot import from OTHER features (with
// named exceptions for design-linking -> bin-designer,
// bin-inspector -> design-linking, and
// bin-inspector -> bin-recommender integration layers).
// 2. `core/` is infrastructure: disallowed from `feature` and `shell`.
// (`core/` -> `shared/` stays allowed; several `core/storage/*`
// modules consume shared utilities/analytics by design.)
// 3. `design-system/` is UI primitives: disallowed from every
// application-level layer (`feature`, `shell`, `shared`, `core`).
//
// This is a STRICTER superset of the bash mirror in
// scripts/check-module-boundaries.sh — it also inspects exports,
// require calls, and dynamic imports (the plugin's default
// dependency-nodes; deliberately not pinned in settings above).
// 4. `shell/` composes features; a feature never reaches back up into
// it. Shell UI that lives inside a feature's tree (the mobile grid
// toolbar, collab overlays) arrives through slot props instead.
//
// The shared→feature edge is left open here: the no-restricted-imports
// override for src/shared below closes it, except for the files listed
// in SHARED_FEATURE_IMPORTERS, which predate it.
'boundaries/dependencies': [
'error',
{
default: 'allow',
policies: [
// Features: disallow importing other features (cross-feature coupling)
{
from: { element: { type: 'feature' } },
disallow: [{ to: { element: { type: 'feature' } } }],
},
// Same feature is OK
{
from: { element: { type: 'feature' } },
allow: [
{
to: {
element: {
type: 'feature',
captured: { featureName: '{{ from.captured.featureName }}' },
},
},
},
],
},
// Exception: design-linking -> bin-designer (integration layer)
{
from: { element: { type: 'feature', captured: { featureName: 'design-linking' } } },
allow: [
{ to: { element: { type: 'feature', captured: { featureName: 'bin-designer' } } } },
],
},
// Exception: bin-inspector -> design-linking (lazy-loaded linked design section)
{
from: { element: { type: 'feature', captured: { featureName: 'bin-inspector' } } },
allow: [
{
to: { element: { type: 'feature', captured: { featureName: 'design-linking' } } },
},
],
},
// Exception: bin-inspector -> bin-recommender (lazy-loaded size suggestion)
{
from: { element: { type: 'feature', captured: { featureName: 'bin-inspector' } } },
allow: [
{
to: {
element: { type: 'feature', captured: { featureName: 'bin-recommender' } },
},
},
],
},
// Exception: layers -> design-linking (lazy-loaded Make Bento dialog)
{
from: { element: { type: 'feature', captured: { featureName: 'layers' } } },
allow: [
{
to: { element: { type: 'feature', captured: { featureName: 'design-linking' } } },
},
],
},
// `core/` is infrastructure — it must not depend on features or the
// app shell. (`core/` -> `shared/` is intentionally allowed; many
// `core/storage/*` modules use shared utilities/analytics.)
{
from: { element: { type: 'core' } },
disallow: [
{ to: { element: { type: 'feature' } } },
{ to: { element: { type: 'shell' } } },
],
},
{
from: { element: { type: 'feature' } },
disallow: [{ to: { element: { type: 'shell' } } }],
},
// `design-system/` is UI primitives — it must not depend on any
// application-level layer. UI primitives take strings via props;
// they never read translations themselves, so `i18n` is in the
// disallow list alongside the app layers.
{
from: { element: { type: 'design-system' } },
disallow: [
{ to: { element: { type: 'feature' } } },
{ to: { element: { type: 'shell' } } },
{ to: { element: { type: 'i18n' } } },
{ to: { element: { type: 'shared' } } },
{ to: { element: { type: 'core' } } },
],
},
],
},
],
},
},
// Bin-dimension discipline: every UI / validator / estimator that needs
// outer/inner/total bin dimensions must derive them via binDimensions(params),
// which reads `params.gridUnitMm` and `params.heightUnitMm`. Arithmetic
// against the spec constants directly silently locks the math to 42mm/7mm
// even when the user has configured a custom physical unit — the bug
// shape behind #1809 and the broader audit follow-up.
//
// Allowlisted files: the helper, the constant definitions, scenario
// fixtures (intentionally on the spec), and test code.
{
files: ['src/**/*.{ts,tsx}'],
ignores: [
'**/*.test.{ts,tsx}',
'**/test/**/*.{ts,tsx}',
'**/scenarios/**/*.{ts,tsx}',
'**/__kernel-tests__/**/*.{ts,tsx}',
'src/features/bin-designer/utils/binDimensions.ts',
'src/shared/printSettings/gridfinityGeometry.ts',
],
rules: {
// Flat-config replaces (does not merge) per-rule values, so the
// React.lazy guard from the global block is duplicated here.
'no-restricted-syntax': [
'error',
{
selector:
'CallExpression[callee.type="MemberExpression"][callee.property.name="lazy"][callee.object.name="React"]',
message:
'Use lazyWithRetry() from @/shared/utils/lazyWithRetry instead of React.lazy() — raw lazy() leaks chunk-load failures to PostHog as unhandled rejections.',
},
{
selector:
"BinaryExpression > MemberExpression[object.name='GRIDFINITY'][property.name='GRID_SIZE']",
message:
'Do not multiply/divide GRIDFINITY.GRID_SIZE directly — use binDimensions(params) (or thread params.gridUnitMm through) so the math tracks the user-configured grid unit. See src/features/bin-designer/utils/binDimensions.ts.',
},
{
selector:
"BinaryExpression > MemberExpression[object.name='GRIDFINITY'][property.name='HEIGHT_UNIT']",
message:
'Do not multiply/divide GRIDFINITY.HEIGHT_UNIT directly — use binDimensions(params) (or thread params.heightUnitMm through) so the math tracks the user-configured height unit. See src/features/bin-designer/utils/binDimensions.ts.',
},
{
selector:
"BinaryExpression > MemberExpression[object.name='GRIDFINITY_SPEC'][property.name='GRID_SIZE']",
message:
'Do not multiply/divide GRIDFINITY_SPEC.GRID_SIZE directly — thread the per-layout gridUnitMm through instead. See src/features/bin-designer/utils/binDimensions.ts.',
},
{
selector:
"BinaryExpression > MemberExpression[object.name='GRIDFINITY_SPEC'][property.name='HEIGHT_UNIT']",
message:
'Do not multiply/divide GRIDFINITY_SPEC.HEIGHT_UNIT directly — thread the per-layout heightUnitMm through instead. See src/features/bin-designer/utils/binDimensions.ts.',
},
],
},
},
// Shared code never imports a feature (src/shared/.greptile/rules.md): feature
// state reaches it through a seam the shell registers (src/shell/registrations/)
// or through props. The boundaries policy above leaves shared -> feature open,
// so this holds the line for every shared file except the ones listed, which
// predate it. The list only shrinks: remove a file once it stops importing a
// feature. `paths` is duplicated from the global rule (overrides replace it).
{
files: ['src/shared/**/*.{ts,tsx}'],
ignores: ['**/*.test.{ts,tsx}', '**/test/**/*.{ts,tsx}', ...SHARED_FEATURE_IMPORTERS],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'react',
importNames: ['lazy'],
message:
'Use lazyWithRetry() from @/shared/utils/lazyWithRetry instead of React.lazy().',
},
],
patterns: [
{
group: ['@/features/*', '@/features/**'],
message:
'Shared code must not import a feature. Register the feature state through a seam in src/shell/registrations/, pass it in as props, or move the code into the feature.',
},
],
},
],
},
},
// Barrel-only restriction: design-linking may only import bin-designer barrel.
// Note: `paths` is duplicated from the global rule because flat-config overrides
// replace (not merge) the rule value.
{
files: ['src/features/design-linking/**/*.{ts,tsx}'],
ignores: ['**/*.test.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'react',
importNames: ['lazy'],
message:
'Use lazyWithRetry() from @/shared/utils/lazyWithRetry instead of React.lazy().',
},
],
patterns: [
{
group: ['@/features/bin-designer/*', '@/features/bin-designer/**'],
message: 'Import from @/features/bin-designer barrel only',
},
],
},
],
},
},
// Barrel-only restriction: bin-inspector may only import design-linking barrel.
{
files: ['src/features/bin-inspector/**/*.{ts,tsx}'],
ignores: ['**/*.test.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'react',
importNames: ['lazy'],
message:
'Use lazyWithRetry() from @/shared/utils/lazyWithRetry instead of React.lazy().',
},
],
patterns: [
{
group: ['@/features/design-linking/*', '@/features/design-linking/**'],
message: 'Import from @/features/design-linking barrel only',
},
],
},
],
},
},
// Design system: compound components are valid exports, and English
// accessibility defaults (aria-labels) don't go through i18n — consumers
// pass translated labels via props when needed.
{
files: ['src/design-system/**/*.{ts,tsx}'],
rules: {
'react-refresh/only-export-components': 'off',
'i18next/no-literal-string': 'off',
},
},
// Test files: relax TypeScript strictness and disable i18n rule
{
files: ['**/*.test.{ts,tsx}', '**/test/**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-deprecated': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'i18next/no-literal-string': 'off',
'max-lines': 'off',
},
},
// i18n locale files: no i18n or max-lines rule needed (locale data files are large by nature)
{
files: ['**/i18n/**/*.{ts,tsx}'],
rules: {
'i18next/no-literal-string': 'off',
'max-lines': 'off',
},
},
// Justified large files: cohesive modules where splitting would hurt readability.
// Some paths are forward-looking (created by companion file-split PRs).
{
files: [
'src/shared/analytics/labelVocabulary.ts', // pre-split (1670 LOC, pure data)
'src/shared/analytics/labelVocabulary/vocabulary.ts', // post-split equivalent
'src/shared/analytics/labelVocabulary/catalogDisplay.ts', // pure per-locale display data
'src/features/bin-designer/components/panel/CutoutsSection/useCutoutInteraction.ts',
'src/features/baseplate/components/BaseplatePreview/BaseplatePreview.tsx',
'src/shell/Mobile/MobileLayoutsPanel/MobileLayoutsPanel.tsx',
'src/shared/analytics/mlTelemetry/trackers.ts',
'api/ml-telemetry.ts', // pre-split (2268 LOC)
'api/lib/mlTelemetry/aggregators.ts', // post-split equivalent
// Cohesive single-concern modules where splitting would harm readability:
'api/lib/assemblyValidation.ts', // one hand-written mirror of the client assembly schema; its bounds, validators and sanitizer must move together
'src/shared/utils/validation.ts', // type guards + import/salvage validation pipeline (728 LOC); concerns are interleaved by design
'src/features/generation/bridge/GenerationBridge.ts', // single GenerationBridge class with the full worker-message protocol
'src/features/generation/worker/generators/baseplateGenerator.ts', // single linear generation pipeline
'src/features/generation/worker/generators/baseplateDirectMesh.ts', // single direct-mesh generator pipeline
'src/features/generation/worker/generators/wallPatternBuilder.ts', // single per-wall pattern builder
'src/features/bin-designer/components/panel/CutoutsSection/svgImport/svgParser.ts', // SVG element-conversion pipeline; helpers separated where useful
'src/features/inspiration-gallery/data/themes/workshop.ts', // pure theme data, large by nature
'src/features/whats-new/entries.ts', // release-notes data, one entry per release
// Component files dense with conditional rendering / inline handlers; sub-components
// exist where useful but the orchestration layer remains in the main file:
'src/features/bin-designer/components/CompartmentEditor/CompartmentEditor.tsx',
'src/features/bin-designer/components/CutoutWorkspace/CutoutWorkspace.tsx',
'src/features/bin-designer/components/CutoutWorkspace/WorkspaceHeader.tsx',
'src/features/bin-designer/components/DesignListDialog/DesignListDialog.tsx',
'src/features/bin-designer/components/PreviewCanvas/PreviewCanvas.tsx',
'src/features/bin-inspector/hooks/useBinInspector.ts', // single coordinating hook
'src/features/bin-designer/components/panel/LidSection/useLidSection.ts', // single coordinating hook: one state/handlers pair for the whole lid section
'src/features/bin-designer/components/panel/LabelTabsSection/useLabelTabsSection.ts', // single coordinating hook: label plan, warnings and every setter in one closure
'src/features/bin-designer/components/Workshop/useWorkshopInteraction.ts', // single coordinating hook: drag, rotate and hover share one pointer state machine
'src/features/cloud-share/components/ShareButton/ShareButton.tsx',
'src/features/command-palette/components/CommandPalette/CommandPalette.tsx',
'src/features/grid-editor/components/Grid/Overlay/Overlay.tsx',
'src/features/staging/components/Staging/Staging.tsx',
'src/shell/Modals/HelpModal/HelpModal.tsx', // tabbed help content kept inline by design
'src/shell/RightPanel/RightPanel.tsx',
'src/shell/Sidebar/Sidebar.tsx',
],
rules: { 'max-lines': 'off' },
},
// Scripts: no i18n rule needed; stdout is a CLI's output channel, not debug logging
{
files: ['scripts/**/*.{ts,tsx}'],
rules: {
'i18next/no-literal-string': 'off',
'no-console': 'off',
},
},
// Diagnostic harnesses print their reports to the console by design
{
files: ['**/__kernel-tests__/**/*.{ts,tsx}', '**/*.perf.test.{ts,tsx}'],
rules: {
'no-console': 'off',
},
},
]);