@tcy/eslint-rules 1.7.0 → 1.9.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 (43) hide show
  1. package/coverage/clover.xml +122 -4
  2. package/coverage/coverage-final.json +2 -0
  3. package/coverage/lcov-report/index.html +19 -19
  4. package/coverage/lcov-report/src/array-elements-per-line.js.html +1 -1
  5. package/coverage/lcov-report/src/back/back.js.html +1 -1
  6. package/coverage/lcov-report/src/back/http.js.html +1 -1
  7. package/coverage/lcov-report/src/back/index.html +1 -1
  8. package/coverage/lcov-report/src/back/recommended.js.html +1 -1
  9. package/coverage/lcov-report/src/bin/eslint-cache-guard.js.html +1 -1
  10. package/coverage/lcov-report/src/bin/index.html +1 -1
  11. package/coverage/lcov-report/src/client/client.js.html +8 -2
  12. package/coverage/lcov-report/src/client/index.html +1 -1
  13. package/coverage/lcov-report/src/client/recommended.js.html +1 -1
  14. package/coverage/lcov-report/src/decorator-type-enforcement.js.html +1 -1
  15. package/coverage/lcov-report/src/enforce-tailwind-important.js.html +1 -1
  16. package/coverage/lcov-report/src/export-specifiers-per-line.js.html +1 -1
  17. package/coverage/lcov-report/src/import-specifiers-per-line.js.html +1 -1
  18. package/coverage/lcov-report/src/index.html +39 -9
  19. package/coverage/lcov-report/src/index.js.html +1 -1
  20. package/coverage/lcov-report/src/jsx-boolean-shorthand.js.html +1 -1
  21. package/coverage/lcov-report/src/jsx-expression-string-literals.js.html +1 -1
  22. package/coverage/lcov-report/src/jsx-ref-string-exists.js.html +1 -1
  23. package/coverage/lcov-report/src/no-static-key-in-map.js.html +631 -0
  24. package/coverage/lcov-report/src/plugin.js.html +14 -2
  25. package/coverage/lcov-report/src/recommended.js.html +1 -1
  26. package/coverage/lcov-report/src/require-fragment-key.js.html +787 -0
  27. package/coverage/lcov-report/src/route-dto-required.js.html +1 -1
  28. package/coverage/lcov-report/src/v-model-name-match.js.html +1 -1
  29. package/coverage/lcov-report/src/vuejs-define-component.js.html +1 -1
  30. package/coverage/lcov-report/src/vuejs-define-workspace.js.html +1 -1
  31. package/coverage/lcov.info +316 -0
  32. package/decl/back/back.d.ts +42 -0
  33. package/decl/client/client.d.ts +44 -0
  34. package/decl/no-static-key-in-map.d.ts +66 -0
  35. package/decl/plugin.d.ts +42 -0
  36. package/decl/require-fragment-key.d.ts +69 -0
  37. package/package.json +9 -9
  38. package/src/client/client.js +2 -0
  39. package/src/no-static-key-in-map.js +182 -0
  40. package/src/plugin.js +4 -0
  41. package/src/require-fragment-key.js +234 -0
  42. package/tests/no-static-key-in-map.spec.js +186 -0
  43. package/tests/require-fragment-key.spec.js +160 -0
@@ -298,7 +298,7 @@ export default {
298
298
  <div class='footer quiet pad2 space-top1 center small'>
299
299
  Code coverage generated by
300
300
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
301
- at 2026-07-20T10:30:34.608Z
301
+ at 2026-09-08T15:20:28.268Z
302
302
  </div>
303
303
  <script src="../prettify.js"></script>
304
304
  <script>
@@ -289,7 +289,7 @@
289
289
  <div class='footer quiet pad2 space-top1 center small'>
290
290
  Code coverage generated by
291
291
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
292
- at 2026-07-20T10:30:34.608Z
292
+ at 2026-09-08T15:20:28.268Z
293
293
  </div>
294
294
  <script src="../prettify.js"></script>
295
295
  <script>
@@ -328,7 +328,7 @@ export default {
328
328
  <div class='footer quiet pad2 space-top1 center small'>
329
329
  Code coverage generated by
330
330
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
331
- at 2026-07-20T10:30:34.608Z
331
+ at 2026-09-08T15:20:28.268Z
332
332
  </div>
333
333
  <script src="../prettify.js"></script>
334
334
  <script>
@@ -265,7 +265,7 @@ export default {
265
265
  <div class='footer quiet pad2 space-top1 center small'>
266
266
  Code coverage generated by
267
267
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
268
- at 2026-07-20T10:30:34.608Z
268
+ at 2026-09-08T15:20:28.268Z
269
269
  </div>
270
270
  <script src="../prettify.js"></script>
271
271
  <script>
@@ -554,6 +554,121 @@ BRF:18
554
554
  BRH:0
555
555
  end_of_record
556
556
  TN:
557
+ SF:src/no-static-key-in-map.js
558
+ FN:61,(anonymous_0)
559
+ FN:76,(anonymous_1)
560
+ FN:80,(anonymous_2)
561
+ FN:97,(anonymous_3)
562
+ FN:113,(anonymous_4)
563
+ FN:136,(anonymous_5)
564
+ FN:162,(anonymous_6)
565
+ FN:165,(anonymous_7)
566
+ FNF:8
567
+ FNH:6
568
+ FNDA:21,(anonymous_0)
569
+ FNDA:32,(anonymous_1)
570
+ FNDA:28,(anonymous_2)
571
+ FNDA:10,(anonymous_3)
572
+ FNDA:18,(anonymous_4)
573
+ FNDA:23,(anonymous_5)
574
+ FNDA:0,(anonymous_6)
575
+ FNDA:0,(anonymous_7)
576
+ DA:28,1
577
+ DA:30,1
578
+ DA:39,1
579
+ DA:47,1
580
+ DA:61,1
581
+ DA:62,21
582
+ DA:63,21
583
+ DA:64,15
584
+ DA:65,10
585
+ DA:66,9
586
+ DA:76,1
587
+ DA:77,32
588
+ DA:79,32
589
+ DA:80,28
590
+ DA:84,32
591
+ DA:86,28
592
+ DA:88,28
593
+ DA:89,28
594
+ DA:90,11
595
+ DA:93,17
596
+ DA:97,1
597
+ DA:98,10
598
+ DA:99,10
599
+ DA:113,1
600
+ DA:114,18
601
+ DA:116,18
602
+ DA:117,26
603
+ DA:118,8
604
+ DA:119,8
605
+ DA:121,18
606
+ DA:125,10
607
+ DA:128,8
608
+ DA:130,0
609
+ DA:136,1
610
+ DA:137,23
611
+ DA:138,23
612
+ DA:139,15
613
+ DA:163,0
614
+ DA:165,0
615
+ DA:166,0
616
+ DA:167,0
617
+ DA:169,0
618
+ DA:178,0
619
+ LF:43
620
+ LH:36
621
+ BRDA:62,0,0,0
622
+ BRDA:62,0,1,21
623
+ BRDA:63,1,0,6
624
+ BRDA:63,1,1,15
625
+ BRDA:64,2,0,5
626
+ BRDA:64,2,1,10
627
+ BRDA:65,3,0,1
628
+ BRDA:65,3,1,9
629
+ BRDA:77,4,0,0
630
+ BRDA:77,4,1,32
631
+ BRDA:77,5,0,32
632
+ BRDA:77,5,1,32
633
+ BRDA:80,6,0,28
634
+ BRDA:80,6,1,28
635
+ BRDA:80,6,2,28
636
+ BRDA:84,7,0,4
637
+ BRDA:84,7,1,28
638
+ BRDA:88,8,0,0
639
+ BRDA:88,8,1,28
640
+ BRDA:89,9,0,11
641
+ BRDA:89,9,1,17
642
+ BRDA:90,10,0,3
643
+ BRDA:90,10,1,8
644
+ BRDA:93,11,0,17
645
+ BRDA:93,11,1,0
646
+ BRDA:99,12,0,10
647
+ BRDA:99,12,1,10
648
+ BRDA:99,12,2,10
649
+ BRDA:99,12,3,10
650
+ BRDA:99,12,4,10
651
+ BRDA:99,12,5,10
652
+ BRDA:117,13,0,8
653
+ BRDA:117,13,1,18
654
+ BRDA:121,14,0,10
655
+ BRDA:121,14,1,8
656
+ BRDA:122,15,0,18
657
+ BRDA:122,15,1,8
658
+ BRDA:138,16,0,8
659
+ BRDA:138,16,1,15
660
+ BRDA:139,17,0,9
661
+ BRDA:139,17,1,6
662
+ BRDA:167,18,0,0
663
+ BRDA:167,18,1,0
664
+ BRDA:167,19,0,0
665
+ BRDA:167,19,1,0
666
+ BRDA:173,20,0,0
667
+ BRDA:173,20,1,0
668
+ BRF:47
669
+ BRH:37
670
+ end_of_record
671
+ TN:
557
672
  SF:src/plugin.js
558
673
  FNF:0
559
674
  FNH:0
@@ -572,6 +687,207 @@ BRF:0
572
687
  BRH:0
573
688
  end_of_record
574
689
  TN:
690
+ SF:src/require-fragment-key.js
691
+ FN:35,(anonymous_0)
692
+ FN:45,(anonymous_1)
693
+ FN:51,(anonymous_2)
694
+ FN:57,(anonymous_3)
695
+ FN:71,(anonymous_4)
696
+ FN:86,(anonymous_5)
697
+ FN:104,(anonymous_6)
698
+ FN:137,(anonymous_7)
699
+ FN:147,(anonymous_8)
700
+ FN:171,(anonymous_9)
701
+ FN:221,(anonymous_10)
702
+ FN:224,(anonymous_11)
703
+ FNF:12
704
+ FNH:9
705
+ FNDA:69,(anonymous_0)
706
+ FNDA:3,(anonymous_1)
707
+ FNDA:13,(anonymous_2)
708
+ FNDA:12,(anonymous_3)
709
+ FNDA:11,(anonymous_4)
710
+ FNDA:10,(anonymous_5)
711
+ FNDA:19,(anonymous_6)
712
+ FNDA:22,(anonymous_7)
713
+ FNDA:0,(anonymous_8)
714
+ FNDA:65,(anonymous_9)
715
+ FNDA:0,(anonymous_10)
716
+ FNDA:0,(anonymous_11)
717
+ DA:24,1
718
+ DA:26,1
719
+ DA:35,1
720
+ DA:36,69
721
+ DA:37,69
722
+ DA:38,51
723
+ DA:40,51
724
+ DA:41,51
725
+ DA:42,51
726
+ DA:44,4
727
+ DA:45,3
728
+ DA:51,1
729
+ DA:52,13
730
+ DA:53,13
731
+ DA:54,8
732
+ DA:57,1
733
+ DA:58,12
734
+ DA:59,12
735
+ DA:60,8
736
+ DA:61,0
737
+ DA:63,8
738
+ DA:64,4
739
+ DA:66,4
740
+ DA:67,4
741
+ DA:71,1
742
+ DA:72,11
743
+ DA:74,5
744
+ DA:75,5
745
+ DA:76,4
746
+ DA:78,1
747
+ DA:86,1
748
+ DA:87,10
749
+ DA:88,10
750
+ DA:104,1
751
+ DA:105,19
752
+ DA:106,19
753
+ DA:107,19
754
+ DA:109,19
755
+ DA:110,43
756
+ DA:118,12
757
+ DA:119,12
758
+ DA:120,12
759
+ DA:123,8
760
+ DA:124,8
761
+ DA:125,8
762
+ DA:126,8
763
+ DA:129,4
764
+ DA:130,4
765
+ DA:131,4
766
+ DA:132,4
767
+ DA:137,22
768
+ DA:138,9
769
+ DA:147,0
770
+ DA:148,0
771
+ DA:159,10
772
+ DA:162,0
773
+ DA:165,0
774
+ DA:171,1
775
+ DA:172,65
776
+ DA:179,17
777
+ DA:181,17
778
+ DA:183,14
779
+ DA:189,5
780
+ DA:192,9
781
+ DA:222,0
782
+ DA:224,0
783
+ DA:225,0
784
+ DA:226,0
785
+ DA:229,0
786
+ LF:69
787
+ LH:59
788
+ BRDA:36,0,0,0
789
+ BRDA:36,0,1,69
790
+ BRDA:37,1,0,18
791
+ BRDA:37,1,1,51
792
+ BRDA:38,2,0,0
793
+ BRDA:38,2,1,51
794
+ BRDA:41,3,0,0
795
+ BRDA:41,3,1,51
796
+ BRDA:42,4,0,47
797
+ BRDA:42,4,1,4
798
+ BRDA:45,5,0,3
799
+ BRDA:45,5,1,2
800
+ BRDA:45,5,2,1
801
+ BRDA:52,6,0,0
802
+ BRDA:52,6,1,13
803
+ BRDA:53,7,0,5
804
+ BRDA:53,7,1,8
805
+ BRDA:58,8,0,0
806
+ BRDA:58,8,1,12
807
+ BRDA:59,9,0,4
808
+ BRDA:59,9,1,8
809
+ BRDA:59,10,0,12
810
+ BRDA:59,10,1,8
811
+ BRDA:60,11,0,0
812
+ BRDA:60,11,1,8
813
+ BRDA:61,12,0,0
814
+ BRDA:61,12,1,0
815
+ BRDA:63,13,0,4
816
+ BRDA:63,13,1,4
817
+ BRDA:64,14,0,4
818
+ BRDA:64,14,1,4
819
+ BRDA:66,15,0,0
820
+ BRDA:66,15,1,4
821
+ BRDA:72,16,0,6
822
+ BRDA:72,16,1,5
823
+ BRDA:75,17,0,4
824
+ BRDA:75,17,1,1
825
+ BRDA:75,18,0,5
826
+ BRDA:75,18,1,1
827
+ BRDA:79,19,0,1
828
+ BRDA:79,19,1,1
829
+ BRDA:79,19,2,1
830
+ BRDA:79,19,3,1
831
+ BRDA:89,20,0,10
832
+ BRDA:89,20,1,10
833
+ BRDA:89,20,2,3
834
+ BRDA:89,20,3,3
835
+ BRDA:89,20,4,3
836
+ BRDA:89,20,5,3
837
+ BRDA:110,21,0,8
838
+ BRDA:110,21,1,8
839
+ BRDA:110,21,2,8
840
+ BRDA:110,21,3,8
841
+ BRDA:110,21,4,8
842
+ BRDA:110,21,5,10
843
+ BRDA:110,21,6,12
844
+ BRDA:110,21,7,8
845
+ BRDA:110,21,8,4
846
+ BRDA:110,21,9,9
847
+ BRDA:110,21,10,9
848
+ BRDA:110,21,11,0
849
+ BRDA:110,21,12,9
850
+ BRDA:110,21,13,9
851
+ BRDA:110,21,14,10
852
+ BRDA:110,21,15,0
853
+ BRDA:123,22,0,8
854
+ BRDA:123,22,1,0
855
+ BRDA:123,23,0,8
856
+ BRDA:123,23,1,0
857
+ BRDA:129,24,0,4
858
+ BRDA:129,24,1,0
859
+ BRDA:129,25,0,4
860
+ BRDA:129,25,1,2
861
+ BRDA:137,26,0,22
862
+ BRDA:137,26,1,13
863
+ BRDA:147,27,0,0
864
+ BRDA:147,27,1,0
865
+ BRDA:159,28,0,3
866
+ BRDA:159,28,1,7
867
+ BRDA:171,29,0,60
868
+ BRDA:171,30,0,60
869
+ BRDA:172,31,0,48
870
+ BRDA:172,31,1,17
871
+ BRDA:176,32,0,9
872
+ BRDA:177,33,0,9
873
+ BRDA:178,34,0,9
874
+ BRDA:181,35,0,3
875
+ BRDA:181,35,1,14
876
+ BRDA:183,36,0,5
877
+ BRDA:183,36,1,9
878
+ BRDA:184,37,0,14
879
+ BRDA:184,37,1,8
880
+ BRDA:184,37,2,7
881
+ BRDA:184,37,3,6
882
+ BRDA:184,37,4,5
883
+ BRDA:222,38,0,0
884
+ BRDA:222,38,1,0
885
+ BRDA:226,39,0,0
886
+ BRDA:226,39,1,0
887
+ BRF:99
888
+ BRH:79
889
+ end_of_record
890
+ TN:
575
891
  SF:src/route-dto-required.js
576
892
  FN:1,(anonymous_0)
577
893
  FN:12,(anonymous_1)
@@ -192,6 +192,48 @@ declare const _default: {
192
192
  MethodDefinition(node: any): void;
193
193
  };
194
194
  };
195
+ 'require-fragment-key': {
196
+ meta: {
197
+ type: string;
198
+ docs: {
199
+ description: string;
200
+ recommended: boolean;
201
+ };
202
+ schema: {
203
+ type: string;
204
+ properties: {
205
+ strict: {
206
+ type: string;
207
+ };
208
+ };
209
+ additionalProperties: boolean;
210
+ }[];
211
+ messages: {
212
+ listItem: string;
213
+ conditionalSibling: string;
214
+ };
215
+ };
216
+ create(context: any): {
217
+ JSXFragment: (node: any) => void;
218
+ JSXElement: (node: any) => void;
219
+ };
220
+ };
221
+ 'no-static-key-in-map': {
222
+ meta: {
223
+ type: string;
224
+ docs: {
225
+ description: string;
226
+ recommended: boolean;
227
+ };
228
+ schema: never[];
229
+ messages: {
230
+ staticKeyInIterator: string;
231
+ };
232
+ };
233
+ create(context: any): {
234
+ JSXElement: (node: any) => void;
235
+ };
236
+ };
195
237
  };
196
238
  };
197
239
  };
@@ -192,6 +192,48 @@ declare const _default: {
192
192
  MethodDefinition(node: any): void;
193
193
  };
194
194
  };
195
+ 'require-fragment-key': {
196
+ meta: {
197
+ type: string;
198
+ docs: {
199
+ description: string;
200
+ recommended: boolean;
201
+ };
202
+ schema: {
203
+ type: string;
204
+ properties: {
205
+ strict: {
206
+ type: string;
207
+ };
208
+ };
209
+ additionalProperties: boolean;
210
+ }[];
211
+ messages: {
212
+ listItem: string;
213
+ conditionalSibling: string;
214
+ };
215
+ };
216
+ create(context: any): {
217
+ JSXFragment: (node: any) => void;
218
+ JSXElement: (node: any) => void;
219
+ };
220
+ };
221
+ 'no-static-key-in-map': {
222
+ meta: {
223
+ type: string;
224
+ docs: {
225
+ description: string;
226
+ recommended: boolean;
227
+ };
228
+ schema: never[];
229
+ messages: {
230
+ staticKeyInIterator: string;
231
+ };
232
+ };
233
+ create(context: any): {
234
+ JSXElement: (node: any) => void;
235
+ };
236
+ };
195
237
  };
196
238
  };
197
239
  };
@@ -208,6 +250,8 @@ declare const _default: {
208
250
  'tcy/v-model-name-match': string;
209
251
  'tcy/vuejs-define-component': string;
210
252
  'tcy/vuejs-define-workspace': string;
253
+ 'tcy/require-fragment-key': string;
254
+ 'tcy/no-static-key-in-map': string;
211
255
  };
212
256
  };
213
257
  export default _default;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @fileoverview no-static-key-in-map
3
+ *
4
+ * Reports a JSX list item whose `key` is a *static* value (a string / number /
5
+ * boolean literal, or a template literal with no interpolation) when that
6
+ * element is the root returned from an iterator callback:
7
+ *
8
+ * list.map(() => <Row key="row" />) // ✗ same key every item
9
+ * list.map(() => <Fragment key="rows">…</Fragment>) // ✗
10
+ * list.map((r) => r.ok && <Row key="row" />) // ✗ (conditional in .map)
11
+ * list.flatMap(() => [<A key="a" />, <B key="b" />]) // ✗ (array returned from .map)
12
+ *
13
+ * A constant key on every sibling is worse than no key: Vue / React build a
14
+ * key → index map where later duplicates overwrite earlier ones, so on
15
+ * insert / remove / reorder the diff patches the wrong node (misplaced DOM,
16
+ * lost child-component state) and dev builds warn about duplicate keys.
17
+ *
18
+ * It stays silent when:
19
+ *
20
+ * - the key is derived from the item or the index — `key={r.id}`, `key={i}`,
21
+ * `` key={`row-${i}`} ``
22
+ * - the element is NOT the list-item root — a static key on a nested element
23
+ * (`<ul>{rows.map(() => <li key="only" />)}</ul>` inside a keyed root) is
24
+ * scoped to its own parent's children, not the iterated list
25
+ * - there is no `key` at all — that is `react/jsx-key` / `require-fragment-key`
26
+ */
27
+ /** A value with no runtime input — a bare literal or a `${…}`-free template. */
28
+ export declare const isStaticExpression: (node: any) => any;
29
+ /**
30
+ * The `key` attribute of a JSXElement when it is present *and* static.
31
+ * `<>…</>` can never carry a key, so only JSXElement is inspected
32
+ * (`<Fragment key="…">` included).
33
+ *
34
+ * @returns the `key` JSXAttribute node, or `null`
35
+ */
36
+ export declare const getStaticKeyAttr: (node: any) => any;
37
+ /** Is `fnNode` the first argument of a `.map()` / `.flatMap()` call? */
38
+ export declare const isIteratorCallback: (fnNode: any) => boolean;
39
+ /**
40
+ * Walk outward from `node` through transparent wrappers and conditional
41
+ * operators. `node` is a list-item root when the first structural ancestor
42
+ * reached is an iterator callback; it is NOT when a JSX element / fragment is
43
+ * reached first (the element is nested, its key scoped to that parent).
44
+ */
45
+ export declare const isListItemRoot: (node: any) => boolean;
46
+ /**
47
+ * @returns {'staticKeyInIterator' | null}
48
+ */
49
+ export declare const analyzeElement: (node: any) => 'staticKeyInIterator' | null;
50
+ declare const _default: {
51
+ meta: {
52
+ type: string;
53
+ docs: {
54
+ description: string;
55
+ recommended: boolean;
56
+ };
57
+ schema: never[];
58
+ messages: {
59
+ staticKeyInIterator: string;
60
+ };
61
+ };
62
+ create(context: any): {
63
+ JSXElement: (node: any) => void;
64
+ };
65
+ };
66
+ export default _default;
package/decl/plugin.d.ts CHANGED
@@ -189,5 +189,47 @@ declare const _default: {
189
189
  MethodDefinition(node: any): void;
190
190
  };
191
191
  };
192
+ 'require-fragment-key': {
193
+ meta: {
194
+ type: string;
195
+ docs: {
196
+ description: string;
197
+ recommended: boolean;
198
+ };
199
+ schema: {
200
+ type: string;
201
+ properties: {
202
+ strict: {
203
+ type: string;
204
+ };
205
+ };
206
+ additionalProperties: boolean;
207
+ }[];
208
+ messages: {
209
+ listItem: string;
210
+ conditionalSibling: string;
211
+ };
212
+ };
213
+ create(context: any): {
214
+ JSXFragment: (node: any) => void;
215
+ JSXElement: (node: any) => void;
216
+ };
217
+ };
218
+ 'no-static-key-in-map': {
219
+ meta: {
220
+ type: string;
221
+ docs: {
222
+ description: string;
223
+ recommended: boolean;
224
+ };
225
+ schema: never[];
226
+ messages: {
227
+ staticKeyInIterator: string;
228
+ };
229
+ };
230
+ create(context: any): {
231
+ JSXElement: (node: any) => void;
232
+ };
233
+ };
192
234
  };
193
235
  export default _default;
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @fileoverview require-fragment-key
3
+ *
4
+ * Reports a key-less Fragment (`<>…</>` or `<Fragment>` without `key`) *only* in
5
+ * the positions where Vue's children diff can actually misalign without it:
6
+ *
7
+ * A. list item — `list.map(() => <>…</>)`
8
+ * B. conditional sibling — `{cond && <>…</>}` / `cond ? <>…</> : x`, when the
9
+ * conditional is one of several children in a JSX element / fragment / array
10
+ * (the surrounding child list can change shape at runtime).
11
+ *
12
+ * It stays silent where a key is not required:
13
+ *
14
+ * C. sole return / sole child — `() => <>…</>`, `render() { return <>…</> }`,
15
+ * `default: () => <>…</>`, `<Parent><>…</></Parent>`
16
+ * D. static (non-conditional) sibling
17
+ * E. the Fragment already carries a `key`
18
+ *
19
+ * With `{ strict: true }` (the default) case B fires only when at least one
20
+ * sibling is *also* dynamically rendered (another conditional or a `.map`) —
21
+ * a lone conditional in an otherwise static list cannot drift the diff.
22
+ */
23
+ /** A `<>…</>` node, or a `<Fragment>` / `<X.Fragment>` element with no `key`. */
24
+ export declare const isKeylessFragment: (node: any) => boolean;
25
+ /**
26
+ * Walk outward from the fragment through transparent wrappers and conditional
27
+ * operators, and classify the first structural ancestor.
28
+ *
29
+ * @returns {{ kind: string, conditional?: boolean, siblingCount?: number, dynamicSibling?: boolean }}
30
+ */
31
+ export declare const classifyFragment: (fragment: any) => {
32
+ kind: string;
33
+ conditional?: boolean;
34
+ siblingCount?: number;
35
+ dynamicSibling?: boolean;
36
+ };
37
+ /**
38
+ * @returns {'listItem' | 'conditionalSibling' | null}
39
+ */
40
+ export declare const analyzeFragment: (node: any, { strict }?: {
41
+ strict?: boolean | undefined;
42
+ }) => 'listItem' | 'conditionalSibling' | null;
43
+ declare const _default: {
44
+ meta: {
45
+ type: string;
46
+ docs: {
47
+ description: string;
48
+ recommended: boolean;
49
+ };
50
+ schema: {
51
+ type: string;
52
+ properties: {
53
+ strict: {
54
+ type: string;
55
+ };
56
+ };
57
+ additionalProperties: boolean;
58
+ }[];
59
+ messages: {
60
+ listItem: string;
61
+ conditionalSibling: string;
62
+ };
63
+ };
64
+ create(context: any): {
65
+ JSXFragment: (node: any) => void;
66
+ JSXElement: (node: any) => void;
67
+ };
68
+ };
69
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tcy/eslint-rules",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "```typescript import { plugin as customRules } from 'tcy@eslint-rules/src/index.mjs';",
5
5
  "homepage": "https://github.com/tcastelly/eslint-rules#readme",
6
6
  "bugs": {
@@ -13,11 +13,6 @@
13
13
  "license": "ISC",
14
14
  "author": "Thomas CASTELLY",
15
15
  "type": "module",
16
- "main": "src/index.js",
17
- "types": "decl/index.d.ts",
18
- "bin": {
19
- "eslint-cache-guard": "./src/bin/eslint-cache-guard.js"
20
- },
21
16
  "exports": {
22
17
  "./client": {
23
18
  "types": "./decl/client/client.d.ts",
@@ -40,6 +35,11 @@
40
35
  "import": "./src/back/http.js"
41
36
  }
42
37
  },
38
+ "main": "src/index.js",
39
+ "types": "decl/index.d.ts",
40
+ "bin": {
41
+ "eslint-cache-guard": "./src/bin/eslint-cache-guard.js"
42
+ },
43
43
  "scripts": {
44
44
  "build:decl": "tsc",
45
45
  "clean": "rimraf decl",
@@ -50,9 +50,9 @@
50
50
  "@babel/core": "^8.0.1",
51
51
  "@babel/preset-env": "^8.0.2",
52
52
  "@types/jest": "^30.0.0",
53
- "@types/node": "^26.0.1",
54
- "babel-jest": "^30.4.1",
55
- "jest": "^30.4.2",
53
+ "@types/node": "^26.5.0",
54
+ "babel-jest": "^30.5.1",
55
+ "jest": "^30.5.1",
56
56
  "rimraf": "^6.1.3",
57
57
  "typescript": "^7.0.2"
58
58
  }