eslint-plugin-etc-misc 1.1.6 → 1.1.8

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 (125) hide show
  1. package/README.md +135 -135
  2. package/dist/_internal/casing.js +2 -2
  3. package/dist/_internal/casing.js.map +1 -1
  4. package/dist/_internal/get-core-rule.d.ts.map +1 -1
  5. package/dist/_internal/get-core-rule.js +1 -2
  6. package/dist/_internal/get-core-rule.js.map +1 -1
  7. package/dist/_internal/import-patterns.js +3 -3
  8. package/dist/_internal/import-patterns.js.map +1 -1
  9. package/dist/_internal/rule-catalog.js +4 -4
  10. package/dist/_internal/rule-catalog.js.map +1 -1
  11. package/dist/_internal/rule-deprecation.d.ts +2 -2
  12. package/dist/_internal/rule-deprecation.d.ts.map +1 -1
  13. package/dist/_internal/rule-deprecation.js +10 -12
  14. package/dist/_internal/rule-deprecation.js.map +1 -1
  15. package/dist/_internal/symbol-usage.d.ts +1 -1
  16. package/dist/_internal/symbol-usage.d.ts.map +1 -1
  17. package/dist/_internal/symbol-usage.js +1 -1
  18. package/dist/_internal/symbol-usage.js.map +1 -1
  19. package/dist/plugin.cjs +78 -101
  20. package/dist/plugin.cjs.map +3 -3
  21. package/dist/rules/match-filename.js +2 -2
  22. package/dist/rules/match-filename.js.map +1 -1
  23. package/dist/rules/no-assign-mutated-array.js +3 -3
  24. package/dist/rules/no-assign-mutated-array.js.map +1 -1
  25. package/dist/rules/no-const-enum.js +17 -17
  26. package/dist/rules/no-const-enum.js.map +1 -1
  27. package/dist/rules/no-deprecated.js +3 -3
  28. package/dist/rules/no-deprecated.js.map +1 -1
  29. package/dist/rules/no-foreach.js +2 -2
  30. package/dist/rules/no-foreach.js.map +1 -1
  31. package/dist/rules/no-implicit-any-catch.d.ts.map +1 -1
  32. package/dist/rules/no-implicit-any-catch.js.map +1 -1
  33. package/dist/rules/no-internal.js +3 -3
  34. package/dist/rules/no-internal.js.map +1 -1
  35. package/dist/rules/no-misused-generics.d.ts.map +1 -1
  36. package/dist/rules/no-misused-generics.js +11 -11
  37. package/dist/rules/no-misused-generics.js.map +1 -1
  38. package/dist/rules/no-single-line-comment.d.ts.map +1 -1
  39. package/dist/rules/no-single-line-comment.js +11 -15
  40. package/dist/rules/no-single-line-comment.js.map +1 -1
  41. package/dist/rules/no-use-extend-native.d.ts.map +1 -1
  42. package/dist/rules/no-use-extend-native.js +4 -3
  43. package/dist/rules/no-use-extend-native.js.map +1 -1
  44. package/dist/rules/object-format.js +2 -2
  45. package/dist/rules/object-format.js.map +1 -1
  46. package/dist/rules/sort-array.js +2 -2
  47. package/dist/rules/sort-array.js.map +1 -1
  48. package/dist/rules/sort-class-members.d.ts.map +1 -1
  49. package/dist/rules/sort-class-members.js.map +1 -1
  50. package/dist/rules/sort-export-specifiers.js +2 -2
  51. package/dist/rules/sort-export-specifiers.js.map +1 -1
  52. package/dist/rules/switch-case-spacing.d.ts.map +1 -1
  53. package/dist/rules/switch-case-spacing.js +5 -4
  54. package/dist/rules/switch-case-spacing.js.map +1 -1
  55. package/dist/rules/throw-error.d.ts.map +1 -1
  56. package/dist/rules/throw-error.js +12 -14
  57. package/dist/rules/throw-error.js.map +1 -1
  58. package/dist/rules/typescript-array-callback-return-type.d.ts.map +1 -1
  59. package/dist/rules/typescript-array-callback-return-type.js.map +1 -1
  60. package/dist/rules/typescript-class-methods-use-this.d.ts.map +1 -1
  61. package/dist/rules/typescript-class-methods-use-this.js +3 -3
  62. package/dist/rules/typescript-class-methods-use-this.js.map +1 -1
  63. package/dist/rules/typescript-no-redundant-undefined-const.d.ts.map +1 -1
  64. package/dist/rules/typescript-no-redundant-undefined-const.js +1 -4
  65. package/dist/rules/typescript-no-redundant-undefined-const.js.map +1 -1
  66. package/dist/rules/typescript-no-redundant-undefined-default-parameter.d.ts.map +1 -1
  67. package/dist/rules/typescript-no-redundant-undefined-default-parameter.js +1 -4
  68. package/dist/rules/typescript-no-redundant-undefined-default-parameter.js.map +1 -1
  69. package/dist/rules/typescript-no-redundant-undefined-let.d.ts.map +1 -1
  70. package/dist/rules/typescript-no-redundant-undefined-let.js +2 -5
  71. package/dist/rules/typescript-no-redundant-undefined-let.js.map +1 -1
  72. package/dist/rules/typescript-no-redundant-undefined-promise-return-type.d.ts.map +1 -1
  73. package/dist/rules/typescript-no-redundant-undefined-promise-return-type.js +1 -4
  74. package/dist/rules/typescript-no-redundant-undefined-promise-return-type.js.map +1 -1
  75. package/dist/rules/typescript-no-redundant-undefined-readonly-property.d.ts.map +1 -1
  76. package/dist/rules/typescript-no-redundant-undefined-readonly-property.js +1 -4
  77. package/dist/rules/typescript-no-redundant-undefined-readonly-property.js.map +1 -1
  78. package/dist/rules/typescript-no-redundant-undefined-return-type.d.ts.map +1 -1
  79. package/dist/rules/typescript-no-redundant-undefined-return-type.js +1 -4
  80. package/dist/rules/typescript-no-redundant-undefined-return-type.js.map +1 -1
  81. package/dist/rules/typescript-no-redundant-undefined-var.d.ts.map +1 -1
  82. package/dist/rules/typescript-no-redundant-undefined-var.js +2 -5
  83. package/dist/rules/typescript-no-redundant-undefined-var.js.map +1 -1
  84. package/dist/rules/typescript-prefer-enum.d.ts.map +1 -1
  85. package/dist/rules/typescript-prefer-enum.js.map +1 -1
  86. package/dist/rules/typescript-prefer-named-tuple-members.d.ts.map +1 -1
  87. package/dist/rules/typescript-prefer-named-tuple-members.js +2 -5
  88. package/dist/rules/typescript-prefer-named-tuple-members.js.map +1 -1
  89. package/dist/rules/typescript-prefer-readonly-property.d.ts.map +1 -1
  90. package/dist/rules/typescript-prefer-readonly-property.js +9 -11
  91. package/dist/rules/typescript-prefer-readonly-property.js.map +1 -1
  92. package/dist/rules/typescript-require-prop-type-annotation.d.ts.map +1 -1
  93. package/dist/rules/typescript-require-prop-type-annotation.js +9 -11
  94. package/dist/rules/typescript-require-prop-type-annotation.js.map +1 -1
  95. package/dist/rules/typescript-require-this-void.d.ts.map +1 -1
  96. package/dist/rules/typescript-require-this-void.js +9 -11
  97. package/dist/rules/typescript-require-this-void.js.map +1 -1
  98. package/docs/AGENTS.md +20 -18
  99. package/docs/docusaurus/blog/authors.yml +11 -11
  100. package/docs/docusaurus/docusaurus.config.ts +23 -25
  101. package/docs/docusaurus/package.json +2 -1
  102. package/docs/docusaurus/sidebars.rules.ts +40 -42
  103. package/docs/docusaurus/sidebars.ts +20 -20
  104. package/docs/docusaurus/src/components/GitHubStats.jsx +4 -4
  105. package/docs/docusaurus/src/components/GitHubStats.module.css +18 -3
  106. package/docs/docusaurus/src/js/modernEnhancements.ts +55 -55
  107. package/docs/docusaurus/src/pages/index.jsx +12 -12
  108. package/docs/docusaurus/typedoc-plugins/hashToBangLinksCore.d.mts +4 -2
  109. package/docs/docusaurus/typedoc.config.json +7 -586
  110. package/docs/rules/consistent-enum-members.md +3 -3
  111. package/docs/rules/consistent-filename.md +1 -1
  112. package/docs/rules/getting-started.md +19 -21
  113. package/docs/rules/no-assign-mutated-array.md +5 -25
  114. package/docs/rules/no-expression-empty-lines.md +2 -4
  115. package/docs/rules/no-foreach.md +1 -5
  116. package/docs/rules/no-function-declare-after-return.md +72 -66
  117. package/docs/rules/no-use-extend-native.md +29 -31
  118. package/docs/rules/no-vulnerable.md +32 -34
  119. package/docs/rules/prefer-includes.md +2 -11
  120. package/docs/rules/presets/all.md +1 -1
  121. package/docs/rules/presets/recommended.md +1 -1
  122. package/docs/rules/require-jsdoc.md +1 -7
  123. package/docs/rules/sort-array.md +2 -10
  124. package/docs/rules/typescript-array-callback-return-type.md +5 -17
  125. package/package.json +17 -9
@@ -21,17 +21,15 @@ const rule = ruleCreator({
21
21
  context.report({
22
22
  messageId: "forbidden",
23
23
  node,
24
- ...(isDefined(fix)
25
- ? {
26
- fix,
27
- suggest: [
28
- {
29
- fix,
30
- messageId: "suggestAddReadonly",
31
- },
32
- ],
33
- }
34
- : {}),
24
+ ...(isDefined(fix) && {
25
+ fix,
26
+ suggest: [
27
+ {
28
+ fix,
29
+ messageId: "suggestAddReadonly",
30
+ },
31
+ ],
32
+ }),
35
33
  });
36
34
  },
37
35
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-prefer-readonly-property.js","sourceRoot":"","sources":["../../src/rules/typescript-prefer-readonly-property.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,QAAQ,GACV,mEAAmE,CAAC;AAExE;;GAEG;AACH,MAAM,IAAI,GAAwD,WAAW,CAG3E;IACE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClB,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAuB,EAAQ,EAAE;YAC1C,IACI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,kBAAkB;gBAC/C,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,mBAAmB,EAClD,CAAC;gBACC,OAAO;YACX,CAAC;YAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;YAEzB,MAAM,GAAG,GACL,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU;gBAC1C,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,iBAAiB;gBACjD,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO;gBACnC,CAAC,CAAC,CAAC,KAAmC,EAAoB,EAAE,CACtD,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC;gBAClD,CAAC,CAAC,SAAS,CAAC;YAEpB,OAAO,CAAC,MAAM,CAAC;gBACX,SAAS,EAAE,WAAW;gBACtB,IAAI;gBACJ,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC;oBACd,CAAC,CAAC;wBACI,GAAG;wBACH,OAAO,EAAE;4BACL;gCACI,GAAG;gCACH,SAAS,EAAE,oBAAoB;6BAClC;yBACJ;qBACJ;oBACH,CAAC,CAAC,EAAE,CAAC;aACZ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;IACF,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,sDAAsD;YACnE,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,oGAAoG;SAC5G;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN,SAAS,EAAE,wCAAwC;YACnD,kBAAkB,EACd,yDAAyD;SAChE;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,qCAAqC;CAC9C,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"typescript-prefer-readonly-property.js","sourceRoot":"","sources":["../../src/rules/typescript-prefer-readonly-property.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,QAAQ,GACV,mEAAmE,CAAC;AAExE;;GAEG;AACH,MAAM,IAAI,GAAwD,WAAW,CAG3E;IACE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClB,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAuB,EAAQ,EAAE;YAC1C,IACI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,kBAAkB;gBAC/C,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,mBAAmB,EAClD,CAAC;gBACC,OAAO;YACX,CAAC;YAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;YAEzB,MAAM,GAAG,GACL,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU;gBAC1C,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,iBAAiB;gBACjD,OAAO,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO;gBACnC,CAAC,CAAC,CAAC,KAAmC,EAAoB,EAAE,CACtD,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC;gBAClD,CAAC,CAAC,SAAS,CAAC;YAEpB,OAAO,CAAC,MAAM,CAAC;gBACX,SAAS,EAAE,WAAW;gBACtB,IAAI;gBACJ,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI;oBAClB,GAAG;oBACH,OAAO,EAAE;wBACL;4BACI,GAAG;4BACH,SAAS,EAAE,oBAAoB;yBAClC;qBACJ;iBACJ,CAAC;aACL,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;IACF,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,sDAAsD;YACnE,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,oGAAoG;SAC5G;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN,SAAS,EAAE,wCAAwC;YACnD,kBAAkB,EACd,yDAAyD;SAChE;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACrB;IACD,IAAI,EAAE,qCAAqC;CAC9C,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-require-prop-type-annotation.d.ts","sourceRoot":"","sources":["../../src/rules/typescript-require-prop-type-annotation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,wBAAwB,CAAC;AAEzD,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAI3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CA2D5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"typescript-require-prop-type-annotation.d.ts","sourceRoot":"","sources":["../../src/rules/typescript-require-prop-type-annotation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,wBAAwB,CAAC;AAEzD,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAI3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAyD5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
@@ -21,17 +21,15 @@ const rule = ruleCreator({
21
21
  context.report({
22
22
  messageId: "forbidden",
23
23
  node,
24
- ...(isDefined(fix)
25
- ? {
26
- fix,
27
- suggest: [
28
- {
29
- fix,
30
- messageId: "suggestAnnotateUnknown",
31
- },
32
- ],
33
- }
34
- : {}),
24
+ ...(isDefined(fix) && {
25
+ fix,
26
+ suggest: [
27
+ {
28
+ fix,
29
+ messageId: "suggestAnnotateUnknown",
30
+ },
31
+ ],
32
+ }),
35
33
  });
36
34
  },
37
35
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-require-prop-type-annotation.js","sourceRoot":"","sources":["../../src/rules/typescript-require-prop-type-annotation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,QAAQ,GAAG,0DAA0D,CAAC;AAE5E;;GAEG;AACH,MAAM,IAAI,GAAwD,WAAW,CAG3E;IACE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClB,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAuB,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AA8E;YAClF,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,wGAAwG;SAChH;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN,SAAS,EAAE,gDAAgD;YAC3D,sBAAsB,EAClB,8CAA8C;SACrD;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,yCAAyC;CAClD,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-require-this-void.d.ts","sourceRoot":"","sources":["../../src/rules/typescript-require-this-void.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,oBAAoB,CAAC;AAErD,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAqC3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAwD5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"typescript-require-this-void.d.ts","sourceRoot":"","sources":["../../src/rules/typescript-require-this-void.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,KAAK,UAAU,GAAG,WAAW,GAAG,oBAAoB,CAAC;AAErD,KAAK,OAAO,GAAG,SAAS,EAAE,CAAC;AAqC3B;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAsD5D,CAAC;AAEH,eAAe,IAAI,CAAC"}
@@ -33,17 +33,15 @@ const rule = ruleCreator({
33
33
  context.report({
34
34
  messageId: "forbidden",
35
35
  node,
36
- ...(suggestionFix === undefined
37
- ? {}
38
- : {
39
- fix: suggestionFix,
40
- suggest: [
41
- {
42
- fix: suggestionFix,
43
- messageId: "suggestAddThisVoid",
44
- },
45
- ],
46
- }),
36
+ ...(suggestionFix !== undefined && {
37
+ fix: suggestionFix,
38
+ suggest: [
39
+ {
40
+ fix: suggestionFix,
41
+ messageId: "suggestAddThisVoid",
42
+ },
43
+ ],
44
+ }),
47
45
  });
48
46
  },
49
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-require-this-void.js","sourceRoot":"","sources":["../../src/rules/typescript-require-this-void.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,QAAQ,GACV,6IAA6I,CAAC;AAElJ,MAAM,2BAA2B,GAAG,CAChC,UAAyC,EACzC,kBAAmD,EACb,EAAE;IACxC,MAAM,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAE7D,IACI,cAAc,EAAE,IAAI,KAAK,cAAc,CAAC,UAAU;QAClD,cAAc,CAAC,IAAI,KAAK,MAAM,EAChC,CAAC;QACC,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC;QAE7D,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,uBAAuB,GACzB,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACjD,IAAI,uBAAuB,EAAE,KAAK,KAAK,GAAG,EAAE,CAAC;QACzC,OAAO,SAAS,CAAC;IACrB,CAAC;IAED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S;KAClB;IACD,IAAI,EAAE,8BAA8B;CACvC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"typescript-require-this-void.js","sourceRoot":"","sources":["../../src/rules/typescript-require-this-void.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAM3D,MAAM,QAAQ,GACV,6IAA6I,CAAC;AAElJ,MAAM,2BAA2B,GAAG,CAChC,UAAyC,EACzC,kBAAmD,EACb,EAAE;IACxC,MAAM,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAE7D,IACI,cAAc,EAAE,IAAI,KAAK,cAAc,CAAC,UAAU;QAClD,cAAc,CAAC,IAAI,KAAK,MAAM,EAChC,CAAC;QACC,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC;QAE7D,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,uBAAuB,GACzB,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACjD,IAAI,uBAAuB,EAAE,KAAK,KAAK,GAAG,EAAE,CAAC;QACzC,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,KAAK,EAAE,EAAE,CACb,KAAK,CAAC,eAAe,CACjB,uBAAuB,EACvB,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,CAC/D,CAAC;AACV,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,IAAI,GAAwD,WAAW,CAG3E;IACE,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QAEtC,OAAO;YACH,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAuB,EAAQ,EAAE;gBAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,kBAAkB,EAAE,CAAC;oBAClD,OAAO;gBACX,CAAC;gBAED,MAAM,aAAa,GAAG,2BAA2B,CAC7C,UAAU,EACV,IAAI,CACP,CAAC;gBAEF,OAAO,CAAC,MAAM,CAAC;oBACX,SAAS,EAAE,WAAW;oBACtB,IAAI;oBACJ,GAAG,CAAC,aAAa,KAAK,SAAS,IAAI;wBAC/B,GAAG,EAAE,aAAa;wBAClB,OAAO,EAAE;4BACL;gCACI,GAAG,EAAE,aAAa;gCAClB,SAAS,EAAE,oBAAoB;6BAClC;yBACJ;qBACJ,CAAC;iBACL,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IACN,CAAC;IACD,IAAI,EAAE;QACF,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE;YACF,UAAU,EAAE,KAAK;YACjB,WAAW,EACP,uDAAuD;YAC3D,MAAM,EAAE,KAAK;YACb,WAAW,EAAE,KAAK;YAClB,GAAG,EAAE,6FAA6F;SACrG;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACN,SAAS,EAAE,+CAA+C;YAC1D,kBAAkB,EAAE,6CAA6C;SACpE;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;KAClB;IACD,IAAI,EAAE,8BAA8B;CACvC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC"}
package/docs/AGENTS.md CHANGED
@@ -9,7 +9,7 @@ applyTo: "docs/**"
9
9
 
10
10
  ## Your Goal for ESLint Rule Documentation
11
11
 
12
- - Your goal is to make every ESLint rule documentation file (`docs/rules/<rule-id>.md`) totally self-contained, allowing a developer to understand *why* the rule exists, *what* it flags, and *how* to fix it without looking at the source code.
12
+ - Your goal is to make every ESLint rule documentation file (`docs/rules/<rule-id>.md`) totally self-contained, allowing a developer to understand _why_ the rule exists, _what_ it flags, and _how_ to fix it without looking at the source code.
13
13
  - For adjacent docs in `docs/rules/` such as guides, preset pages, `overview.md`, or `getting-started.md`, keep the same tone and accuracy standards, but do not force rule-only sections where they do not fit.
14
14
  - You adhere strictly to the `typescript-eslint` and standard ESLint documentation style guides.
15
15
 
@@ -21,20 +21,20 @@ applyTo: "docs/**"
21
21
 
22
22
  Rule documentation files in `docs/rules/<rule-id>.md` should follow this structure closely:
23
23
 
24
- 1. **Title:** The bare rule ID as the H1 header (e.g., `# prefer-type-fest-arrayable`).
25
- 2. **Description:** A short, one-sentence description of what the rule does.
26
- 3. **Meta Badges (Optional):** Badges for `Recommended`, `Fixable`, or `Type Checked` only if the repository’s current docs pattern uses them.
27
- 4. **Rule Details:** An explanation of the problem the rule solves. Why is this pattern bad?
28
- 5. **Examples:**
29
- - Use `❌ Incorrect` and `✅ Correct` headers.
30
- - **Crucial:** Always include code blocks with specific comments explaining *why* a line is incorrect.
31
- - If the rule is configurable, show examples for different configurations.
32
- 6. **Options (if applicable):**
33
- - A TypeScript interface definition of the options object.
34
- - Default values clearly marked.
35
- - Examples for each option.
36
- 7. **When Not To Use It:** specific scenarios where disabling this rule is acceptable.
37
- 8. **Further Reading:** Links to MDN, TypeScript docs, or relevant specs.
24
+ 1. **Title:** The bare rule ID as the H1 header (e.g., `# prefer-type-fest-arrayable`).
25
+ 2. **Description:** A short, one-sentence description of what the rule does.
26
+ 3. **Meta Badges (Optional):** Badges for `Recommended`, `Fixable`, or `Type Checked` only if the repository’s current docs pattern uses them.
27
+ 4. **Rule Details:** An explanation of the problem the rule solves. Why is this pattern bad?
28
+ 5. **Examples:**
29
+ - Use `❌ Incorrect` and `✅ Correct` headers.
30
+ - **Crucial:** Always include code blocks with specific comments explaining _why_ a line is incorrect.
31
+ - If the rule is configurable, show examples for different configurations.
32
+ 6. **Options (if applicable):**
33
+ - A TypeScript interface definition of the options object.
34
+ - Default values clearly marked.
35
+ - Examples for each option.
36
+ 7. **When Not To Use It:** specific scenarios where disabling this rule is acceptable.
37
+ 8. **Further Reading:** Links to MDN, TypeScript docs, or relevant specs.
38
38
 
39
39
  </structure>
40
40
 
@@ -58,8 +58,8 @@ Rule documentation files in `docs/rules/<rule-id>.md` should follow this structu
58
58
  ## Writing Guidelines
59
59
 
60
60
  - **The "Why":** Never just say "Don't do X." Explain the consequence.
61
- - *Bad:* "Don't use `any`."
62
- - *Good:* "Using `any` bypasses the TypeScript type checker, which can lead to runtime errors that strict typing would otherwise catch."
61
+ - _Bad:_ "Don't use `any`."
62
+ - _Good:_ "Using `any` bypasses the TypeScript type checker, which can lead to runtime errors that strict typing would otherwise catch."
63
63
  - **The "Fix":** If the rule is `fixable`, explicitly state what the auto-fixer does (e.g., "The auto-fixer will replace `var` with `let`.").
64
64
  - **Type Information:** If the rule requires type information (`parserServices`), add a specific note at the top of the docs:
65
65
  > ⚠️ This rule requires type information to run. It will not work without `projectService` (or equivalent typed parser setup) configured.
@@ -72,7 +72,7 @@ Rule documentation files in `docs/rules/<rule-id>.md` should follow this structu
72
72
 
73
73
  ## Example Doc
74
74
 
75
- ```markdown
75
+ ````markdown
76
76
  # prefer-ts-extras-array-find-last-index
77
77
 
78
78
  Prefer [`arrayFindLastIndex`](https://github.com/sindresorhus/ts-extras/blob/main/source/array-find-last-index.ts) from `ts-extras` over `array.findLastIndex(...)`.
@@ -106,6 +106,7 @@ This rule reports `array.findLastIndex(predicate)` call sites when `arrayFindLas
106
106
  ```ts
107
107
  const index = monitors.findLastIndex((entry) => entry.id === targetId);
108
108
  ```
109
+ ````
109
110
 
110
111
  ## ✅ Correct
111
112
 
@@ -183,4 +184,5 @@ Reference links:
183
184
  - [Rollout and fix safety](https://nick2bad4u.github.io/eslint-plugin-etc-misc/docs/rules/guides/rollout-and-fix-safety)
184
185
 
185
186
  </examples>
187
+
186
188
  </instructions>
@@ -1,18 +1,18 @@
1
1
  alice:
2
- image_url: https://example.com/alice.png
3
- name: Alice Example
2
+ image_url: "https://example.com/alice.png"
3
+ name: "Alice Example"
4
4
  page: true
5
5
  socials:
6
- github: alice
7
- title: Contributor
8
- url: https://example.com/alice
6
+ github: "alice"
7
+ title: "Contributor"
8
+ url: "https://example.com/alice"
9
9
 
10
10
  nick:
11
- image_url: https://github.com/Nick2bad4u.png
12
- name: Nick2bad4u
11
+ image_url: "https://github.com/Nick2bad4u.png"
12
+ name: "Nick2bad4u"
13
13
  page:
14
- permalink: /blog/author/nick
14
+ permalink: "/blog/author/nick"
15
15
  socials:
16
- github: Nick2bad4u
17
- title: Project Maintainer
18
- url: https://github.com/Nick2bad4u
16
+ github: "Nick2bad4u"
17
+ title: "Project Maintainer"
18
+ url: "https://github.com/Nick2bad4u"
@@ -1,9 +1,9 @@
1
- import { themes as prismThemes } from "prism-react-renderer";
2
-
3
- import type { Config } from "@docusaurus/types";
4
1
  import type { Options as DocsPluginOptions } from "@docusaurus/plugin-content-docs";
5
2
  import type * as Preset from "@docusaurus/preset-classic";
3
+ import type { Config } from "@docusaurus/types";
4
+
6
5
  import { fileURLToPath } from "node:url";
6
+ import { themes as prismThemes } from "prism-react-renderer";
7
7
 
8
8
  /** Canonical site origin used for sitemap/canonical URL generation. */
9
9
  const siteUrl =
@@ -44,16 +44,14 @@ const removeHeadAttrFlagKey = [
44
44
 
45
45
  /** Docusaurus future flags, including optional experimental fast path. */
46
46
  const futureConfig = {
47
- ...(enableExperimentalFaster
48
- ? {
49
- experimental_faster: {
50
- mdxCrossCompilerCache: true,
51
- rspackBundler: true,
52
- rspackPersistentCache: true,
53
- ssgWorkerThreads: true,
54
- },
55
- }
56
- : {}),
47
+ ...(enableExperimentalFaster && {
48
+ experimental_faster: {
49
+ mdxCrossCompilerCache: true,
50
+ rspackBundler: true,
51
+ rspackPersistentCache: true,
52
+ ssgWorkerThreads: true,
53
+ },
54
+ }),
57
55
  v4: {
58
56
  [removeHeadAttrFlagKey]: true,
59
57
  // NOTE: Enabling cascade layers currently breaks our production CSS output
@@ -68,11 +66,11 @@ const futureConfig = {
68
66
  const config = {
69
67
  baseUrl,
70
68
  baseUrlIssueBanner: true,
69
+ clientModules: [modernEnhancementsClientModule],
71
70
  deploymentBranch: "gh-pages",
72
71
  favicon: "img/favicon.ico",
73
72
  // Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
74
73
  future: futureConfig,
75
- clientModules: [modernEnhancementsClientModule],
76
74
  i18n: {
77
75
  defaultLocale: "en",
78
76
  locales: ["en"],
@@ -189,9 +187,9 @@ const config = {
189
187
  docs: {
190
188
  breadcrumbs: true,
191
189
  editUrl: `https://github.com/${organizationName}/${projectName}/blob/main/docs/docusaurus/`,
192
- path: "site-docs",
193
190
  includeCurrentVersion: true,
194
191
  onInlineTags: "ignore",
192
+ path: "site-docs",
195
193
  routeBasePath: "docs",
196
194
  showLastUpdateAuthor: true,
197
195
  showLastUpdateTime: true,
@@ -233,7 +231,7 @@ const config = {
233
231
  svgr: {
234
232
  svgrConfig: {
235
233
  dimensions: false, // Remove width/height so CSS controls size
236
- expandProps: "start", // Spread props at the start: <svg {...props}>
234
+ expandProps: "start", // Spread props at the start: <SVG {...props}>
237
235
  icon: true, // Treat SVGs as icons (scales via viewBox)
238
236
  memo: true, // Wrap component with React.memo
239
237
  native: false, // Produce web React components (not React Native)
@@ -269,12 +267,6 @@ const config = {
269
267
  disableSwitch: false,
270
268
  respectPrefersColorScheme: true,
271
269
  },
272
- metadata: [
273
- {
274
- content: "eslint-plugin-etc-misc",
275
- name: "keywords",
276
- },
277
- ],
278
270
  footer: {
279
271
  copyright: footerCopyright,
280
272
  links: [
@@ -310,12 +302,12 @@ const config = {
310
302
  label: "🔍 ESLint Inspector",
311
303
  },
312
304
  {
313
- to: "/docs/rules/overview",
314
305
  label: "📏 Rule Docs",
306
+ to: "/docs/rules/overview",
315
307
  },
316
308
  {
317
- to: "/docs/rules/presets/all",
318
309
  label: "🟣 All Preset",
310
+ to: "/docs/rules/presets/all",
319
311
  },
320
312
  ],
321
313
  title: "🚀 Project",
@@ -344,14 +336,20 @@ const config = {
344
336
  ],
345
337
  logo: {
346
338
  alt: "eslint-plugin-etc-misc logo",
339
+ height: "auto",
347
340
  href: `https://github.com/${organizationName}/${projectName}`,
348
341
  src: "img/logo_128x128.png",
349
342
  width: "auto",
350
- height: "auto",
351
343
  },
352
344
  style: "dark",
353
345
  },
354
346
  image: "img/logo.png",
347
+ metadata: [
348
+ {
349
+ content: "eslint-plugin-etc-misc",
350
+ name: "keywords",
351
+ },
352
+ ],
355
353
  navbar: {
356
354
  items: [
357
355
  {
@@ -74,6 +74,7 @@
74
74
  "react-github-btn": "^1.4.0",
75
75
  "typed-css-modules": "^0.9.1",
76
76
  "typedoc": "^0.28.19",
77
+ "typedoc-config-nick2bad4u": "^2.0.0",
77
78
  "typedoc-docusaurus-theme": "^1.4.2",
78
79
  "typedoc-plugin-coverage": "^4.0.3",
79
80
  "typedoc-plugin-dt-links": "^2.0.54",
@@ -90,7 +91,7 @@
90
91
  "react": "^19.2.4",
91
92
  "react-dom": "^19.2.4"
92
93
  },
93
- "packageManager": "npm@11.14.1",
94
+ "packageManager": "npm@11.18.0",
94
95
  "engines": {
95
96
  "node": ">=20.19.0"
96
97
  },
@@ -1,26 +1,26 @@
1
+ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
2
+
1
3
  /**
2
4
  * @packageDocumentation
3
5
  * Dynamic sidebar generation for plugin rule documentation sections.
4
6
  */
5
- import { readFileSync, readdirSync } from "node:fs";
7
+ import { readdirSync, readFileSync } from "node:fs";
6
8
  import { dirname, join } from "node:path";
7
9
  import { fileURLToPath } from "node:url";
8
10
 
9
- import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
10
-
11
- /** Minimal document item shape used by generated rule categories. */
12
- type SidebarDocItem = {
13
- readonly id: string;
14
- readonly label?: string;
15
- readonly type: "doc";
16
- };
17
-
18
11
  type RuleCatalogMapEntry = Readonly<{
19
12
  catalogId: string;
20
13
  docId: string;
21
14
  ruleName: string;
22
15
  }>;
23
16
 
17
+ /** Minimal document item shape used by generated rule categories. */
18
+ interface SidebarDocItem {
19
+ readonly id: string;
20
+ readonly label?: string;
21
+ readonly type: "doc";
22
+ }
23
+
24
24
  /** Directory containing this sidebar module. */
25
25
  const sidebarDirectoryPath = dirname(fileURLToPath(import.meta.url));
26
26
  /** Directory containing generated rule docs consumed by the sidebar. */
@@ -39,7 +39,7 @@ const sourceRulesDirectoryPath = join(
39
39
  );
40
40
 
41
41
  /** Docs that are part of the rules docs plugin but are not individual rule docs. */
42
- const nonRuleDocIds = new Set(["overview", "getting-started"]);
42
+ const nonRuleDocIds = new Set(["getting-started", "overview"]);
43
43
 
44
44
  const ruleCatalogMap = JSON.parse(
45
45
  readFileSync(ruleCatalogMapFilePath, "utf8")
@@ -62,7 +62,7 @@ const toRuleId = (fileName: string): string => fileName.slice(0, -3);
62
62
 
63
63
  /** Convert a markdown path (e.g. `foo/bar.md`) to a Docusaurus doc id. */
64
64
  const toDocIdFromRelativePath = (relativePath: string): string =>
65
- relativePath.replace(/\\/gu, "/").replace(/\.md$/u, "");
65
+ relativePath.replaceAll("\\", "/").replace(/\.md$/u, "");
66
66
 
67
67
  /** Collect markdown doc ids recursively from a docs directory. */
68
68
  const collectMarkdownDocIdsRecursively = (
@@ -112,11 +112,9 @@ const allRulesMarkdownDocIds = readdirSync(rulesDocsDirectoryPath, {
112
112
  .sort((left, right) => left.localeCompare(right));
113
113
 
114
114
  /** Sorted markdown doc ids discovered from `docs/rules/**`. */
115
- const allRulesPluginDocIds = collectMarkdownDocIdsRecursively(
116
- rulesDocsDirectoryPath
117
- )
118
- .slice()
119
- .sort((left, right) => left.localeCompare(right));
115
+ const allRulesPluginDocIds = [
116
+ ...collectMarkdownDocIdsRecursively(rulesDocsDirectoryPath),
117
+ ].sort((left, right) => left.localeCompare(right));
120
118
  const allRulesPluginDocIdSet = new Set(allRulesPluginDocIds);
121
119
 
122
120
  const hasRulesPluginDocId = (docId: string): boolean =>
@@ -224,15 +222,15 @@ if (guideItems.length > 0) {
224
222
  customProps: {
225
223
  badge: "guides",
226
224
  },
227
- type: "category",
225
+ items: guideItems,
228
226
  label: "🧭 Adoption & Rollout",
229
227
  link: {
230
- type: "generated-index",
231
- title: "Adoption & Rollout",
232
228
  description:
233
229
  "Shared migration, rollout, and fix-safety guidance for rule adoption.",
230
+ title: "Adoption & Rollout",
231
+ type: "generated-index",
234
232
  },
235
- items: guideItems,
233
+ type: "category",
236
234
  });
237
235
  }
238
236
 
@@ -293,15 +291,15 @@ if (presetItems.length > 0) {
293
291
  customProps: {
294
292
  badge: "presets",
295
293
  },
296
- type: "category",
294
+ items: presetItems,
297
295
  label: "🎛 Presets",
298
296
  link: {
299
- type: "generated-index",
300
- title: "Presets",
301
297
  description:
302
298
  "Predefined flat-config preset bundles for different adoption levels.",
299
+ title: "Presets",
300
+ type: "generated-index",
303
301
  },
304
- items: presetItems,
302
+ type: "category",
305
303
  });
306
304
  }
307
305
 
@@ -337,15 +335,6 @@ const sidebars = {
337
335
  customProps: {
338
336
  badge: "rules",
339
337
  },
340
- type: "category",
341
- label: "📏 Rules",
342
- link: {
343
- type: "generated-index",
344
- title: "Rule Reference",
345
- slug: "/",
346
- description:
347
- "Rule documentation for every eslint-plugin-etc-misc rule.",
348
- },
349
338
  items: [
350
339
  {
351
340
  className: "sb-cat-rules-core",
@@ -353,15 +342,15 @@ const sidebars = {
353
342
  customProps: {
354
343
  badge: "core",
355
344
  },
356
- type: "category",
345
+ items: createRuleItems(coreRuleDocIds),
357
346
  label: "🧱 Core Rules",
358
347
  link: {
359
- type: "generated-index",
360
- title: "Core Rules",
361
348
  description:
362
349
  "General-purpose etc-misc rules for safer and clearer TypeScript code.",
350
+ title: "Core Rules",
351
+ type: "generated-index",
363
352
  },
364
- items: createRuleItems(coreRuleDocIds),
353
+ type: "category",
365
354
  },
366
355
  {
367
356
  className: "sb-cat-rules-typescript",
@@ -369,17 +358,26 @@ const sidebars = {
369
358
  customProps: {
370
359
  badge: "typescript",
371
360
  },
372
- type: "category",
361
+ items: createRuleItems(typeScriptRuleDocIds),
373
362
  label: "🧠 TypeScript Rules",
374
363
  link: {
375
- type: "generated-index",
376
- title: "TypeScript Rules",
377
364
  description:
378
365
  "Rules focused on stronger TypeScript-only constraints and type-level consistency.",
366
+ title: "TypeScript Rules",
367
+ type: "generated-index",
379
368
  },
380
- items: createRuleItems(typeScriptRuleDocIds),
369
+ type: "category",
381
370
  },
382
371
  ],
372
+ label: "📏 Rules",
373
+ link: {
374
+ description:
375
+ "Rule documentation for every eslint-plugin-etc-misc rule.",
376
+ slug: "/",
377
+ title: "Rule Reference",
378
+ type: "generated-index",
379
+ },
380
+ type: "category",
383
381
  },
384
382
  ],
385
383
  } as const satisfies SidebarsConfig;
@@ -25,7 +25,12 @@ const sidebars = {
25
25
  customProps: {
26
26
  badge: "playbooks",
27
27
  },
28
- type: "category",
28
+ items: [
29
+ {
30
+ dirName: "guides",
31
+ type: "autogenerated",
32
+ },
33
+ ],
29
34
  label: "🧭 Guides",
30
35
  link: {
31
36
  description:
@@ -33,12 +38,7 @@ const sidebars = {
33
38
  title: "Guides",
34
39
  type: "generated-index",
35
40
  },
36
- items: [
37
- {
38
- dirName: "guides",
39
- type: "autogenerated",
40
- },
41
- ],
41
+ type: "category",
42
42
  },
43
43
  {
44
44
  className: "sb-cat-architecture",
@@ -46,7 +46,12 @@ const sidebars = {
46
46
  customProps: {
47
47
  badge: "adr",
48
48
  },
49
- type: "category",
49
+ items: [
50
+ {
51
+ dirName: "architecture/adr",
52
+ type: "autogenerated",
53
+ },
54
+ ],
50
55
  label: "🏗️ Architecture",
51
56
  link: {
52
57
  description:
@@ -54,12 +59,7 @@ const sidebars = {
54
59
  title: "Architecture Decisions",
55
60
  type: "generated-index",
56
61
  },
57
- items: [
58
- {
59
- dirName: "architecture/adr",
60
- type: "autogenerated",
61
- },
62
- ],
62
+ type: "category",
63
63
  },
64
64
  {
65
65
  className: "sb-cat-developer",
@@ -67,12 +67,6 @@ const sidebars = {
67
67
  customProps: {
68
68
  badge: "api",
69
69
  },
70
- type: "category",
71
- label: "🛠 Dev",
72
- link: {
73
- type: "doc",
74
- id: "developer/api/index",
75
- },
76
70
  items: [
77
71
  {
78
72
  className: "sb-doc-releasing",
@@ -129,6 +123,12 @@ const sidebars = {
129
123
  type: "category",
130
124
  },
131
125
  ],
126
+ label: "🛠 Dev",
127
+ link: {
128
+ id: "developer/api/index",
129
+ type: "doc",
130
+ },
131
+ type: "category",
132
132
  },
133
133
  ],
134
134
  } as const satisfies SidebarsConfig;
@@ -57,19 +57,19 @@ export default function GitHubStats({ className = "" } = {}) {
57
57
  return (
58
58
  <ul className={badgeListClassName}>
59
59
  {liveBadges.map((badge) => (
60
- <li key={badge.src} className={styles.liveBadgeListItem}>
60
+ <li className={styles.liveBadgeListItem} key={badge.src}>
61
61
  <Link
62
62
  className={styles.liveBadgeAnchor}
63
63
  href={badge.href}
64
- target="_blank"
65
64
  rel="noopener noreferrer"
65
+ target="_blank"
66
66
  >
67
67
  <img
68
68
  alt={badge.alt}
69
69
  className={styles.liveBadgeImage}
70
- src={badge.src}
71
- loading="lazy"
72
70
  decoding="async"
71
+ loading="lazy"
72
+ src={badge.src}
73
73
  />
74
74
  </Link>
75
75
  </li>