-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
1539 lines (1534 loc) · 59.7 KB
/
Copy pathoxlint.config.ts
File metadata and controls
1539 lines (1534 loc) · 59.7 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
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const requireConfig = require('node:module').createRequire(__filename);
const { defineConfig } = requireConfig('oxlint');
const core = requireConfig('ultracite/oxlint/core').default;
const antiSlop = requireConfig('ultracite/oxlint/anti-slop').default;
const generatedFiles = requireConfig('./scripts/generated-files.cjs');
// Existing handwritten SDK patterns predate these preset rules.
const compatibilityRules = [
'func-style',
'sort-keys',
// Conditional literal fields preserve omission and create own data properties,
// keeping complete request and wire fixtures visible in one construction.
'anti-slop/no-conditional-empty-object-spread',
];
// Fixtures exercise malformed inputs, examples receive application-owned values,
// and vendored code retains its upstream validation contracts.
const fixtureAndVendorFiles = [
'tests/**',
'examples/**',
'ecosystem-tests/**',
'src/_vendor/**',
'scripts/_vendor/**',
];
// These modules own parsing, transport adaptation, or application callback
// boundaries. They establish types from external values rather than assuming them.
const sdkBoundaryFiles = [
'src/auth/**',
'src/internal/auth/**',
'src/helpers/**',
'src/realtime/**',
'src/beta/realtime/**',
'src/lib/*Stream.ts',
'src/lib/webrtc/**',
'src/core/streaming.ts',
'src/internal/uploads.ts',
'src/internal/to-file.ts',
'src/internal/assistant-stream-delta.ts',
'src/lib/parser.ts',
'src/lib/transform.ts',
'src/lib/agents/agent-session-stream.ts',
];
module.exports = defineConfig({
extends: [core, antiSlop],
categories: {
correctness: 'off',
},
rules: {
...Object.fromEntries(compatibilityRules.map((rule) => [rule, 'off'])),
// Preserve intentional paired null-or-undefined checks while enforcing strict
// equality for every other comparison.
eqeqeq: ['error', 'always', { null: 'ignore' }],
'jsdoc/check-tag-names': ['error', { definedTags: ['jest-environment'] }],
'no-restricted-imports': [
'error',
{
patterns: [
{
regex: '^openai(/.*)?',
message: 'Use a relative import, not a package import.',
},
],
},
],
},
ignorePatterns: [...core.ignorePatterns, 'dist/**', 'coverage/**', ...generatedFiles],
overrides: [
{
// Runtime validation and host capability detection need typeof at the
// boundary itself, including checks that throw instead of returning a predicate.
files: [
...fixtureAndVendorFiles,
...sdkBoundaryFiles,
'src/providers/**',
'src/internal/qs/**',
'src/internal/stream-utils.ts',
'src/internal/ws*.ts',
],
rules: {
'anti-slop/no-runtime-typeof': 'off',
},
},
{
// Validators, transport failures, and application callbacks must accept
// unknown inputs before establishing or forwarding their actual contracts.
files: [...fixtureAndVendorFiles, ...sdkBoundaryFiles],
rules: {
'anti-slop/no-unknown-parameters': 'off',
},
},
{
// Schema keywords, partial wire payloads, and captured option descriptors
// have open keys and unvalidated values. Keep dictionary checks elsewhere.
files: [
...fixtureAndVendorFiles,
'src/helpers/**',
'src/lib/transform.ts',
'src/internal/assistant-stream-delta.ts',
'src/internal/uploads.ts',
'src/internal/ws.ts',
'src/auth/x509-transport.ts',
'src/lib/AssistantStream.ts',
'src/lib/agents/agent-session-stream.ts',
],
rules: {
'anti-slop/no-unsafe-dictionary-type': 'off',
},
},
{
// This example intentionally shows both mutually exclusive Next.js router
// response styles in one place.
files: ['examples/chat-completions/stream-to-client-next.ts'],
rules: {
'no-unreachable': 'off',
},
},
{
// These loops deliberately inspect one inherited key or interrupt a stream
// to exercise cancellation; the queue-draining loop is also falsely flagged.
files: [
'ecosystem-tests/cli.ts',
'src/_vendor/zod-to-json-schema/util.ts',
'tests/internal/stream-utils.test.ts',
'tests/lib/streaming-core.test.ts',
],
rules: {
'no-unreachable-loop': 'off',
},
},
{
// Separate pushes make the ordered response items and follow-up turn or
// paired program fixtures explicit.
files: ['examples/responses/manual-conversation-state.ts', 'tests/lib/ResponsesParser.test.ts'],
rules: {
'unicorn/prefer-single-call': 'off',
},
},
{
// Preserve the vendored module's existing named and default export topology.
files: ['src/_vendor/zod-to-json-schema/index.ts'],
rules: {
'unicorn/prefer-export-from': 'off',
},
},
{
// Streaming branches retain distinct logging behavior, and schema branches
// must preserve their mutation and annotation ordering.
files: ['src/core/streaming.ts', 'src/lib/transform.ts'],
rules: {
'oxc/branches-sharing-code': 'off',
},
},
{
// parseInt intentionally reads the first dotted Node.js version component;
// Number on the split array would produce NaN instead.
files: ['src/internal/uploads.ts'],
rules: {
'unicorn/prefer-number-coercion': 'off',
},
},
{
// This mock must stay constructable because the websocket client invokes it
// as a constructor; arrow callbacks cannot be constructors.
files: ['tests/realtime-websocket.test.ts'],
rules: {
'prefer-arrow-callback': 'off',
},
},
{
// These dynamic fixtures, vendored implementations, and legacy interop
// surfaces intentionally use any; replacing it with unknown would change
// public assignability or runtime-adapter contracts.
files: [
'tests/**',
'examples/**',
'ecosystem-tests/**',
'scripts/_vendor/**',
'src/_vendor/**',
'src/internal/utils/bytes.ts',
'src/lib/parser.ts',
'src/lib/ResponsesParser.ts',
'src/lib/RunnableFunction.ts',
'src/lib/ChatCompletionStreamingRunner.ts',
'src/internal/provider.ts',
'src/lib/ChatCompletionRunner.ts',
'src/internal/to-file.ts',
'src/core/streaming.ts',
'src/internal/utils/path.ts',
'src/internal/qs/types.ts',
'src/auth/workload-identity-auth.ts',
'src/helpers/zod.ts',
'src/lib/AbstractChatCompletionRunner.ts',
'src/lib/responses/ResponseStream.ts',
'src/internal/qs/stringify.ts',
'src/lib/ChatCompletionStream.ts',
'src/internal/uploads.ts',
'src/internal/qs/utils.ts',
'src/lib/AssistantStream.ts',
'src/lib/EventStream.ts',
'src/lib/transform.ts',
'src/helpers/standard-schema.ts',
'src/internal/ws-adapter.ts',
'src/internal/ws-adapter-node.ts',
'src/internal/ws-adapter-browser.ts',
'src/core/EventEmitter.ts',
'src/helpers/audio.ts',
'src/beta/realtime/internal-base.ts',
'src/lib/EventEmitter.ts',
'src/beta/realtime/websocket.ts',
'src/internal/stream-utils.ts',
'src/realtime/ws.ts',
'src/realtime/internal-base.ts',
'src/realtime/websocket.ts',
'src/beta/realtime/ws.ts',
'src/providers/bedrock/aws.ts',
],
rules: {
'typescript/no-explicit-any': 'off',
},
},
{
// These modules intentionally use hoisted helpers to keep public entrypoints,
// parsers, and test fixtures readable while still enforcing variable ordering.
files: [
'examples/audio/audio.ts',
'examples/chat-completions/chat-params-types.ts',
'examples/chat-completions/function-call-diy.ts',
'examples/chat-completions/function-call-stream-raw.ts',
'examples/chat-completions/function-call-stream.ts',
'examples/chat-completions/function-call.ts',
'examples/chat-completions/tool-call-helpers.ts',
'examples/chat-completions/tool-calls-stream.ts',
'examples/images/picture.ts',
'examples/mtls/bun.mjs',
'examples/mtls/deno.mjs',
'examples/mtls/node.mjs',
'examples/mtls/x509-workload-identity.mjs',
'src/helpers/standard-schema.ts',
'src/internal/decoders/line.ts',
'src/internal/to-file.ts',
'src/lib/AssistantStream.ts',
'src/lib/ChatCompletionStream.ts',
'src/lib/ResponsesParser.ts',
'src/lib/parser.ts',
'src/lib/responses/ResponseAccumulator.ts',
'src/lib/responses/ResponseInputItems.ts',
'src/lib/responses/ResponseStream.ts',
'src/lib/transform.ts',
'tests/benchmarks/streaming.bench.ts',
'tests/benchmarks/structured-output-and-embeddings.bench.ts',
'tests/lib/ResponseAccumulator.test.ts',
'tests/lib/ResponseStream.test.ts',
'tests/test-script.test.ts',
],
rules: {
'no-use-before-define': ['error', { functions: false }],
},
},
{
// These fixture, vendor, and state-machine files rely on deliberate
// declaration ordering or recursive initialization that is risky to reorder.
files: [
'ecosystem-tests/bun/openai.test.ts',
'ecosystem-tests/cli.ts',
'ecosystem-tests/node-ts-cjs-auto/tests/test.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-node.ts',
'ecosystem-tests/node-ts-cjs/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs/tests/test-node.ts',
'ecosystem-tests/node-ts-esm-auto/tests/test.ts',
'ecosystem-tests/node-ts-esm-web/tests/test.ts',
'ecosystem-tests/node-ts-esm/tests/test-esnext.ts',
'ecosystem-tests/node-ts-esm/tests/test.ts',
'ecosystem-tests/node-ts4.5-jest28/tests/test.ts',
'examples/chat-completions/parsing-run-tools.ts',
'examples/chat-completions/tool-call-helpers-zod.ts',
'examples/responses/websocket.ts',
'src/_vendor/partial-json-parser/parser.ts',
'src/_vendor/zod-to-json-schema/parseDef.ts',
'src/_vendor/zod-to-json-schema/parsers/date.ts',
'src/_vendor/zod-to-json-schema/parsers/string.ts',
'src/_vendor/zod-to-json-schema/parsers/union.ts',
'src/azure.ts',
'src/core/streaming.ts',
'src/internal/uploads.ts',
'src/lib/EventEmitter.ts',
'src/lib/EventStream.ts',
'tests/buildHeaders.test.ts',
],
rules: {
'no-use-before-define': 'off',
},
},
{
// These signatures intentionally expose direct `void` for zero-argument events,
// and the type test verifies the public `APIPromise<void>` contract.
files: [
'src/core/EventEmitter.ts',
'src/lib/EventEmitter.ts',
'src/lib/EventStream.ts',
'tests/responses.test.ts',
],
rules: {
'typescript/no-invalid-void-type': 'off',
},
},
{
files: [
'src/_vendor/zod-to-json-schema/index.ts',
'src/api-promise.ts',
'src/pagination.ts',
'src/resource.ts',
'src/resources.ts',
'src/streaming.ts',
'src/uploads.ts',
],
rules: {
'oxc/no-barrel-file': 'off',
},
},
{
// Vendored zod-to-json-schema uses `{}` for the intentionally empty schema
// that accepts any JSON value; preserve that public type surface.
files: [
'src/_vendor/zod-to-json-schema/parseDef.ts',
'src/_vendor/zod-to-json-schema/parsers/any.ts',
'src/_vendor/zod-to-json-schema/parsers/never.ts',
'src/_vendor/zod-to-json-schema/parsers/undefined.ts',
'src/_vendor/zod-to-json-schema/parsers/unknown.ts',
],
rules: {
'typescript/ban-types': 'off',
'typescript/no-empty-object-type': 'off',
},
},
{
// These SDK and test helpers intentionally use typed or Node EventEmitter APIs;
// EventTarget would lose multi-argument events, emit chaining, or public behavior.
files: [
'src/beta/realtime/internal-base.ts',
'src/core/EventEmitter.ts',
'src/realtime/internal-base.ts',
'tests/helpers/audio-recording.test.ts',
'tests/internal/websocket-adapters.test.ts',
'tests/lib/core-event-emitter.test.ts',
'tests/lib/eventEmitter.test.ts',
'tests/lib/responsesWebSocket.test.ts',
],
rules: {
'unicorn/prefer-event-target': 'off',
},
},
{
// These files intentionally colocate one closely related class pair.
files: [
'src/_vendor/partial-json-parser/parser.ts',
'src/beta/realtime/internal-base.ts',
'src/core/EventEmitter.ts',
'src/core/streaming.ts',
'src/realtime/internal-base.ts',
'tests/internal/websocket-adapters.test.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/lib/responsesWebSocket.test.ts',
],
rules: {
'max-classes-per-file': ['error', { max: 2 }],
},
},
{
// Path validation deliberately creates anonymous class-expression fixtures.
files: ['tests/path.test.ts'],
rules: {
'max-classes-per-file': ['error', { ignoreExpressions: true }],
},
},
{
// Privacy coverage needs a custom response and both node-fetch Body/Response layouts.
files: ['tests/auth/workload-identity-success-response-privacy.test.ts'],
rules: {
'max-classes-per-file': ['error', { max: 4 }],
},
},
{
// CommonJS constructor coverage verifies forwarding through two inheritance levels.
files: ['ecosystem-tests/node-js/test.js'],
rules: {
'max-classes-per-file': ['error', { max: 2 }],
},
},
{
// Jest matcher augmentation and the public ChatCompletionStream type surface
// intentionally rely on TypeScript declaration-merging namespaces.
files: [
'ecosystem-tests/node-ts-cjs-auto/tests/test.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-node.ts',
'ecosystem-tests/node-ts-cjs/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs/tests/test-node.ts',
'ecosystem-tests/node-ts-esm-auto/tests/test.ts',
'ecosystem-tests/node-ts-esm-web/tests/test.ts',
'ecosystem-tests/node-ts-esm/tests/test-esnext.ts',
'ecosystem-tests/node-ts-esm/tests/test.ts',
'ecosystem-tests/node-ts4.5-jest28/tests/test.ts',
'src/lib/ChatCompletionStream.ts',
],
rules: {
'typescript/no-namespace': 'off',
},
},
{
// Oxlint's core rule does not distinguish TypeScript's separate type/value
// bindings or declaration-merging namespaces; preserve these intentional pairs.
files: [
'examples/chat-completions/tool-call-helpers-zod.ts',
'src/lib/ChatCompletionStream.ts',
'tests/lib/assistant-stream-event-history-retention.test.ts',
'tsconfig.dist-src.d.ts',
],
rules: {
'no-redeclare': 'off',
},
},
{
// These existing state machines capture the same object that a logical
// assignment initializes; keep their reference and evaluation semantics.
files: [
'src/core/EventEmitter.ts',
'src/lib/ChatCompletionStream.ts',
'src/lib/EventEmitter.ts',
'src/lib/EventStream.ts',
'src/lib/transform.ts',
],
rules: {
'no-multi-assign': 'off',
},
},
{
// The vendored parser's unused never parameter checks switch exhaustiveness.
files: ['src/_vendor/zod-to-json-schema/parseDef.ts'],
rules: {
'no-unused-vars': ['error', { argsIgnorePattern: '^_$' }],
},
},
{
// Schema normalization intentionally deletes dynamic keys in place, and these
// tests exercise deletion/restoration behavior directly.
files: [
'src/lib/transform.ts',
'tests/internal/detect-platform.test.ts',
'tests/internal/utils.test.ts',
'tests/lib/bedrock-provider.test.ts',
],
rules: {
'typescript/no-dynamic-delete': 'off',
},
},
{
// These last-item reads intentionally stay compatible with the repository's
// ES2020 declaration library, which does not include Array.prototype.at.
files: [
'scripts/check-node-version-policy.ts',
'src/_vendor/partial-json-parser/parser.ts',
'src/lib/AbstractChatCompletionRunner.ts',
'src/lib/ChatCompletionStream.ts',
'tests/_vendor/partial-json-parser/partial-json-parsing.test.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/realtime-websocket.test.ts',
],
rules: {
'unicorn/prefer-at': 'off',
},
},
{
// These switches intentionally enumerate schema, event, or test fixture
// variants; preserving their no-op behavior for unknown variants is safer.
files: [
'src/_vendor/zod-to-json-schema/parseDef.ts',
'src/_vendor/zod-to-json-schema/parsers/bigint.ts',
'src/_vendor/zod-to-json-schema/parsers/date.ts',
'src/_vendor/zod-to-json-schema/parsers/number.ts',
'src/_vendor/zod-to-json-schema/parsers/string.ts',
'src/_vendor/zod-to-json-schema/parsers/union.ts',
'src/lib/AssistantStream.ts',
'tests/lib/AssistantStream.test.ts',
'tests/live/bedrock.live.test.ts',
],
rules: {
'default-case': 'off',
},
},
{
// These promise callbacks are intentional entrypoint, memoization, deferred
// execution, or Node stream callback boundaries whose timing must stay stable.
files: [
'ecosystem-tests/cli.ts',
'examples/azure/assistants.ts',
'examples/azure/chat.ts',
'examples/azure/responses.ts',
'examples/fine-tuning/fine-tuning.ts',
'examples/images/image-stream.ts',
'examples/images/picture.ts',
'examples/responses/manual-conversation-state.ts',
'examples/responses/websocket.ts',
'scripts/_vendor/tsc-multi/src/worker/entry.ts',
'src/auth/subject-token-providers.ts',
'src/helpers/audio.ts',
'src/lib/EventStream.ts',
'tests/helpers/audio-recording.test.ts',
'tests/helpers/audio.test.ts',
],
rules: {
'promise/prefer-await-to-callbacks': 'off',
},
},
{
// Function-tool fixtures intentionally give callbacks semantic names such as
// getWeather while assigning them to the protocol function field.
files: ['tests/lib/ChatCompletionRunFunctions.test.ts'],
rules: {
'func-name-matching': 'off',
},
},
{
// These chains intentionally preserve fire-and-forget entrypoints, deferred
// execution, cancellation consumption, and memoized promise lifetimes.
files: [
'ecosystem-tests/cli.ts',
'examples/audio/speech-to-text.ts',
'examples/audio/text-to-speech.ts',
'examples/azure/assistants.ts',
'examples/azure/chat.ts',
'examples/azure/responses.ts',
'examples/bedrock/responses.ts',
'examples/chat-completions/stream-to-client-browser.ts',
'examples/chat-completions/stream-to-client-express.ts',
'examples/chat-completions/stream-to-client-raw.ts',
'examples/client/raw-response.ts',
'examples/fine-tuning/fine-tuning.ts',
'examples/images/image-stream.ts',
'examples/images/picture.ts',
'examples/responses/manual-conversation-state.ts',
'examples/responses/structured-outputs.ts',
'examples/responses/websocket.ts',
'scripts/_vendor/tsc-multi/src/worker/entry.ts',
'src/auth/subject-token-providers.ts',
'src/auth/workload-identity-auth.ts',
'src/core/streaming.ts',
'src/helpers/standard-schema.ts',
'src/lib/EventStream.ts',
],
rules: {
'promise/prefer-await-to-then': 'off',
},
},
{
// These TypeScript files intentionally stay compatible with the ES2020
// declaration library, which does not include String.prototype.replaceAll.
files: [
'scripts/_vendor/tsc-multi/src/worker/worker.ts',
'src/helpers/zod.ts',
'src/internal/qs/formats.ts',
'src/internal/qs/stringify.ts',
'src/internal/qs/utils.ts',
'src/internal/uploads.ts',
'src/internal/utils/path.ts',
'src/lib/transform.ts',
'src/realtime/internal-base.ts',
'tests/helpers/zod.test.ts',
'tests/lib/raw-streaming-fetch-example.test.ts',
'tests/path.test.ts',
'tests/qs/stringify.test.ts',
'tests/utils/mock-snapshots.ts',
],
rules: {
'unicorn/prefer-string-replace-all': 'off',
},
},
{
// These executors intentionally use concise callback bodies; their returned
// values are ignored by Promise and changing the bodies would be behavior-neutral churn.
files: [
'ecosystem-tests/browser-direct-import/public/index.js',
'ecosystem-tests/browser-direct-import/src/test.ts',
'ecosystem-tests/cli.ts',
'ecosystem-tests/ts-browser-webpack/src/index.ts',
'ecosystem-tests/ts-browser-webpack/src/test.ts',
'examples/chat-completions/tool-calls-stream.ts',
'examples/fine-tuning/fine-tuning.ts',
'src/lib/AssistantStream.ts',
'src/lib/ChatCompletionStream.ts',
'src/lib/ChatCompletionStreamingRunner.ts',
'src/lib/responses/ResponseStream.ts',
'tests/auth/workload-identity-auth.test.ts',
'tests/helpers/standard-schema.test.ts',
'tests/lib/azure.test.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/lib/responsesWebSocket.test.ts',
'tests/lib/workload-identity.test.ts',
],
rules: {
'no-promise-executor-return': 'off',
},
},
{
// These sites intentionally preserve explicit undefined values for resolver
// arity, protocol snapshots, and tests that cover undefined behavior.
files: [
'scripts/_vendor/tsc-multi/src/worker/worker.ts',
'src/_vendor/zod-to-json-schema/parseDef.ts',
'src/_vendor/zod-to-json-schema/parsers/string.ts',
'src/_vendor/zod-to-json-schema/zodToJsonSchema.ts',
'src/core/streaming.ts',
'src/helpers/standard-schema.ts',
'src/lib/AssistantStream.ts',
'src/lib/ChatCompletionStream.ts',
'src/lib/ChatCompletionStreamingRunner.ts',
'src/lib/EventStream.ts',
'src/lib/responses/ResponseStream.ts',
'tests/internal/stream-utils.test.ts',
'tests/internal/utils.test.ts',
'tests/lib/AssistantStream.test.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/lib/ResponsesParser.behavior.test.ts',
'tests/lib/chatCompletionUtils.test.ts',
'tests/lib/core-error.test.ts',
'tests/lib/streaming-core.test.ts',
'tests/qs/stringify.test.ts',
'tests/sdk-behavior.test.ts',
],
rules: {
'unicorn/no-useless-undefined': 'off',
},
},
{
// These constructors intentionally create deferred, timer, stream, and test
// promises; Promise.withResolvers would change the supported runtime surface.
files: [
'ecosystem-tests/browser-direct-import/public/index.js',
'ecosystem-tests/browser-direct-import/src/test.ts',
'ecosystem-tests/cli.ts',
'ecosystem-tests/ts-browser-webpack/src/index.ts',
'ecosystem-tests/ts-browser-webpack/src/test.ts',
'examples/audio/audio.ts',
'examples/chat-completions/tool-calls-stream.ts',
'examples/fine-tuning/fine-tuning.ts',
'examples/responses/websocket.ts',
'scripts/_vendor/tsc-multi/src/build.ts',
'src/core/EventEmitter.ts',
'src/helpers/audio.ts',
'src/lib/AssistantStream.ts',
'src/lib/ChatCompletionStream.ts',
'src/lib/ChatCompletionStreamingRunner.ts',
'src/lib/EventEmitter.ts',
'src/lib/EventStream.ts',
'src/lib/responses/ResponseStream.ts',
'tests/auth/workload-identity-auth.test.ts',
'tests/helpers/standard-schema.test.ts',
'tests/lib/azure.test.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/lib/ResponseStream.test.ts',
'tests/lib/responsesWebSocket.test.ts',
'tests/lib/workload-identity.test.ts',
'tests/utils/mock-fetch.ts',
],
rules: {
'promise/avoid-new': 'off',
},
},
{
// These validation and tooling regular expressions intentionally use legacy
// positional or non-semantic groups; renaming groups can change regex consumers.
files: [
'scripts/_vendor/tsc-multi/src/transformer.ts',
'scripts/_vendor/tsc-multi/src/worker/worker.ts',
'scripts/check-node-version-policy.ts',
'scripts/utils/check-version.cjs',
'scripts/utils/fix-index-exports.cjs',
'scripts/utils/make-dist-package-json.cjs',
'scripts/utils/postprocess-files.cjs',
'src/_vendor/zod-to-json-schema/parsers/string.ts',
'src/providers/bedrock/aws.ts',
'vitest.config.mts',
],
rules: {
'prefer-named-capture-group': 'off',
},
},
{
// These ignores intentionally span multiple TypeScript versions, runtimes,
// and fixture environments where ts-expect-error can become spuriously unused.
files: [
'ecosystem-tests/bun/openai.test.ts',
'ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts',
'ecosystem-tests/node-ts-cjs-auto/tests/test.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-node.ts',
'ecosystem-tests/node-ts-cjs/tests/test-node.ts',
'ecosystem-tests/node-ts-esm-auto/tests/test.ts',
'ecosystem-tests/node-ts-esm-web/tests/test.ts',
'ecosystem-tests/node-ts-esm/tests/test.ts',
'ecosystem-tests/node-ts4.5-jest28/tests/test.ts',
'ecosystem-tests/ts-browser-webpack/src/index.ts',
'ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts',
'examples/audio/audio.ts',
'examples/chat-completions/stream-to-client-browser.ts',
'examples/chat-completions/stream-to-client-next.ts',
'examples/chat-completions/tool-calls-stream.ts',
'src/beta/realtime/internal-base.ts',
'src/beta/realtime/websocket.ts',
'src/internal/qs/stringify.ts',
'src/internal/qs/utils.ts',
'src/lib/EventStream.ts',
'src/realtime/internal-base.ts',
'src/realtime/websocket.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/qs/stringify.test.ts',
'tests/uploads.test.ts',
'tests/utils/mock-fetch.ts',
],
rules: {
'typescript/prefer-ts-expect-error': 'off',
},
},
{
// These public, overload, and declaration-merging surfaces intentionally use
// method signatures; property-function rewrites can change variance or overloads.
files: [
'ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts',
'ecosystem-tests/node-ts-cjs-auto/tests/test.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-node.ts',
'ecosystem-tests/node-ts-cjs/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs/tests/test-node.ts',
'ecosystem-tests/node-ts-esm-auto/tests/test.ts',
'ecosystem-tests/node-ts-esm-web/tests/test.ts',
'ecosystem-tests/node-ts-esm/tests/test-esnext.ts',
'ecosystem-tests/node-ts-esm/tests/test.ts',
'ecosystem-tests/node-ts4.5-jest28/tests/test.ts',
'ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts',
'examples/responses/websocket.ts',
'scripts/_vendor/tsc-multi/src/debug.ts',
'scripts/_vendor/tsc-multi/src/transformer.ts',
'src/internal/bedrock.ts',
'src/internal/provider.ts',
'src/internal/to-file.ts',
'src/internal/uploads.ts',
'src/internal/ws-adapter-browser.ts',
'src/internal/ws-adapter.ts',
'src/lib/AbstractChatCompletionRunner.ts',
'src/lib/ResponsesParser.ts',
'src/lib/parser.ts',
'tsconfig.dist-src.d.ts',
],
rules: {
'typescript/method-signature-style': 'off',
},
},
{
// These parser, encoding, and benchmark paths intentionally use bit masks
// and shifts; arithmetic rewrites would change low-level behavior.
files: [
'src/_vendor/partial-json-parser/parser.ts',
'src/internal/qs/utils.ts',
'tests/benchmarks/streaming.bench.ts',
],
rules: {
'no-bitwise': 'off',
},
},
{
// These checks intentionally use JavaScript's paired null-or-undefined
// semantics; expanding them would duplicate expressions and risk evaluation changes.
files: [
'ecosystem-tests/browser-direct-import/src/test.ts',
'ecosystem-tests/ts-browser-webpack/src/test.ts',
'scripts/_vendor/tsc-multi/src/build.ts',
'src/core/streaming.ts',
'src/internal/bedrock.ts',
'src/internal/decoders/line.ts',
'src/internal/to-file.ts',
'src/internal/uploads.ts',
'src/internal/utils/path.ts',
'src/lib/AbstractChatCompletionRunner.ts',
'src/lib/AssistantStream.ts',
'src/lib/ChatCompletionStream.ts',
'src/lib/ResponsesParser.ts',
'src/lib/chatCompletionUtils.ts',
'src/lib/responses/ResponseAccumulator.ts',
'src/lib/responses/ResponseStream.ts',
],
rules: {
'no-eq-null': 'off',
},
},
{
// These nested helpers intentionally stay close to their fixture, test, or
// state-machine call sites; hoisting them would create collisions and reduce locality.
files: [
'ecosystem-tests/browser-direct-import/src/test.ts',
'ecosystem-tests/cloudflare-worker/src/worker.ts',
'ecosystem-tests/ts-browser-webpack/src/test.ts',
'examples/chat-completions/function-call-stream-raw.ts',
'examples/chat-completions/function-call-stream.ts',
'examples/chat-completions/tool-calls-stream.ts',
'scripts/_vendor/tsc-multi/src/report.ts',
'scripts/check-node-version-policy.ts',
'src/lib/EventStream.ts',
'tests/buildHeaders.test.ts',
'tests/form.test.ts',
'tests/helpers/standard-schema.test.ts',
'tests/internal/uploads-branches.test.ts',
'tests/internal/stream-utils.test.ts',
'tests/lib/azure.test.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/lib/responsesWebSocket.test.ts',
'tests/lib/streaming-core.test.ts',
'tests/lib/transform.test.ts',
'tests/lib/workload-identity.test.ts',
'tests/qs/stringify.test.ts',
'tests/streaming.test.ts',
'tests/test-script.test.ts',
],
rules: {
'unicorn/consistent-function-scoping': 'off',
},
},
{
// These loops intentionally serialize streaming, retries, polling, cleanup,
// and ordered tool-call behavior; parallelizing them would change semantics.
files: [
'ecosystem-tests/browser-direct-import/public/index.js',
'ecosystem-tests/browser-direct-import/src/test.ts',
'ecosystem-tests/bun/openai.test.ts',
'ecosystem-tests/cli.ts',
'ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts',
'ecosystem-tests/cloudflare-worker/src/worker.ts',
'ecosystem-tests/deno/main_test.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-node.ts',
'ecosystem-tests/node-ts-esm-web/tests/test.ts',
'ecosystem-tests/ts-browser-webpack/src/index.ts',
'ecosystem-tests/ts-browser-webpack/src/test.ts',
'ecosystem-tests/vercel-edge/src/pages/api/edge-test.ts',
'ecosystem-tests/vercel-edge/src/pages/api/node-test.ts',
'ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts',
'examples/chat-completions/function-call-diy.ts',
'examples/chat-completions/function-call-stream-raw.ts',
'examples/chat-completions/function-call-stream.ts',
'examples/chat-completions/function-call.ts',
'examples/chat-completions/tool-calls-stream.ts',
'examples/fine-tuning/fine-tuning.ts',
'examples/responses/websocket.ts',
'src/core/streaming.ts',
'src/lib/AbstractChatCompletionRunner.ts',
'tests/lib/responsesWebSocket.test.ts',
],
rules: {
'no-await-in-loop': 'off',
},
},
{
// These fixture, type-test, and callback-shape files intentionally keep
// sentinels or parameters whose presence verifies compatibility behavior.
files: [
'ecosystem-tests/browser-direct-import/public/index.js',
'ecosystem-tests/bun/openai.test.ts',
'ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts',
'ecosystem-tests/cloudflare-worker/src/worker.ts',
'ecosystem-tests/node-js/test.js',
'ecosystem-tests/node-ts-cjs-auto/moduleResolution/node/type-tests.ts',
'ecosystem-tests/node-ts-cjs-auto/moduleResolution/nodenext/type-tests.ts',
'ecosystem-tests/node-ts-cjs-auto/tests/test.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-node.ts',
'ecosystem-tests/node-ts-cjs-web/types-test.ts',
'ecosystem-tests/node-ts-cjs/tests/test-jsdom.ts',
'ecosystem-tests/node-ts-cjs/tests/test-node.ts',
'ecosystem-tests/node-ts-esm-auto/esnext-type-tests.ts',
'ecosystem-tests/node-ts-esm-auto/tests/test.ts',
'ecosystem-tests/node-ts-esm-web/tests/test.ts',
'ecosystem-tests/node-ts-esm-web/types-test.ts',
'ecosystem-tests/node-ts-esm/tests/test-esnext.ts',
'ecosystem-tests/node-ts-esm/tests/test.ts',
'ecosystem-tests/node-ts4.5-jest28/tests/test.ts',
'ecosystem-tests/ts-browser-webpack/src/index.ts',
'ecosystem-tests/vercel-edge/src/pages/api/edge-test.ts',
'ecosystem-tests/vercel-edge/src/pages/api/query-params.ts',
'ecosystem-tests/vercel-edge/src/pages/api/response.ts',
'ecosystem-tests/vercel-edge/src/pages/api/streaming.ts',
'ecosystem-tests/vercel-edge/src/pages/api/transcribe.ts',
'ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts',
'examples/chat-completions/chat-params-types.ts',
'examples/chat-completions/stream-to-client-browser.ts',
'src/_vendor/zod-to-json-schema/parsers/date.ts',
'src/_vendor/zod-to-json-schema/parsers/intersection.ts',
'src/_vendor/zod-to-json-schema/parsers/string.ts',
'src/core/EventEmitter.ts',
'src/helpers/audio.ts',
'src/lib/AbstractChatCompletionRunner.ts',
'src/lib/ChatCompletionStream.ts',
'src/lib/ResponsesParser.ts',
'tests/lib/azure.test.ts',
'tests/lib/workload-identity.test.ts',
'tests/responsesItems.test.ts',
'tests/streaming/assistants/assistant.test.ts',
'tests/utils/mock-fetch.ts',
'tests/ws.test.ts',
],
rules: {
'no-unused-vars': 'off',
},
},
{
// These parser indexes, retry counters, and fixture counters intentionally
// rely on prefix/postfix old-vs-new value semantics.
files: [
'ecosystem-tests/cli.ts',
'scripts/_vendor/tsc-multi/src/build.ts',
'scripts/lint-generated.cjs',
'src/_vendor/partial-json-parser/parser.ts',
'src/_vendor/zod-to-json-schema/parseDef.ts',
'src/_vendor/zod-to-json-schema/parsers/string.ts',
'src/_vendor/zod-to-json-schema/zodToJsonSchema.ts',
'src/azure.ts',
'src/helpers/standard-schema.ts',
'src/internal/decoders/line.ts',
'src/internal/qs/utils.ts',
'src/internal/ws.ts',
'src/lib/AbstractChatCompletionRunner.ts',
'src/lib/transform.ts',
'tests/_vendor/partial-json-parser/partial-json-parsing.test.ts',
'tests/auth/workload-identity-auth.test.ts',
'tests/benchmarks/streaming.bench.ts',
'tests/generated-resource-helpers.test.ts',
'tests/lib/azure.test.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/lib/provider.test.ts',
'tests/lib/ResponseStream.test.ts',
'tests/lib/responsesWebSocket.test.ts',
'tests/lib/workload-identity.test.ts',
'tests/ws.test.ts',
],
rules: {
'no-plusplus': 'off',
},
},
{
// These directives intentionally cover cross-version, cross-runtime, and
// vendored compatibility cases where changing the directive can break a matrix leg.
files: [
'ecosystem-tests/bun/openai.test.ts',
'ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts',
'ecosystem-tests/node-ts-cjs-auto/tests/test.ts',
'ecosystem-tests/node-ts-cjs-web/tests/test-node.ts',
'ecosystem-tests/node-ts-cjs/tests/test-node.ts',
'ecosystem-tests/node-ts-esm-auto/tests/test.ts',
'ecosystem-tests/node-ts-esm-web/tests/test.ts',
'ecosystem-tests/node-ts-esm/tests/test.ts',
'ecosystem-tests/node-ts4.5-jest28/tests/test.ts',
'ecosystem-tests/ts-browser-webpack/src/index.ts',
'ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts',
'examples/audio/audio.ts',
'examples/chat-completions/stream-to-client-browser.ts',
'examples/chat-completions/stream-to-client-next.ts',
'examples/chat-completions/tool-calls-stream.ts',
'src/_vendor/zod-to-json-schema/parsers/string.ts',
'src/beta/realtime/internal-base.ts',
'src/beta/realtime/websocket.ts',
'src/internal/qs/stringify.ts',
'src/internal/qs/utils.ts',
'src/lib/EventStream.ts',
'src/realtime/internal-base.ts',
'src/realtime/websocket.ts',
'tests/lib/ChatCompletionRunFunctions.test.ts',
'tests/qs/stringify.test.ts',
'tests/uploads.test.ts',
'tests/utils/mock-fetch.ts',
],
rules: {
'typescript/ban-ts-comment': 'off',
},
},
{
// These vendored and public type aliases intentionally preserve alias
// semantics; converting exported aliases to interfaces changes merge behavior.
files: [
'ecosystem-tests/cli.ts',
'ecosystem-tests/cloudflare-worker/src/worker.ts',
'ecosystem-tests/ts-browser-webpack/src/index.ts',
'ecosystem-tests/vercel-edge/src/pages/api/edge-test.ts',
'ecosystem-tests/vercel-edge/src/pages/api/node-test.ts',
'examples/responses/websocket.ts',
'src/_vendor/zod-to-json-schema/**',
'src/core/streaming.ts',
'src/helpers/audio.ts',
'src/helpers/standard-schema.ts',
'src/internal/qs/types.ts',
'src/internal/uploads.ts',