@tcy/eslint-rules 1.7.0 → 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 (39) hide show
  1. package/coverage/clover.xml +76 -4
  2. package/coverage/coverage-final.json +1 -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 +5 -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 +24 -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/plugin.js.html +8 -2
  24. package/coverage/lcov-report/src/recommended.js.html +1 -1
  25. package/coverage/lcov-report/src/require-fragment-key.js.html +787 -0
  26. package/coverage/lcov-report/src/route-dto-required.js.html +1 -1
  27. package/coverage/lcov-report/src/v-model-name-match.js.html +1 -1
  28. package/coverage/lcov-report/src/vuejs-define-component.js.html +1 -1
  29. package/coverage/lcov-report/src/vuejs-define-workspace.js.html +1 -1
  30. package/coverage/lcov.info +201 -0
  31. package/decl/back/back.d.ts +26 -0
  32. package/decl/client/client.d.ts +27 -0
  33. package/decl/plugin.d.ts +26 -0
  34. package/decl/require-fragment-key.d.ts +69 -0
  35. package/package.json +9 -9
  36. package/src/client/client.js +1 -0
  37. package/src/plugin.js +2 -0
  38. package/src/require-fragment-key.js +234 -0
  39. 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-08T14:12:35.933Z
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-08T14:12:35.933Z
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-08T14:12:35.933Z
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-08T14:12:35.933Z
269
269
  </div>
270
270
  <script src="../prettify.js"></script>
271
271
  <script>
@@ -572,6 +572,207 @@ BRF:0
572
572
  BRH:0
573
573
  end_of_record
574
574
  TN:
575
+ SF:src/require-fragment-key.js
576
+ FN:35,(anonymous_0)
577
+ FN:45,(anonymous_1)
578
+ FN:51,(anonymous_2)
579
+ FN:57,(anonymous_3)
580
+ FN:71,(anonymous_4)
581
+ FN:86,(anonymous_5)
582
+ FN:104,(anonymous_6)
583
+ FN:137,(anonymous_7)
584
+ FN:147,(anonymous_8)
585
+ FN:171,(anonymous_9)
586
+ FN:221,(anonymous_10)
587
+ FN:224,(anonymous_11)
588
+ FNF:12
589
+ FNH:9
590
+ FNDA:69,(anonymous_0)
591
+ FNDA:3,(anonymous_1)
592
+ FNDA:13,(anonymous_2)
593
+ FNDA:12,(anonymous_3)
594
+ FNDA:11,(anonymous_4)
595
+ FNDA:10,(anonymous_5)
596
+ FNDA:19,(anonymous_6)
597
+ FNDA:22,(anonymous_7)
598
+ FNDA:0,(anonymous_8)
599
+ FNDA:65,(anonymous_9)
600
+ FNDA:0,(anonymous_10)
601
+ FNDA:0,(anonymous_11)
602
+ DA:24,1
603
+ DA:26,1
604
+ DA:35,1
605
+ DA:36,69
606
+ DA:37,69
607
+ DA:38,51
608
+ DA:40,51
609
+ DA:41,51
610
+ DA:42,51
611
+ DA:44,4
612
+ DA:45,3
613
+ DA:51,1
614
+ DA:52,13
615
+ DA:53,13
616
+ DA:54,8
617
+ DA:57,1
618
+ DA:58,12
619
+ DA:59,12
620
+ DA:60,8
621
+ DA:61,0
622
+ DA:63,8
623
+ DA:64,4
624
+ DA:66,4
625
+ DA:67,4
626
+ DA:71,1
627
+ DA:72,11
628
+ DA:74,5
629
+ DA:75,5
630
+ DA:76,4
631
+ DA:78,1
632
+ DA:86,1
633
+ DA:87,10
634
+ DA:88,10
635
+ DA:104,1
636
+ DA:105,19
637
+ DA:106,19
638
+ DA:107,19
639
+ DA:109,19
640
+ DA:110,43
641
+ DA:118,12
642
+ DA:119,12
643
+ DA:120,12
644
+ DA:123,8
645
+ DA:124,8
646
+ DA:125,8
647
+ DA:126,8
648
+ DA:129,4
649
+ DA:130,4
650
+ DA:131,4
651
+ DA:132,4
652
+ DA:137,22
653
+ DA:138,9
654
+ DA:147,0
655
+ DA:148,0
656
+ DA:159,10
657
+ DA:162,0
658
+ DA:165,0
659
+ DA:171,1
660
+ DA:172,65
661
+ DA:179,17
662
+ DA:181,17
663
+ DA:183,14
664
+ DA:189,5
665
+ DA:192,9
666
+ DA:222,0
667
+ DA:224,0
668
+ DA:225,0
669
+ DA:226,0
670
+ DA:229,0
671
+ LF:69
672
+ LH:59
673
+ BRDA:36,0,0,0
674
+ BRDA:36,0,1,69
675
+ BRDA:37,1,0,18
676
+ BRDA:37,1,1,51
677
+ BRDA:38,2,0,0
678
+ BRDA:38,2,1,51
679
+ BRDA:41,3,0,0
680
+ BRDA:41,3,1,51
681
+ BRDA:42,4,0,47
682
+ BRDA:42,4,1,4
683
+ BRDA:45,5,0,3
684
+ BRDA:45,5,1,2
685
+ BRDA:45,5,2,1
686
+ BRDA:52,6,0,0
687
+ BRDA:52,6,1,13
688
+ BRDA:53,7,0,5
689
+ BRDA:53,7,1,8
690
+ BRDA:58,8,0,0
691
+ BRDA:58,8,1,12
692
+ BRDA:59,9,0,4
693
+ BRDA:59,9,1,8
694
+ BRDA:59,10,0,12
695
+ BRDA:59,10,1,8
696
+ BRDA:60,11,0,0
697
+ BRDA:60,11,1,8
698
+ BRDA:61,12,0,0
699
+ BRDA:61,12,1,0
700
+ BRDA:63,13,0,4
701
+ BRDA:63,13,1,4
702
+ BRDA:64,14,0,4
703
+ BRDA:64,14,1,4
704
+ BRDA:66,15,0,0
705
+ BRDA:66,15,1,4
706
+ BRDA:72,16,0,6
707
+ BRDA:72,16,1,5
708
+ BRDA:75,17,0,4
709
+ BRDA:75,17,1,1
710
+ BRDA:75,18,0,5
711
+ BRDA:75,18,1,1
712
+ BRDA:79,19,0,1
713
+ BRDA:79,19,1,1
714
+ BRDA:79,19,2,1
715
+ BRDA:79,19,3,1
716
+ BRDA:89,20,0,10
717
+ BRDA:89,20,1,10
718
+ BRDA:89,20,2,3
719
+ BRDA:89,20,3,3
720
+ BRDA:89,20,4,3
721
+ BRDA:89,20,5,3
722
+ BRDA:110,21,0,8
723
+ BRDA:110,21,1,8
724
+ BRDA:110,21,2,8
725
+ BRDA:110,21,3,8
726
+ BRDA:110,21,4,8
727
+ BRDA:110,21,5,10
728
+ BRDA:110,21,6,12
729
+ BRDA:110,21,7,8
730
+ BRDA:110,21,8,4
731
+ BRDA:110,21,9,9
732
+ BRDA:110,21,10,9
733
+ BRDA:110,21,11,0
734
+ BRDA:110,21,12,9
735
+ BRDA:110,21,13,9
736
+ BRDA:110,21,14,10
737
+ BRDA:110,21,15,0
738
+ BRDA:123,22,0,8
739
+ BRDA:123,22,1,0
740
+ BRDA:123,23,0,8
741
+ BRDA:123,23,1,0
742
+ BRDA:129,24,0,4
743
+ BRDA:129,24,1,0
744
+ BRDA:129,25,0,4
745
+ BRDA:129,25,1,2
746
+ BRDA:137,26,0,22
747
+ BRDA:137,26,1,13
748
+ BRDA:147,27,0,0
749
+ BRDA:147,27,1,0
750
+ BRDA:159,28,0,3
751
+ BRDA:159,28,1,7
752
+ BRDA:171,29,0,60
753
+ BRDA:171,30,0,60
754
+ BRDA:172,31,0,48
755
+ BRDA:172,31,1,17
756
+ BRDA:176,32,0,9
757
+ BRDA:177,33,0,9
758
+ BRDA:178,34,0,9
759
+ BRDA:181,35,0,3
760
+ BRDA:181,35,1,14
761
+ BRDA:183,36,0,5
762
+ BRDA:183,36,1,9
763
+ BRDA:184,37,0,14
764
+ BRDA:184,37,1,8
765
+ BRDA:184,37,2,7
766
+ BRDA:184,37,3,6
767
+ BRDA:184,37,4,5
768
+ BRDA:222,38,0,0
769
+ BRDA:222,38,1,0
770
+ BRDA:226,39,0,0
771
+ BRDA:226,39,1,0
772
+ BRF:99
773
+ BRH:79
774
+ end_of_record
775
+ TN:
575
776
  SF:src/route-dto-required.js
576
777
  FN:1,(anonymous_0)
577
778
  FN:12,(anonymous_1)
@@ -192,6 +192,32 @@ 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
+ };
195
221
  };
196
222
  };
197
223
  };
@@ -192,6 +192,32 @@ 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
+ };
195
221
  };
196
222
  };
197
223
  };
@@ -208,6 +234,7 @@ declare const _default: {
208
234
  'tcy/v-model-name-match': string;
209
235
  'tcy/vuejs-define-component': string;
210
236
  'tcy/vuejs-define-workspace': string;
237
+ 'tcy/require-fragment-key': string;
211
238
  };
212
239
  };
213
240
  export default _default;
package/decl/plugin.d.ts CHANGED
@@ -189,5 +189,31 @@ 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
+ };
192
218
  };
193
219
  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.8.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
  }
@@ -18,5 +18,6 @@ export default {
18
18
  'tcy/v-model-name-match': 'error',
19
19
  'tcy/vuejs-define-component': 'error',
20
20
  'tcy/vuejs-define-workspace': 'error',
21
+ 'tcy/require-fragment-key': 'error',
21
22
  }
22
23
  }
package/src/plugin.js CHANGED
@@ -10,6 +10,7 @@ import decoratorTypeEnforcement from './decorator-type-enforcement.js'
10
10
  import vuejsDefineComponent from './vuejs-define-component.js'
11
11
  import vuejsDefineWorkspace from './vuejs-define-workspace.js'
12
12
  import routeDtoRequired from './route-dto-required.js'
13
+ import requireFragmentKey from './require-fragment-key.js'
13
14
 
14
15
  export default {
15
16
  'import-specifiers-per-line': importSpecifiersPerLineRule,
@@ -24,4 +25,5 @@ export default {
24
25
  'vuejs-define-component': vuejsDefineComponent,
25
26
  'vuejs-define-workspace': vuejsDefineWorkspace,
26
27
  'route-dto-required': routeDtoRequired,
28
+ 'require-fragment-key': requireFragmentKey,
27
29
  }