eslint-plugin-traceability 1.7.1 → 1.8.1

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 (39) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +76 -37
  3. package/SECURITY.md +132 -0
  4. package/lib/src/index.d.ts +6 -35
  5. package/lib/src/index.js +8 -5
  6. package/lib/src/maintenance/batch.d.ts +5 -0
  7. package/lib/src/maintenance/batch.js +5 -0
  8. package/lib/src/maintenance/cli.js +34 -212
  9. package/lib/src/maintenance/commands.d.ts +32 -0
  10. package/lib/src/maintenance/commands.js +139 -0
  11. package/lib/src/maintenance/detect.d.ts +2 -0
  12. package/lib/src/maintenance/detect.js +4 -0
  13. package/lib/src/maintenance/flags.d.ts +99 -0
  14. package/lib/src/maintenance/flags.js +121 -0
  15. package/lib/src/maintenance/report.d.ts +2 -0
  16. package/lib/src/maintenance/report.js +2 -0
  17. package/lib/src/maintenance/update.d.ts +4 -0
  18. package/lib/src/maintenance/update.js +4 -0
  19. package/lib/src/rules/helpers/require-story-io.d.ts +3 -0
  20. package/lib/src/rules/helpers/require-story-io.js +20 -6
  21. package/lib/src/rules/helpers/valid-annotation-options.js +15 -4
  22. package/lib/src/rules/helpers/valid-annotation-utils.js +5 -0
  23. package/lib/src/rules/helpers/valid-story-reference-helpers.d.ts +3 -4
  24. package/lib/src/utils/reqAnnotationDetection.d.ts +4 -1
  25. package/lib/src/utils/reqAnnotationDetection.js +43 -15
  26. package/lib/tests/config/flat-config-presets-integration.test.d.ts +1 -0
  27. package/lib/tests/config/flat-config-presets-integration.test.js +75 -0
  28. package/lib/tests/maintenance/cli.test.js +89 -0
  29. package/lib/tests/plugin-default-export-and-configs.test.js +0 -2
  30. package/lib/tests/rules/prefer-implements-annotation.test.js +28 -0
  31. package/lib/tests/rules/require-req-annotation.test.js +8 -1
  32. package/lib/tests/rules/require-story-annotation.test.js +9 -4
  33. package/lib/tests/utils/ts-language-options.d.ts +1 -7
  34. package/lib/tests/utils/ts-language-options.js +8 -5
  35. package/package.json +11 -7
  36. package/user-docs/api-reference.md +527 -0
  37. package/user-docs/eslint-9-setup-guide.md +722 -0
  38. package/user-docs/examples.md +74 -0
  39. package/user-docs/migration-guide.md +174 -0
@@ -0,0 +1,722 @@
1
+ # ESLint 9 Setup Guide
2
+
3
+ Created autonomously by [voder.ai](https://voder.ai)
4
+ Applies to projects using eslint-plugin-traceability 1.x with ESLint 9 flat config. For the current plugin version and release notes, see GitHub Releases: <https://github.com/voder-ai/eslint-plugin-traceability/releases>.
5
+
6
+ This guide shows how to properly set up ESLint 9 with flat configuration format. ESLint 9 uses flat config by default and has several important changes from previous versions.
7
+
8
+ ## Table of Contents
9
+
10
+ - [Quick Setup](#quick-setup)
11
+ - [Configuration File Format](#configuration-file-format)
12
+ - [ESM vs CommonJS Config Files](#esm-vs-commonjs-config-files)
13
+ - [Common Configuration Patterns](#common-configuration-patterns)
14
+ - [Package.json Scripts](#packagejson-scripts)
15
+ - [TypeScript Integration](#typescript-integration)
16
+ - [Common Issues and Solutions](#common-issues-and-solutions)
17
+ - [Troubleshooting ESLint Configuration](#troubleshooting-eslint-configuration)
18
+ - [Working Example](#working-example)
19
+
20
+ ## Quick Setup
21
+
22
+ ### 1. Install Dependencies
23
+
24
+ ```bash
25
+ # Core ESLint v9
26
+ npm install --save-dev eslint@^9.39.1
27
+
28
+ # Recommended configurations
29
+ npm install --save-dev @eslint/js@^9.39.1
30
+
31
+ # Traceability plugin
32
+ npm install --save-dev eslint-plugin-traceability@^1.0.0
33
+
34
+ # For TypeScript projects
35
+ npm install --save-dev @typescript-eslint/parser@^8.0.0
36
+ npm install --save-dev @typescript-eslint/utils@^8.0.0
37
+
38
+ # For testing (if using Jest)
39
+ npm install --save-dev @types/eslint@^9.0.0
40
+ ```
41
+
42
+ ### 2. Create Configuration File
43
+
44
+ Create `eslint.config.js` (not `.eslintrc.*`):
45
+
46
+ ```javascript
47
+ import js from "@eslint/js";
48
+
49
+ export default [
50
+ js.configs.recommended,
51
+ {
52
+ files: ["**/*.js", "**/*.mjs"],
53
+ rules: {
54
+ // Your custom rules here
55
+ },
56
+ },
57
+ ];
58
+ ```
59
+
60
+ ### 3. Add Scripts to package.json
61
+
62
+ ```json
63
+ {
64
+ "scripts": {
65
+ "lint": "eslint .",
66
+ "lint:fix": "eslint . --fix"
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### 4. Enable Traceability Plugin
72
+
73
+ To integrate the traceability plugin with its **recommended** preset, update your `eslint.config.js`:
74
+
75
+ ```javascript
76
+ import js from "@eslint/js";
77
+ import traceability from "eslint-plugin-traceability";
78
+
79
+ export default [
80
+ js.configs.recommended,
81
+ {
82
+ plugins: {
83
+ traceability,
84
+ },
85
+ },
86
+ ...traceability.configs.recommended,
87
+ ];
88
+ ```
89
+
90
+ To use the **strict** preset instead:
91
+
92
+ ```javascript
93
+ import js from "@eslint/js";
94
+ import traceability from "eslint-plugin-traceability";
95
+
96
+ export default [
97
+ js.configs.recommended,
98
+ {
99
+ plugins: {
100
+ traceability,
101
+ },
102
+ },
103
+ ...traceability.configs.strict,
104
+ ];
105
+ ```
106
+
107
+ Note: The `traceability.configs.recommended` and `traceability.configs.strict` presets define rule severities only. They expect the plugin to be registered in a preceding flat-config object via:
108
+
109
+ ```javascript
110
+ {
111
+ plugins: {
112
+ traceability,
113
+ },
114
+ }
115
+ ```
116
+
117
+ ## Configuration File Format
118
+
119
+ ### Key Changes from ESLintRC
120
+
121
+ - **File name**: `eslint.config.js` (not `.eslintrc.*`)
122
+ - **Format**: Array of configuration objects (not single object)
123
+ - **Import style**: ES modules by default
124
+ - **No extends**: Use imports and spread syntax instead
125
+
126
+ ### Basic Structure
127
+
128
+ ```javascript
129
+ // eslint.config.js
130
+ import js from "@eslint/js";
131
+
132
+ export default [
133
+ // Apply to all files
134
+ js.configs.recommended,
135
+
136
+ // Specific configuration objects
137
+ {
138
+ files: ["**/*.js"], // File patterns
139
+ languageOptions: {
140
+ ecmaVersion: 2024,
141
+ sourceType: "module",
142
+ },
143
+ rules: {
144
+ // Rule configurations
145
+ },
146
+ },
147
+
148
+ // Ignore patterns
149
+ {
150
+ ignores: ["dist/**", "build/**", "node_modules/**"],
151
+ },
152
+ ];
153
+ ```
154
+
155
+ ## ESM vs CommonJS Config Files
156
+
157
+ ESLint 9's flat config system works with both ESM and CommonJS configs; which one you use depends on your Node setup:
158
+
159
+ - **ESM (recommended for new projects)**
160
+ - Use `eslint.config.js` or `eslint.config.mjs` that exports with `export default [...]`.
161
+ - Your `package.json` typically has `{ "type": "module" }`, or you use the `.mjs` extension.
162
+ - Examples in this guide that use `import ... from` and `export default [...]` assume an ESM config.
163
+
164
+ - **CommonJS**
165
+ - Use `eslint.config.cjs` or `eslint.config.js` with `module.exports = [...]`.
166
+ - Your `package.json` typically omits `"type": "module"` (or explicitly sets `"type": "commonjs"`).
167
+ - This style matches the example in the project README that shows `module.exports = [...]`.
168
+
169
+ Both forms are supported by ESLint 9 as long as the file extension and `package.json` `type` setting are consistent. Pick the style that matches the rest of your Node tooling and stick to it across your project.
170
+
171
+ ## Common Configuration Patterns
172
+
173
+ ### 1. JavaScript Only Project
174
+
175
+ ```javascript
176
+ // eslint.config.js
177
+ import js from "@eslint/js";
178
+ import traceability from "eslint-plugin-traceability";
179
+
180
+ export default [
181
+ js.configs.recommended,
182
+ {
183
+ plugins: {
184
+ traceability,
185
+ },
186
+ },
187
+ ...traceability.configs.recommended,
188
+ {
189
+ files: ["**/*.js", "**/*.mjs"],
190
+ languageOptions: {
191
+ ecmaVersion: 2024,
192
+ sourceType: "module",
193
+ },
194
+ rules: {
195
+ "no-unused-vars": "error",
196
+ "no-console": "warn",
197
+ },
198
+ },
199
+ {
200
+ ignores: ["dist/**", "build/**"],
201
+ },
202
+ ];
203
+ ```
204
+
205
+ ### 2. TypeScript Project
206
+
207
+ ```javascript
208
+ // eslint.config.js
209
+ import js from "@eslint/js";
210
+ import typescriptParser from "@typescript-eslint/parser";
211
+ import traceability from "eslint-plugin-traceability";
212
+
213
+ export default [
214
+ js.configs.recommended,
215
+ {
216
+ plugins: {
217
+ traceability,
218
+ },
219
+ },
220
+ ...traceability.configs.recommended,
221
+ {
222
+ files: ["**/*.ts", "**/*.tsx"],
223
+ languageOptions: {
224
+ parser: typescriptParser,
225
+ parserOptions: {
226
+ project: "./tsconfig.json",
227
+ tsconfigRootDir: import.meta.dirname,
228
+ ecmaVersion: 2024,
229
+ sourceType: "module",
230
+ },
231
+ },
232
+ rules: {
233
+ "@typescript-eslint/no-unused-vars": "error",
234
+ },
235
+ },
236
+ {
237
+ files: ["**/*.js", "**/*.mjs"],
238
+ languageOptions: {
239
+ ecmaVersion: 2024,
240
+ sourceType: "module",
241
+ },
242
+ },
243
+ ];
244
+ ```
245
+
246
+ ### Mixed JavaScript/TypeScript Projects
247
+
248
+ ```javascript
249
+ // eslint.config.js
250
+ import js from "@eslint/js";
251
+ import typescriptParser from "@typescript-eslint/parser";
252
+ import traceability from "eslint-plugin-traceability";
253
+
254
+ export default [
255
+ js.configs.recommended,
256
+ {
257
+ plugins: {
258
+ traceability,
259
+ },
260
+ },
261
+ ...traceability.configs.recommended,
262
+ {
263
+ files: ["**/*.{js,jsx,ts,tsx}"],
264
+ languageOptions: {
265
+ parser: typescriptParser,
266
+ parserOptions: {
267
+ project: "./tsconfig.json",
268
+ tsconfigRootDir: import.meta.dirname,
269
+ ecmaVersion: 2024,
270
+ sourceType: "module",
271
+ },
272
+ ecmaVersion: 2024,
273
+ sourceType: "module",
274
+ },
275
+ rules: {
276
+ // Combined JS and TS rules
277
+ "no-unused-vars": "error",
278
+ "@typescript-eslint/no-unused-vars": "error",
279
+ },
280
+ },
281
+ ];
282
+ ```
283
+
284
+ ### 3. Node.js Configuration Files (CommonJS)
285
+
286
+ ```javascript
287
+ // eslint.config.js
288
+ export default [
289
+ {
290
+ // Config files that use CommonJS
291
+ files: ["*.config.js", "*.config.mjs", "jest.config.js"],
292
+ languageOptions: {
293
+ ecmaVersion: 2024,
294
+ sourceType: "commonjs",
295
+ globals: {
296
+ require: "readonly",
297
+ module: "readonly",
298
+ exports: "readonly",
299
+ __dirname: "readonly",
300
+ __filename: "readonly",
301
+ console: "readonly",
302
+ process: "readonly",
303
+ },
304
+ },
305
+ },
306
+ ];
307
+ ```
308
+
309
+ ### 4. Test Files (Jest/Vitest)
310
+
311
+ ```javascript
312
+ // eslint.config.js
313
+ export default [
314
+ {
315
+ files: [
316
+ "**/*.test.{js,ts}",
317
+ "**/__tests__/**/*.{js,ts}",
318
+ "**/tests/**/*.{js,ts}",
319
+ ],
320
+ languageOptions: {
321
+ globals: {
322
+ describe: "readonly",
323
+ it: "readonly",
324
+ test: "readonly",
325
+ expect: "readonly",
326
+ beforeEach: "readonly",
327
+ afterEach: "readonly",
328
+ beforeAll: "readonly",
329
+ afterAll: "readonly",
330
+ jest: "readonly",
331
+ vi: "readonly", // for Vitest
332
+ },
333
+ },
334
+ },
335
+ ];
336
+ ```
337
+
338
+ ### Monorepos / Workspaces
339
+
340
+ ```javascript
341
+ // eslint.config.js
342
+ import js from "@eslint/js";
343
+ import typescriptParser from "@typescript-eslint/parser";
344
+ import traceability from "eslint-plugin-traceability";
345
+
346
+ export default [
347
+ js.configs.recommended,
348
+ {
349
+ plugins: {
350
+ traceability,
351
+ },
352
+ },
353
+ ...traceability.configs.recommended,
354
+ {
355
+ // Lint all packages in a monorepo/workspace
356
+ files: ["packages/*/src/**/*.{js,ts,tsx}"],
357
+ languageOptions: {
358
+ parser: typescriptParser,
359
+ parserOptions: {
360
+ project: ["./packages/*/tsconfig.json"],
361
+ tsconfigRootDir: import.meta.dirname,
362
+ ecmaVersion: 2024,
363
+ sourceType: "module",
364
+ },
365
+ ecmaVersion: 2024,
366
+ sourceType: "module",
367
+ },
368
+ rules: {
369
+ // Monorepo-specific rules
370
+ "no-unused-vars": "error",
371
+ },
372
+ },
373
+ ];
374
+ ```
375
+
376
+ ## Package.json Scripts
377
+
378
+ ### Recommended Scripts
379
+
380
+ ```json
381
+ {
382
+ "scripts": {
383
+ "lint": "eslint .",
384
+ "lint:fix": "eslint . --fix",
385
+ "lint:check": "eslint . --max-warnings 0"
386
+ }
387
+ }
388
+ ```
389
+
390
+ ### For Plugin Development (with Build Step)
391
+
392
+ ```json
393
+ {
394
+ "scripts": {
395
+ "prelint": "npm run build",
396
+ "build": "tsc",
397
+ "lint": "eslint .",
398
+ "lint:fix": "eslint . --fix"
399
+ }
400
+ }
401
+ ```
402
+
403
+ ## TypeScript Integration
404
+
405
+ ### Parser Configuration
406
+
407
+ ```javascript
408
+ // eslint.config.js
409
+ import typescriptParser from "@typescript-eslint/parser";
410
+
411
+ export default [
412
+ {
413
+ files: ["**/*.ts", "**/*.tsx"],
414
+ languageOptions: {
415
+ parser: typescriptParser, // Import the parser object directly
416
+ parserOptions: {
417
+ project: "./tsconfig.json",
418
+ tsconfigRootDir: import.meta.dirname, // Use import.meta.dirname in ESM
419
+ ecmaVersion: 2024,
420
+ sourceType: "module",
421
+ },
422
+ },
423
+ },
424
+ ];
425
+ ```
426
+
427
+ ### Common TypeScript Rules
428
+
429
+ ```javascript
430
+ export default [
431
+ {
432
+ files: ["**/*.ts", "**/*.tsx"],
433
+ rules: {
434
+ "@typescript-eslint/no-unused-vars": "error",
435
+ "@typescript-eslint/explicit-function-return-type": "warn",
436
+ "@typescript-eslint/no-explicit-any": "warn",
437
+ "@typescript-eslint/prefer-const": "error",
438
+ },
439
+ },
440
+ ];
441
+ ```
442
+
443
+ ## Common Issues and Solutions
444
+
445
+ ### Issue: "Expected object with parse() method"
446
+
447
+ **Problem**: Using `require.resolve()` for parser
448
+
449
+ ```javascript
450
+ // ❌ Wrong
451
+ languageOptions: {
452
+ parser: require.resolve("@typescript-eslint/parser");
453
+ }
454
+ ```
455
+
456
+ **Solution**: Import parser directly
457
+
458
+ ```javascript
459
+ // ✅ Correct
460
+ import typescriptParser from "@typescript-eslint/parser";
461
+
462
+ languageOptions: {
463
+ parser: typescriptParser;
464
+ }
465
+ ```
466
+
467
+ ### Issue: "eslint:recommended" not working
468
+
469
+ **Problem**: Using string reference
470
+
471
+ ```javascript
472
+ // ❌ Wrong
473
+ export default ["eslint:recommended"];
474
+ ```
475
+
476
+ **Solution**: Import from @eslint/js
477
+
478
+ ```javascript
479
+ // ✅ Correct
480
+ import js from "@eslint/js";
481
+
482
+ export default [js.configs.recommended];
483
+ ```
484
+
485
+ ### Issue: CLI flags not working
486
+
487
+ **Problem**: Using deprecated flags
488
+
489
+ ```bash
490
+ # ❌ Wrong (deprecated in flat config)
491
+ eslint src --ext .ts --config eslint.config.js
492
+ ```
493
+
494
+ **Solution**: Use file patterns in config
495
+
496
+ ```bash
497
+ # ✅ Correct
498
+ eslint .
499
+ ```
500
+
501
+ ### Issue: Globals not defined
502
+
503
+ **Problem**: Missing environment globals
504
+
505
+ ```javascript
506
+ // ❌ Wrong - globals not defined
507
+ export default [
508
+ {
509
+ files: ["**/*.js"],
510
+ // Missing globals for Node.js/browser
511
+ },
512
+ ];
513
+ ```
514
+
515
+ **Solution**: Define globals explicitly
516
+
517
+ ```javascript
518
+ // ✅ Correct
519
+ export default [
520
+ {
521
+ files: ["**/*.js"],
522
+ languageOptions: {
523
+ globals: {
524
+ console: "readonly",
525
+ process: "readonly",
526
+ Buffer: "readonly",
527
+ // etc.
528
+ },
529
+ },
530
+ },
531
+ ];
532
+ ```
533
+
534
+ ## Troubleshooting ESLint Configuration
535
+
536
+ The following scenarios cover common issues when configuring ESLint 9 with flat config, especially in mixed JavaScript and TypeScript projects.
537
+
538
+ ### Mixed JavaScript/TypeScript Projects
539
+
540
+ Problem: ESLint does not correctly apply rules to `.js`, `.jsx`, `.ts`, or `.tsx` files when using separate file patterns or incorrect parser configuration.
541
+
542
+ Solution: Use combined file patterns or separate override blocks, and import the parser correctly. For example:
543
+
544
+ ```javascript
545
+ // eslint.config.js
546
+ import js from "@eslint/js";
547
+ import typescriptParser from "@typescript-eslint/parser";
548
+ import traceability from "eslint-plugin-traceability";
549
+
550
+ export default [
551
+ js.configs.recommended,
552
+ {
553
+ plugins: {
554
+ traceability,
555
+ },
556
+ },
557
+ ...traceability.configs.recommended,
558
+ {
559
+ files: ["**/*.{js,jsx,ts,tsx}"],
560
+ languageOptions: {
561
+ parser: typescriptParser,
562
+ parserOptions: {
563
+ project: "./tsconfig.json",
564
+ tsconfigRootDir: import.meta.dirname,
565
+ ecmaVersion: 2024,
566
+ sourceType: "module",
567
+ },
568
+ ecmaVersion: 2024,
569
+ sourceType: "module",
570
+ },
571
+ rules: {
572
+ // Combined JS and TS rules
573
+ "no-unused-vars": "error",
574
+ "@typescript-eslint/no-unused-vars": "error",
575
+ },
576
+ },
577
+ ];
578
+ ```
579
+
580
+ ## Working Example
581
+
582
+ Here's a complete working configuration for a TypeScript ESLint plugin project:
583
+
584
+ ```javascript
585
+ // eslint.config.js
586
+ import js from "@eslint/js";
587
+ import typescriptParser from "@typescript-eslint/parser";
588
+ import traceability from "eslint-plugin-traceability";
589
+
590
+ // Conditional plugin loading (for plugin development)
591
+ let plugin;
592
+ try {
593
+ plugin = await import("./lib/index.js");
594
+ } catch {
595
+ console.warn("Plugin not built yet, skipping traceability rules");
596
+ plugin = {};
597
+ }
598
+
599
+ export default [
600
+ js.configs.recommended,
601
+ {
602
+ // Register the traceability plugin for subsequent presets/rules
603
+ plugins: {
604
+ traceability,
605
+ ...(plugin.rules ? { traceabilityDev: plugin } : {}),
606
+ },
607
+ },
608
+ // Apply the recommended preset for the published plugin
609
+ ...traceability.configs.recommended,
610
+ {
611
+ // Node.js config files (CommonJS)
612
+ files: ["*.config.js", "*.config.mjs", "jest.config.js"],
613
+ languageOptions: {
614
+ ecmaVersion: 2024,
615
+ sourceType: "commonjs",
616
+ globals: {
617
+ require: "readonly",
618
+ module: "readonly",
619
+ exports: "readonly",
620
+ __dirname: "readonly",
621
+ __filename: "readonly",
622
+ console: "readonly",
623
+ process: "readonly",
624
+ },
625
+ },
626
+ },
627
+ {
628
+ // TypeScript files
629
+ files: ["**/*.ts", "**/*.tsx"],
630
+ languageOptions: {
631
+ parser: typescriptParser,
632
+ parserOptions: {
633
+ project: "./tsconfig.json",
634
+ tsconfigRootDir: import.meta.dirname,
635
+ ecmaVersion: 2024,
636
+ sourceType: "module",
637
+ },
638
+ },
639
+ plugins: {
640
+ ...(plugin.rules ? { traceabilityDev: plugin } : {}),
641
+ },
642
+ rules: {
643
+ "@typescript-eslint/no-unused-vars": "error",
644
+ },
645
+ },
646
+ {
647
+ // JavaScript files
648
+ files: ["**/*.js", "**/*.mjs"],
649
+ languageOptions: {
650
+ ecmaVersion: 2024,
651
+ sourceType: "module",
652
+ },
653
+ plugins: {
654
+ ...(plugin.rules ? { traceabilityDev: plugin } : {}),
655
+ },
656
+ },
657
+ {
658
+ // Test files
659
+ files: [
660
+ "**/*.test.{js,ts}",
661
+ "**/__tests__/**/*.{js,ts}",
662
+ "**/tests/**/*.{js,ts}",
663
+ ],
664
+ languageOptions: {
665
+ globals: {
666
+ describe: "readonly",
667
+ it: "readonly",
668
+ test: "readonly",
669
+ expect: "readonly",
670
+ beforeEach: "readonly",
671
+ afterEach: "readonly",
672
+ beforeAll: "readonly",
673
+ afterAll: "readonly",
674
+ jest: "readonly",
675
+ },
676
+ },
677
+ },
678
+ {
679
+ // Ignore patterns
680
+ ignores: [
681
+ "lib/**",
682
+ "dist/**",
683
+ "build/**",
684
+ "node_modules/**",
685
+ "coverage/**",
686
+ ],
687
+ },
688
+ ];
689
+ ```
690
+
691
+ ### Corresponding package.json:
692
+
693
+ ```json
694
+ {
695
+ "scripts": {
696
+ "prelint": "npm run build",
697
+ "build": "tsc",
698
+ "lint": "eslint .",
699
+ "lint:fix": "eslint . --fix",
700
+ "type-check": "tsc --noEmit"
701
+ },
702
+ "devDependencies": {
703
+ "@eslint/js": "^9.39.1",
704
+ "@typescript-eslint/parser": "^8.46.4",
705
+ "@typescript-eslint/utils": "^8.46.4",
706
+ "eslint": "^9.39.1",
707
+ "eslint-plugin-traceability": "^1.0.0",
708
+ "typescript": "^5.9.3"
709
+ }
710
+ }
711
+ ```
712
+
713
+ ## Key Takeaways
714
+
715
+ 1. **Use `eslint.config.js`**, not `.eslintrc.*`
716
+ 2. **Import configurations**, don't use string references
717
+ 3. **Import parsers directly**, don't use `require.resolve()`
718
+ 4. **Define globals explicitly** for different environments
719
+ 5. **Use file patterns** instead of CLI `--ext` flags
720
+ 6. **Structure as array of objects**, each targeting specific file types
721
+ 7. **Use `ignores`** instead of `.eslintignore` files
722
+ 8. **Register plugins explicitly** in flat config before spreading their presets