eslint-plugin-traceability 1.7.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +72 -32
  3. package/docs/ci-cd-pipeline.md +224 -0
  4. package/docs/cli-integration.md +22 -0
  5. package/docs/code-quality-refactor-opportunities-2025-12-03.md +78 -0
  6. package/docs/config-presets.md +38 -0
  7. package/docs/conventional-commits-guide.md +185 -0
  8. package/docs/custom-rules-development-guide.md +659 -0
  9. package/docs/decisions/0001-allow-dynamic-require-for-built-plugins.md +26 -0
  10. package/docs/decisions/001-typescript-for-eslint-plugin.accepted.md +111 -0
  11. package/docs/decisions/002-jest-for-eslint-testing.accepted.md +137 -0
  12. package/docs/decisions/003-code-quality-ratcheting-plan.md +48 -0
  13. package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +196 -0
  14. package/docs/decisions/005-github-actions-validation-tooling.accepted.md +144 -0
  15. package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +227 -0
  16. package/docs/decisions/007-github-releases-over-changelog.accepted.md +216 -0
  17. package/docs/decisions/008-ci-audit-flags.accepted.md +60 -0
  18. package/docs/decisions/009-security-focused-lint-rules.accepted.md +64 -0
  19. package/docs/decisions/010-implements-annotation-for-multi-story-requirements.proposed.md +184 -0
  20. package/docs/decisions/adr-0001-console-usage-for-cli-guards.md +190 -0
  21. package/docs/decisions/adr-accept-dev-dep-risk-glob.md +40 -0
  22. package/docs/decisions/adr-commit-branch-tests.md +54 -0
  23. package/docs/decisions/adr-maintenance-cli-interface.md +140 -0
  24. package/docs/decisions/adr-pre-push-parity.md +112 -0
  25. package/docs/decisions/code-quality-ratcheting-plan.md +53 -0
  26. package/docs/dependency-health.md +238 -0
  27. package/docs/eslint-9-setup-guide.md +517 -0
  28. package/docs/eslint-plugin-development-guide.md +487 -0
  29. package/docs/functionality-coverage-2025-12-03.md +250 -0
  30. package/docs/jest-testing-guide.md +100 -0
  31. package/docs/rules/prefer-implements-annotation.md +219 -0
  32. package/docs/rules/require-branch-annotation.md +71 -0
  33. package/docs/rules/require-req-annotation.md +203 -0
  34. package/docs/rules/require-story-annotation.md +159 -0
  35. package/docs/rules/valid-annotation-format.md +418 -0
  36. package/docs/rules/valid-req-reference.md +153 -0
  37. package/docs/rules/valid-story-reference.md +120 -0
  38. package/docs/security-incidents/2025-11-17-glob-cli-incident.md +45 -0
  39. package/docs/security-incidents/2025-11-18-brace-expansion-redos.md +45 -0
  40. package/docs/security-incidents/2025-11-18-bundled-dev-deps-accepted-risk.md +93 -0
  41. package/docs/security-incidents/2025-11-18-tar-race-condition.md +43 -0
  42. package/docs/security-incidents/2025-12-03-dependency-health-review.md +58 -0
  43. package/docs/security-incidents/SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md +104 -0
  44. package/docs/security-incidents/SECURITY-INCIDENT-TEMPLATE.md +37 -0
  45. package/docs/security-incidents/dependency-override-rationale.md +57 -0
  46. package/docs/security-incidents/dev-deps-high.json +116 -0
  47. package/docs/security-incidents/handling-procedure.md +54 -0
  48. package/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md +92 -0
  49. package/docs/stories/002.0-DEV-ESLINT-CONFIG.story.md +82 -0
  50. package/docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md +112 -0
  51. package/docs/stories/004.0-DEV-BRANCH-ANNOTATIONS.story.md +153 -0
  52. package/docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md +138 -0
  53. package/docs/stories/006.0-DEV-FILE-VALIDATION.story.md +144 -0
  54. package/docs/stories/007.0-DEV-ERROR-REPORTING.story.md +163 -0
  55. package/docs/stories/008.0-DEV-AUTO-FIX.story.md +150 -0
  56. package/docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md +117 -0
  57. package/docs/stories/010.0-DEV-DEEP-VALIDATION.story.md +124 -0
  58. package/docs/stories/010.1-DEV-CONFIGURABLE-PATTERNS.story.md +149 -0
  59. package/docs/stories/010.2-DEV-MULTI-STORY-SUPPORT.story.md +216 -0
  60. package/docs/stories/010.3-DEV-MIGRATE-TO-IMPLEMENTS.story.md +236 -0
  61. package/docs/stories/developer-story.map.md +120 -0
  62. package/docs/ts-jest-presets-guide.md +548 -0
  63. package/lib/src/maintenance/batch.d.ts +5 -0
  64. package/lib/src/maintenance/batch.js +5 -0
  65. package/lib/src/maintenance/cli.js +34 -212
  66. package/lib/src/maintenance/commands.d.ts +32 -0
  67. package/lib/src/maintenance/commands.js +139 -0
  68. package/lib/src/maintenance/detect.d.ts +2 -0
  69. package/lib/src/maintenance/detect.js +4 -0
  70. package/lib/src/maintenance/flags.d.ts +99 -0
  71. package/lib/src/maintenance/flags.js +121 -0
  72. package/lib/src/maintenance/report.d.ts +2 -0
  73. package/lib/src/maintenance/report.js +2 -0
  74. package/lib/src/maintenance/update.d.ts +4 -0
  75. package/lib/src/maintenance/update.js +4 -0
  76. package/lib/src/rules/helpers/require-story-io.d.ts +3 -0
  77. package/lib/src/rules/helpers/require-story-io.js +20 -6
  78. package/lib/src/rules/helpers/valid-annotation-options.js +15 -4
  79. package/lib/src/rules/helpers/valid-annotation-utils.js +5 -0
  80. package/lib/src/rules/helpers/valid-story-reference-helpers.d.ts +3 -4
  81. package/lib/src/utils/reqAnnotationDetection.d.ts +4 -1
  82. package/lib/src/utils/reqAnnotationDetection.js +43 -15
  83. package/lib/tests/maintenance/cli.test.js +89 -0
  84. package/lib/tests/rules/require-req-annotation.test.js +8 -1
  85. package/lib/tests/rules/require-story-annotation.test.js +9 -4
  86. package/lib/tests/utils/ts-language-options.d.ts +1 -7
  87. package/lib/tests/utils/ts-language-options.js +8 -5
  88. package/package.json +7 -3
  89. package/user-docs/api-reference.md +507 -0
  90. package/user-docs/eslint-9-setup-guide.md +639 -0
  91. package/user-docs/examples.md +74 -0
  92. package/user-docs/migration-guide.md +158 -0
@@ -0,0 +1,548 @@
1
+ # ts-jest Presets Guide
2
+
3
+ ## Overview
4
+
5
+ In Jest, presets are pre-defined configurations that help streamline and standardize the process of setting up testing environments. They allow developers to quickly configure Jest with specific transformers, file extensions, and other options.
6
+
7
+ `ts-jest` provides very opinionated presets based on what has been found to be useful in practice.
8
+
9
+ > **IMPORTANT**: The current best practice for using presets is to call one of the utility functions below to create (and optionally extend) presets. Legacy presets are listed at the bottom of this page.
10
+
11
+ ## Available Preset Functions
12
+
13
+ `ts-jest` provides the following utility functions to create presets:
14
+
15
+ - `createDefaultPreset(options)`
16
+ - `createDefaultLegacyPreset(options)`
17
+ - `createDefaultEsmPreset(options)`
18
+ - `createDefaultLegacyEsmPreset(options)`
19
+ - `createJsWithTsPreset(options)`
20
+ - `createJsWithTsLegacyPreset(options)`
21
+ - `createJsWithTsEsmPreset(options)`
22
+ - `createJsWithTsEsmLegacyPreset(options)`
23
+ - `createJsWithBabelPreset(options)`
24
+ - `createJsWithBabelLegacyPreset(options)`
25
+ - `createJsWithBabelEsmPreset(options)`
26
+ - `createJsWithBabelEsmLegacyPreset(options)`
27
+
28
+ ## Preset Functions Reference
29
+
30
+ ### `createDefaultPreset(options)`
31
+
32
+ Create a configuration to process TypeScript files (`.ts`/`.tsx`).
33
+
34
+ #### Parameters
35
+
36
+ - `options` (OPTIONAL)
37
+ - `tsconfig`: see [tsconfig options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/tsconfig)
38
+ - `isolatedModules`: see [isolatedModules options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/isolatedModules)
39
+ - `compiler`: see [compiler options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/compiler)
40
+ - `astTransformers`: see [astTransformers options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/astTransformers)
41
+ - `diagnostics`: see [diagnostics options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/diagnostics)
42
+ - `stringifyContentPathRegex`: see [stringifyContentPathRegex options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/stringifyContentPathRegex)
43
+
44
+ #### Returns
45
+
46
+ An object containing Jest's `transform` property:
47
+
48
+ ```typescript
49
+ export type DefaultPreset = {
50
+ transform: {
51
+ "^.+.tsx?$": ["ts-jest", TsJestTransformerOptions];
52
+ };
53
+ };
54
+ ```
55
+
56
+ #### Example
57
+
58
+ ```typescript
59
+ // jest.config.ts
60
+ import { createDefaultPreset, type JestConfigWithTsJest } from "ts-jest";
61
+
62
+ const presetConfig = createDefaultPreset({
63
+ //...options
64
+ });
65
+
66
+ const jestConfig: JestConfigWithTsJest = {
67
+ ...presetConfig,
68
+ };
69
+
70
+ export default jestConfig;
71
+ ```
72
+
73
+ ### `createDefaultLegacyPreset(options)`
74
+
75
+ Create a LEGACY configuration to process TypeScript files (`.ts`, `.tsx`).
76
+
77
+ #### Parameters
78
+
79
+ Same as `createDefaultPreset(options)`.
80
+
81
+ #### Returns
82
+
83
+ ```typescript
84
+ export type DefaultPreset = {
85
+ transform: {
86
+ "^.+\\.tsx?$": ["ts-jest/legacy", TsJestTransformerOptions];
87
+ };
88
+ };
89
+ ```
90
+
91
+ #### Example
92
+
93
+ ```typescript
94
+ // jest.config.ts
95
+ import { createDefaultLegacyPreset, type JestConfigWithTsJest } from "ts-jest";
96
+
97
+ const presetConfig = createDefaultLegacyPreset({
98
+ //...options
99
+ });
100
+
101
+ const jestConfig: JestConfigWithTsJest = {
102
+ ...presetConfig,
103
+ };
104
+
105
+ export default jestConfig;
106
+ ```
107
+
108
+ ### `createDefaultEsmPreset(options)`
109
+
110
+ Create an ESM configuration to process TypeScript files (`.ts`/`.mts`/`.tsx`/`.mtsx`).
111
+
112
+ #### Parameters
113
+
114
+ Same as `createDefaultPreset(options)`.
115
+
116
+ #### Returns
117
+
118
+ ```typescript
119
+ export type DefaultEsmPreset = {
120
+ extensionsToTreatAsEsm: string[];
121
+ transform: {
122
+ "^.+\\.m?tsx?$": ["ts-jest", TsJestTransformerOptions];
123
+ };
124
+ };
125
+ ```
126
+
127
+ #### Example
128
+
129
+ ```typescript
130
+ // jest.config.ts
131
+ import { createDefaultEsmPreset, type JestConfigWithTsJest } from "ts-jest";
132
+
133
+ const presetConfig = createDefaultEsmPreset({
134
+ //...options
135
+ });
136
+
137
+ const jestConfig: JestConfigWithTsJest = {
138
+ ...presetConfig,
139
+ };
140
+
141
+ export default jestConfig;
142
+ ```
143
+
144
+ ### `createDefaultLegacyEsmPreset(options)`
145
+
146
+ Create a LEGACY ESM configuration to process TypeScript files (`.ts`/`.mts`/`.tsx`/`.mtsx`).
147
+
148
+ #### Parameters
149
+
150
+ Same as `createDefaultPreset(options)`.
151
+
152
+ #### Returns
153
+
154
+ ```typescript
155
+ export type DefaultEsmPreset = {
156
+ extensionsToTreatAsEsm: string[];
157
+ transform: {
158
+ "^.+\\.m?tsx?$": ["ts-jest/legacy", TsJestTransformerOptions];
159
+ };
160
+ };
161
+ ```
162
+
163
+ #### Example
164
+
165
+ ```typescript
166
+ // jest.config.ts
167
+ import {
168
+ createDefaultLegacyEsmPreset,
169
+ type JestConfigWithTsJest,
170
+ } from "ts-jest";
171
+
172
+ const presetConfig = createDefaultLegacyEsmPreset({
173
+ //...options
174
+ });
175
+
176
+ const jestConfig: JestConfigWithTsJest = {
177
+ ...presetConfig,
178
+ };
179
+
180
+ export default jestConfig;
181
+ ```
182
+
183
+ ### `createJsWithTsPreset(options)`
184
+
185
+ Create a configuration to process JavaScript/TypeScript files (`.js`/`.jsx`/`.ts`/`.tsx`).
186
+
187
+ **Note**: You'll need to set `allowJs` to `true` in your `tsconfig.json` file.
188
+
189
+ #### Parameters
190
+
191
+ Same as `createDefaultPreset(options)`.
192
+
193
+ #### Returns
194
+
195
+ ```typescript
196
+ export type JsWithTsPreset = {
197
+ transform: {
198
+ "^.+\\.[tj]sx?$": ["ts-jest", TsJestTransformerOptions];
199
+ };
200
+ };
201
+ ```
202
+
203
+ #### Example
204
+
205
+ ```typescript
206
+ // jest.config.ts
207
+ import { createJsWithTsPreset, type JestConfigWithTsJest } from "ts-jest";
208
+
209
+ const presetConfig = createJsWithTsPreset({
210
+ //...options
211
+ });
212
+
213
+ const jestConfig: JestConfigWithTsJest = {
214
+ ...presetConfig,
215
+ };
216
+
217
+ export default jestConfig;
218
+ ```
219
+
220
+ ### `createJsWithTsLegacyPreset(options)`
221
+
222
+ Create a LEGACY configuration to process JavaScript/TypeScript files (`.js`/`.jsx`/`.ts`/`.tsx`).
223
+
224
+ **Note**: You'll need to set `allowJs` to `true` in your `tsconfig.json` file.
225
+
226
+ #### Parameters
227
+
228
+ Same as `createDefaultPreset(options)`.
229
+
230
+ #### Returns
231
+
232
+ ```typescript
233
+ export type JsWithTsPreset = {
234
+ transform: {
235
+ "^.+\\.[tj]sx?$": ["ts-jest/legacy", TsJestTransformerOptions];
236
+ };
237
+ };
238
+ ```
239
+
240
+ #### Example
241
+
242
+ ```typescript
243
+ // jest.config.ts
244
+ import { createJsWithTsLegacyPreset, type JestConfigWithTsJest } from "ts-jest";
245
+
246
+ const presetConfig = createJsWithTsLegacyPreset({
247
+ //...options
248
+ });
249
+
250
+ const jestConfig: JestConfigWithTsJest = {
251
+ ...presetConfig,
252
+ };
253
+
254
+ export default jestConfig;
255
+ ```
256
+
257
+ ### `createJsWithTsEsmPreset(options)`
258
+
259
+ Create an ESM configuration to process JavaScript/TypeScript files (`.js`/`.mjs`/`.jsx`/`.mjsx`/`.ts`/`.mts`/`.tsx`/`.mtsx`).
260
+
261
+ **Note**: You'll need to set `allowJs` to `true` in your `tsconfig.json` file.
262
+
263
+ #### Parameters
264
+
265
+ Same as `createDefaultPreset(options)`.
266
+
267
+ #### Returns
268
+
269
+ ```typescript
270
+ export type JsWithTsPreset = {
271
+ transform: {
272
+ "^.+\\.m?[tj]sx?$": ["ts-jest", TsJestTransformerOptions];
273
+ };
274
+ };
275
+ ```
276
+
277
+ #### Example
278
+
279
+ ```typescript
280
+ // jest.config.ts
281
+ import { createJsWithTsEsmPreset, type JestConfigWithTsJest } from "ts-jest";
282
+
283
+ const presetConfig = createJsWithTsEsmPreset({
284
+ //...options
285
+ });
286
+
287
+ const jestConfig: JestConfigWithTsJest = {
288
+ ...presetConfig,
289
+ };
290
+
291
+ export default jestConfig;
292
+ ```
293
+
294
+ ### `createJsWithTsEsmLegacyPreset(options)`
295
+
296
+ Create a LEGACY ESM configuration to process JavaScript/TypeScript files (`.js`/`.mjs`/`.jsx`/`.mjsx`/`.ts`/`.mts`/`.tsx`/`.mtsx`).
297
+
298
+ **Note**: You'll need to set `allowJs` to `true` in your `tsconfig.json` file.
299
+
300
+ #### Parameters
301
+
302
+ Same as `createDefaultPreset(options)`.
303
+
304
+ #### Returns
305
+
306
+ ```typescript
307
+ export type JsWithTsPreset = {
308
+ transform: {
309
+ "^.+\\.m?[tj]sx?$": ["ts-jest/legacy", TsJestTransformerOptions];
310
+ };
311
+ };
312
+ ```
313
+
314
+ #### Example
315
+
316
+ ```typescript
317
+ // jest.config.ts
318
+ import {
319
+ createJsWithTsEsmLegacyPreset,
320
+ type JestConfigWithTsJest,
321
+ } from "ts-jest";
322
+
323
+ const presetConfig = createJsWithTsEsmLegacyPreset({
324
+ //...options
325
+ });
326
+
327
+ const jestConfig: JestConfigWithTsJest = {
328
+ ...presetConfig,
329
+ };
330
+
331
+ export default jestConfig;
332
+ ```
333
+
334
+ ### `createJsWithBabelPreset(options)`
335
+
336
+ Create a configuration to process JavaScript/TypeScript files (`.js`/`.jsx`/`.ts`/`.tsx`) which uses `babel-jest` to perform additional transformation.
337
+
338
+ #### Parameters
339
+
340
+ - `options` (OPTIONAL)
341
+ - `tsconfig`: see [tsconfig options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/tsconfig)
342
+ - `isolatedModules`: see [isolatedModules options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/isolatedModules)
343
+ - `compiler`: see [compiler options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/compiler)
344
+ - `astTransformers`: see [astTransformers options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/astTransformers)
345
+ - `diagnostics`: see [diagnostics options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/diagnostics)
346
+ - `babelConfig`: see [babelConfig options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/babelConfig)
347
+ - `stringifyContentPathRegex`: see [stringifyContentPathRegex options page](https://kulshekhar.github.io/ts-jest/docs/getting-started/options/stringifyContentPathRegex)
348
+
349
+ #### Returns
350
+
351
+ ```typescript
352
+ export type JsWithBabelPreset = {
353
+ transform: {
354
+ "^.+\\.[tj]sx?$": ["ts-jest", TsJestTransformerOptions];
355
+ };
356
+ };
357
+ ```
358
+
359
+ #### Example
360
+
361
+ ```typescript
362
+ // jest.config.ts
363
+ import { createJsWithBabelPreset, type JestConfigWithTsJest } from "ts-jest";
364
+
365
+ const presetConfig = createJsWithBabelPreset({
366
+ //...options
367
+ });
368
+
369
+ const jestConfig: JestConfigWithTsJest = {
370
+ ...presetConfig,
371
+ };
372
+
373
+ export default jestConfig;
374
+ ```
375
+
376
+ ### `createJsWithBabelLegacyPreset(options)`
377
+
378
+ Create a LEGACY configuration to process JavaScript/TypeScript files (`.js`/`.jsx`/`.ts`/`.tsx`) which uses `babel-jest` to perform additional transformation.
379
+
380
+ #### Parameters
381
+
382
+ Same as `createJsWithBabelPreset(options)`.
383
+
384
+ #### Returns
385
+
386
+ ```typescript
387
+ export type JsWithBabelPreset = {
388
+ transform: {
389
+ "^.+\\.[tj]sx?$": ["ts-jest/legacy", TsJestTransformerOptions];
390
+ };
391
+ };
392
+ ```
393
+
394
+ #### Example
395
+
396
+ ```typescript
397
+ // jest.config.ts
398
+ import {
399
+ createJsWithBabelLegacyPreset,
400
+ type JestConfigWithTsJest,
401
+ } from "ts-jest";
402
+
403
+ const presetConfig = createJsWithBabelLegacyPreset({
404
+ //...options
405
+ });
406
+
407
+ const jestConfig: JestConfigWithTsJest = {
408
+ ...presetConfig,
409
+ };
410
+
411
+ export default jestConfig;
412
+ ```
413
+
414
+ ### `createJsWithBabelEsmPreset(options)`
415
+
416
+ Create an ESM configuration to process JavaScript/TypeScript files (`.js`/`.mjs`/`.jsx`/`.mjsx`/`.ts`/`.mts`/`.tsx`/`.mtsx`) which uses `babel-jest` to perform additional transformation.
417
+
418
+ #### Parameters
419
+
420
+ Same as `createJsWithBabelPreset(options)`.
421
+
422
+ #### Returns
423
+
424
+ ```typescript
425
+ export type JsWithBabelPreset = {
426
+ transform: {
427
+ "^.+\\.[tj]sx?$": ["ts-jest", TsJestTransformerOptions];
428
+ };
429
+ };
430
+ ```
431
+
432
+ #### Example
433
+
434
+ ```typescript
435
+ // jest.config.ts
436
+ import { createJsWithBabelEsmPreset, type JestConfigWithTsJest } from "ts-jest";
437
+
438
+ const presetConfig = createJsWithBabelEsmPreset({
439
+ //...options
440
+ });
441
+
442
+ const jestConfig: JestConfigWithTsJest = {
443
+ ...presetConfig,
444
+ };
445
+
446
+ export default jestConfig;
447
+ ```
448
+
449
+ ### `createJsWithBabelEsmLegacyPreset(options)`
450
+
451
+ Create a LEGACY ESM configuration to process JavaScript/TypeScript files (`.js`/`.mjs`/`.jsx`/`.mjsx`/`.ts`/`.mts`/`.tsx`/`.mtsx`) which uses `babel-jest` to perform additional transformation.
452
+
453
+ #### Parameters
454
+
455
+ Same as `createJsWithBabelPreset(options)`.
456
+
457
+ #### Returns
458
+
459
+ ```typescript
460
+ export type JsWithBabelPreset = {
461
+ transform: {
462
+ "^.+\\.[tj]sx?$": ["ts-jest/legacy", TsJestTransformerOptions];
463
+ };
464
+ };
465
+ ```
466
+
467
+ #### Example
468
+
469
+ ```typescript
470
+ // jest.config.ts
471
+ import {
472
+ createJsWithBabelEsmLegacyPreset,
473
+ type JestConfigWithTsJest,
474
+ } from "ts-jest";
475
+
476
+ const presetConfig = createJsWithBabelEsmLegacyPreset({
477
+ //...options
478
+ });
479
+
480
+ const jestConfig: JestConfigWithTsJest = {
481
+ ...presetConfig,
482
+ };
483
+
484
+ export default jestConfig;
485
+ ```
486
+
487
+ ## Transformer Options Interface
488
+
489
+ All preset functions accept an optional `options` parameter with the following interface:
490
+
491
+ ```typescript
492
+ import type { TsConfigJson } from "type-fest";
493
+
494
+ interface TsJestTransformerOptions {
495
+ tsconfig?: boolean | string | TsConfigJson.CompilerOptions;
496
+ isolatedModules?: boolean;
497
+ astTransformers?: ConfigCustomTransformer;
498
+ diagnostics?:
499
+ | boolean
500
+ | {
501
+ pretty?: boolean;
502
+ ignoreCodes?: number | string | Array<number | string>;
503
+ exclude?: string[];
504
+ warnOnly?: boolean;
505
+ };
506
+ babelConfig?: boolean | string | BabelConfig; // Only for Babel presets
507
+ stringifyContentPathRegex?: string | RegExp;
508
+ }
509
+ ```
510
+
511
+ ## Legacy Presets (Deprecated)
512
+
513
+ > **WARNING**: `ts-jest` DOES NOT RECOMMEND using legacy presets because this approach is not flexible to configure Jest configuration. These legacy presets will be removed in the next major release and users are HIGHLY RECOMMENDED to migrate to use the utility functions above.
514
+
515
+ | Preset | Description |
516
+ | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
517
+ | `ts-jest/presets/default` or `ts-jest` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to CommonJS syntax, leaving JavaScript files (`.js`, `.jsx`) as-is. |
518
+ | `ts-jest/presets/default-legacy` or `ts-jest/legacy` (LEGACY) | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to CommonJS syntax, leaving JavaScript files (`.js`, `.jsx`) as-is. |
519
+ | `ts-jest/presets/default-esm` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to ESM syntax, leaving JavaScript files (`.js`, `.jsx`) as-is. |
520
+ | `ts-jest/presets/default-esm-legacy` (LEGACY) | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to ESM syntax, leaving JavaScript files (`.js`, `.jsx`) as-is. |
521
+ | `ts-jest/presets/js-with-ts` | TypeScript and JavaScript files (`.ts`, `.tsx`, `.js`, `.jsx`) will be transformed by `ts-jest` to CommonJS syntax. You'll need to set `allowJs` to `true` in your `tsconfig.json` file. |
522
+ | `ts-jest/presets/js-with-ts-legacy` (LEGACY) | TypeScript and JavaScript files (`.ts`, `.tsx`, `.js`, `.jsx`) will be transformed by `ts-jest` to CommonJS syntax. You'll need to set `allowJs` to `true` in your `tsconfig.json` file. |
523
+ | `ts-jest/presets/js-with-ts-esm` | TypeScript and JavaScript files (`.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`) will be transformed by `ts-jest` to ESM syntax. You'll need to set `allowJs` to `true` in your `tsconfig.json` file. |
524
+ | `ts-jest/presets/js-with-ts-esm-legacy` (LEGACY) | TypeScript and JavaScript files (`.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`) will be transformed by `ts-jest` to ESM syntax. You'll need to set `allowJs` to `true` in your `tsconfig.json` file. |
525
+ | `ts-jest/presets/js-with-babel` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to CommonJS syntax, and JavaScript files (`.js`, `.jsx`) will be transformed by `babel-jest`. |
526
+ | `ts-jest/presets/js-with-babel-legacy` (LEGACY) | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to CommonJS syntax, and JavaScript files (`.js`, `.jsx`) will be transformed by `babel-jest`. |
527
+ | `ts-jest/presets/js-with-babel-esm` | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to ESM syntax, and JavaScript files (`.js`, `.jsx`, `.mjs`) will be transformed by `babel-jest`. |
528
+ | `ts-jest/presets/js-with-babel-esm-legacy` (LEGACY) | TypeScript files (`.ts`, `.tsx`) will be transformed by `ts-jest` to ESM syntax, and JavaScript files (`.js`, `.jsx`, `.mjs`) will be transformed by `babel-jest`. |
529
+
530
+ ### Legacy Preset Example
531
+
532
+ ```typescript
533
+ // jest.config.ts
534
+ import type { JestConfigWithTsJest } from "ts-jest";
535
+
536
+ const jestConfig: JestConfigWithTsJest = {
537
+ // Replace `<preset_name>` with one of the preset names from the table above
538
+ preset: "<preset_name>",
539
+ };
540
+
541
+ export default jestConfig;
542
+ ```
543
+
544
+ ## References
545
+
546
+ - [Official ts-jest Presets Documentation](https://kulshekhar.github.io/ts-jest/docs/getting-started/presets)
547
+ - [ts-jest Installation Guide](https://kulshekhar.github.io/ts-jest/docs/getting-started/installation)
548
+ - [ts-jest Options](https://kulshekhar.github.io/ts-jest/docs/getting-started/options)
@@ -3,6 +3,9 @@
3
3
  * @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
4
4
  * @req REQ-MAINT-BATCH - Perform batch updates
5
5
  * @req REQ-MAINT-VERIFY - Verify annotation references
6
+ * @param codebasePath Absolute path to the workspace root where annotations will be updated.
7
+ * @param mappings Array of mapping objects describing path changes, each containing an oldPath and newPath.
8
+ * @returns Total number of updated @story annotations across all mappings.
6
9
  */
7
10
  export declare function batchUpdateAnnotations(codebasePath: string, mappings: {
8
11
  oldPath: string;
@@ -12,5 +15,7 @@ export declare function batchUpdateAnnotations(codebasePath: string, mappings: {
12
15
  * Verify annotation references in codebase after maintenance operations
13
16
  * @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
14
17
  * @req REQ-MAINT-VERIFY - Verify annotation references
18
+ * @param codebasePath Absolute path to the workspace root whose annotations should be verified.
19
+ * @returns Boolean indicating whether there are no stale annotations remaining (true if clean, false if any remain).
15
20
  */
16
21
  export declare function verifyAnnotations(codebasePath: string): boolean;
@@ -9,6 +9,9 @@ const detect_1 = require("./detect");
9
9
  * @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
10
10
  * @req REQ-MAINT-BATCH - Perform batch updates
11
11
  * @req REQ-MAINT-VERIFY - Verify annotation references
12
+ * @param codebasePath Absolute path to the workspace root where annotations will be updated.
13
+ * @param mappings Array of mapping objects describing path changes, each containing an oldPath and newPath.
14
+ * @returns Total number of updated @story annotations across all mappings.
12
15
  */
13
16
  function batchUpdateAnnotations(codebasePath, mappings) {
14
17
  let totalUpdated = 0;
@@ -22,6 +25,8 @@ function batchUpdateAnnotations(codebasePath, mappings) {
22
25
  * Verify annotation references in codebase after maintenance operations
23
26
  * @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
24
27
  * @req REQ-MAINT-VERIFY - Verify annotation references
28
+ * @param codebasePath Absolute path to the workspace root whose annotations should be verified.
29
+ * @returns Boolean indicating whether there are no stale annotations remaining (true if clean, false if any remain).
25
30
  */
26
31
  function verifyAnnotations(codebasePath) {
27
32
  const staleAnnotations = (0, detect_1.detectStaleAnnotations)(codebasePath);