@markuplint/rules 5.0.0-rc.2 → 5.0.0-rc.5

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 (573) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/CLAUDE.md +31 -2
  3. package/lib/{wai-aria-deprecated-role → aria-prop-requires-role}/index.d.ts +0 -1
  4. package/lib/{wai-aria-no-global-prop → aria-prop-requires-role}/index.js +0 -1
  5. package/lib/attr-check.d.ts +0 -48
  6. package/lib/attr-check.js +0 -36
  7. package/lib/attr-eligibility.d.ts +41 -0
  8. package/lib/attr-eligibility.js +60 -0
  9. package/lib/attr-value-quotes/index.d.ts +0 -7
  10. package/lib/attr-value-quotes/index.js +0 -7
  11. package/lib/attr-value-quotes/meta.d.ts +0 -1
  12. package/lib/attr-value-quotes/meta.js +0 -1
  13. package/lib/case-sensitive-attr-name/index.d.ts +0 -8
  14. package/lib/case-sensitive-attr-name/index.js +0 -8
  15. package/lib/case-sensitive-attr-name/meta.d.ts +0 -1
  16. package/lib/case-sensitive-attr-name/meta.js +0 -1
  17. package/lib/case-sensitive-tag-name/index.d.ts +0 -8
  18. package/lib/case-sensitive-tag-name/index.js +0 -8
  19. package/lib/case-sensitive-tag-name/meta.d.ts +0 -1
  20. package/lib/case-sensitive-tag-name/meta.js +0 -1
  21. package/lib/class-naming/index.d.ts +0 -8
  22. package/lib/class-naming/index.js +0 -8
  23. package/lib/class-naming/meta.d.ts +1 -2
  24. package/lib/class-naming/meta.js +1 -2
  25. package/lib/consistent-table-row-length/index.d.ts +14 -0
  26. package/lib/consistent-table-row-length/index.js +69 -0
  27. package/lib/consistent-table-row-length/meta.d.ts +4 -0
  28. package/lib/consistent-table-row-length/meta.js +3 -0
  29. package/lib/create-message.d.ts +2 -25
  30. package/lib/create-message.js +2 -53
  31. package/lib/debug.d.ts +1 -9
  32. package/lib/debug.js +1 -5
  33. package/lib/element-supports-aria-prop/index.d.ts +12 -0
  34. package/lib/element-supports-aria-prop/index.js +38 -0
  35. package/lib/form-attr-references-form/index.d.ts +12 -0
  36. package/lib/form-attr-references-form/index.js +64 -0
  37. package/lib/{correct-aspect-ratio → form-attr-references-form}/meta.d.ts +1 -1
  38. package/lib/form-attr-references-form/meta.js +3 -0
  39. package/lib/head-element-order/meta.d.ts +1 -1
  40. package/lib/head-element-order/meta.js +1 -1
  41. package/lib/helpers.d.ts +8 -138
  42. package/lib/helpers.js +24 -165
  43. package/lib/index.d.ts +135 -78
  44. package/lib/index.js +167 -82
  45. package/lib/input-list-references-datalist/index.d.ts +13 -0
  46. package/lib/input-list-references-datalist/index.js +46 -0
  47. package/lib/input-list-references-datalist/meta.d.ts +4 -0
  48. package/lib/input-list-references-datalist/meta.js +3 -0
  49. package/lib/itemprop-requires-itemscope/index.d.ts +21 -0
  50. package/lib/itemprop-requires-itemscope/index.js +53 -0
  51. package/lib/itemprop-requires-itemscope/meta.d.ts +4 -0
  52. package/lib/itemprop-requires-itemscope/meta.js +3 -0
  53. package/lib/label-for-references-labelable/index.d.ts +12 -0
  54. package/lib/label-for-references-labelable/index.js +68 -0
  55. package/lib/label-for-references-labelable/meta.d.ts +4 -0
  56. package/lib/label-for-references-labelable/meta.js +3 -0
  57. package/lib/label-has-control/index.d.ts +5 -5
  58. package/lib/label-has-control/index.js +5 -18
  59. package/lib/label-has-control/meta.d.ts +0 -1
  60. package/lib/label-has-control/meta.js +0 -1
  61. package/lib/label-no-multiple-controls/index.d.ts +31 -0
  62. package/lib/label-no-multiple-controls/index.js +104 -0
  63. package/lib/label-no-multiple-controls/meta.d.ts +4 -0
  64. package/lib/label-no-multiple-controls/meta.js +3 -0
  65. package/lib/landmark-roles/roles.d.ts +32 -0
  66. package/lib/landmark-roles/roles.js +73 -0
  67. package/lib/link-types/index.d.ts +0 -5
  68. package/lib/link-types/index.js +5 -6
  69. package/lib/link-types/meta.d.ts +1 -2
  70. package/lib/link-types/meta.js +1 -2
  71. package/lib/map-id-name-match/index.d.ts +10 -0
  72. package/lib/map-id-name-match/index.js +39 -0
  73. package/lib/map-id-name-match/meta.d.ts +4 -0
  74. package/lib/map-id-name-match/meta.js +3 -0
  75. package/lib/meta-charset-position/index.d.ts +15 -0
  76. package/lib/meta-charset-position/index.js +31 -0
  77. package/lib/meta-charset-position/meta.d.ts +4 -0
  78. package/lib/meta-charset-position/meta.js +3 -0
  79. package/lib/meter-value-bounds/index.d.ts +10 -0
  80. package/lib/meter-value-bounds/index.js +123 -0
  81. package/lib/meter-value-bounds/meta.d.ts +4 -0
  82. package/lib/meter-value-bounds/meta.js +3 -0
  83. package/lib/{wai-aria-required-props → no-abstract-role}/index.d.ts +0 -1
  84. package/lib/{wai-aria-abstract-role → no-abstract-role}/index.js +0 -1
  85. package/lib/no-always-matching-source/index.d.ts +13 -0
  86. package/lib/no-always-matching-source/index.js +100 -0
  87. package/lib/no-always-matching-source/meta.d.ts +4 -0
  88. package/lib/no-always-matching-source/meta.js +3 -0
  89. package/lib/no-ambiguous-navigable-target-names/index.d.ts +0 -8
  90. package/lib/no-ambiguous-navigable-target-names/index.js +0 -8
  91. package/lib/no-ambiguous-navigable-target-names/meta.d.ts +1 -2
  92. package/lib/no-ambiguous-navigable-target-names/meta.js +1 -2
  93. package/lib/{wai-aria-required-owned-elements → no-aria-on-presentational-children}/index.d.ts +0 -1
  94. package/lib/{wai-aria-presentational-children → no-aria-on-presentational-children}/index.js +0 -1
  95. package/lib/no-aria-on-unsupported-element/index.d.ts +11 -0
  96. package/lib/no-aria-on-unsupported-element/index.js +35 -0
  97. package/lib/no-aria-on-unsupported-element/meta.d.ts +9 -0
  98. package/lib/no-aria-on-unsupported-element/meta.js +8 -0
  99. package/lib/no-boolean-attr-value/index.d.ts +0 -7
  100. package/lib/no-boolean-attr-value/index.js +0 -7
  101. package/lib/no-boolean-attr-value/meta.d.ts +0 -1
  102. package/lib/no-boolean-attr-value/meta.js +0 -1
  103. package/lib/no-broken-fragment-link/index.d.ts +15 -0
  104. package/lib/no-broken-fragment-link/index.js +93 -0
  105. package/lib/no-broken-fragment-link/meta.d.ts +4 -0
  106. package/lib/no-broken-fragment-link/meta.js +3 -0
  107. package/lib/no-consecutive-br/index.d.ts +0 -8
  108. package/lib/no-consecutive-br/index.js +0 -8
  109. package/lib/no-consecutive-br/meta.d.ts +0 -1
  110. package/lib/no-consecutive-br/meta.js +0 -1
  111. package/lib/no-content-after-body/index.d.ts +25 -0
  112. package/lib/no-content-after-body/index.js +51 -0
  113. package/lib/no-content-after-body/meta.d.ts +4 -0
  114. package/lib/no-content-after-body/meta.js +3 -0
  115. package/lib/no-contradictory-aria-prop/index.d.ts +10 -0
  116. package/lib/no-contradictory-aria-prop/index.js +34 -0
  117. package/lib/{wai-aria-abstract-role → no-default-aria-value}/index.d.ts +0 -1
  118. package/lib/{wai-aria-default-value → no-default-aria-value}/index.js +0 -1
  119. package/lib/no-default-value/index.d.ts +0 -7
  120. package/lib/no-default-value/index.js +0 -7
  121. package/lib/no-default-value/meta.d.ts +0 -1
  122. package/lib/no-default-value/meta.js +0 -1
  123. package/lib/no-deprecated-aria-prop/index.d.ts +3 -0
  124. package/lib/{wai-aria-deprecated-props → no-deprecated-aria-prop}/index.js +0 -1
  125. package/lib/no-deprecated-attr/index.d.ts +2 -0
  126. package/lib/{deprecated-attr → no-deprecated-attr}/index.js +5 -9
  127. package/lib/no-deprecated-attr/meta.d.ts +4 -0
  128. package/lib/no-deprecated-attr/meta.js +3 -0
  129. package/lib/no-deprecated-element/index.d.ts +2 -0
  130. package/lib/no-deprecated-element/index.js +27 -0
  131. package/lib/no-deprecated-element/meta.d.ts +4 -0
  132. package/lib/no-deprecated-element/meta.js +3 -0
  133. package/lib/no-deprecated-role/index.d.ts +3 -0
  134. package/lib/{wai-aria-deprecated-role → no-deprecated-role}/index.js +0 -1
  135. package/lib/no-disallowed-ancestor/index.d.ts +2 -0
  136. package/lib/no-disallowed-ancestor/index.js +25 -0
  137. package/lib/no-disallowed-ancestor/meta.d.ts +4 -0
  138. package/lib/no-disallowed-ancestor/meta.js +3 -0
  139. package/lib/no-disallowed-attr/index.d.ts +28 -0
  140. package/lib/no-disallowed-attr/index.js +77 -0
  141. package/lib/no-disallowed-attr/meta.d.ts +4 -0
  142. package/lib/no-disallowed-attr/meta.js +3 -0
  143. package/lib/no-duplicate-attr/index.d.ts +2 -0
  144. package/lib/{attr-duplication → no-duplicate-attr}/index.js +0 -7
  145. package/lib/no-duplicate-attr/meta.d.ts +6 -0
  146. package/lib/no-duplicate-attr/meta.js +10 -0
  147. package/lib/no-duplicate-autofocus/index.d.ts +0 -5
  148. package/lib/no-duplicate-autofocus/index.js +20 -6
  149. package/lib/no-duplicate-autofocus/meta.d.ts +1 -1
  150. package/lib/no-duplicate-autofocus/meta.js +1 -1
  151. package/lib/no-duplicate-dt/index.d.ts +0 -6
  152. package/lib/no-duplicate-dt/index.js +1 -6
  153. package/lib/no-duplicate-dt/meta.d.ts +1 -2
  154. package/lib/no-duplicate-dt/meta.js +1 -2
  155. package/lib/no-duplicate-h1/index.d.ts +18 -0
  156. package/lib/no-duplicate-h1/index.js +41 -0
  157. package/lib/no-duplicate-h1/meta.d.ts +4 -0
  158. package/lib/no-duplicate-h1/meta.js +3 -0
  159. package/lib/no-duplicate-id/index.d.ts +2 -0
  160. package/lib/{id-duplication → no-duplicate-id}/index.js +0 -7
  161. package/lib/no-duplicate-id/meta.d.ts +4 -0
  162. package/lib/no-duplicate-id/meta.js +3 -0
  163. package/lib/no-duplicate-sibling-attr/index.d.ts +2 -0
  164. package/lib/no-duplicate-sibling-attr/index.js +35 -0
  165. package/lib/no-duplicate-sibling-attr/meta.d.ts +4 -0
  166. package/lib/no-duplicate-sibling-attr/meta.js +3 -0
  167. package/lib/no-duplicate-visible-main/index.d.ts +0 -1
  168. package/lib/no-duplicate-visible-main/index.js +0 -1
  169. package/lib/no-duplicate-visible-main/meta.d.ts +1 -1
  170. package/lib/no-duplicate-visible-main/meta.js +1 -1
  171. package/lib/no-empty-palpable-content/index.d.ts +0 -8
  172. package/lib/no-empty-palpable-content/index.js +0 -8
  173. package/lib/no-empty-palpable-content/meta.d.ts +1 -2
  174. package/lib/no-empty-palpable-content/meta.js +1 -2
  175. package/lib/no-empty-table-track/index.d.ts +12 -0
  176. package/lib/no-empty-table-track/index.js +42 -0
  177. package/lib/no-empty-table-track/meta.d.ts +4 -0
  178. package/lib/no-empty-table-track/meta.js +3 -0
  179. package/lib/no-event-handler-attr/index.d.ts +7 -0
  180. package/lib/{no-use-event-handler-attr → no-event-handler-attr}/index.js +0 -11
  181. package/lib/no-event-handler-attr/meta.d.ts +4 -0
  182. package/lib/no-event-handler-attr/meta.js +3 -0
  183. package/lib/no-experimental-features/index.d.ts +9 -0
  184. package/lib/no-experimental-features/index.js +53 -0
  185. package/lib/no-experimental-features/meta.d.ts +4 -0
  186. package/lib/no-experimental-features/meta.js +3 -0
  187. package/lib/no-extra-selected-options/index.d.ts +10 -0
  188. package/lib/no-extra-selected-options/index.js +37 -0
  189. package/lib/no-extra-selected-options/meta.d.ts +4 -0
  190. package/lib/no-extra-selected-options/meta.js +3 -0
  191. package/lib/no-focusable-in-aria-hidden/index.d.ts +3 -0
  192. package/lib/{wai-aria-interaction-in-hidden → no-focusable-in-aria-hidden}/index.js +0 -1
  193. package/lib/no-focusable-in-aria-hidden/meta.d.ts +4 -0
  194. package/lib/no-focusable-in-aria-hidden/meta.js +3 -0
  195. package/lib/no-hardcoded-id/index.d.ts +2 -0
  196. package/lib/{no-hard-code-id → no-hardcoded-id}/index.js +0 -8
  197. package/lib/no-hardcoded-id/meta.d.ts +4 -0
  198. package/lib/no-hardcoded-id/meta.js +3 -0
  199. package/lib/no-ineffective-attr/index.d.ts +2 -0
  200. package/lib/{ineffective-attr → no-ineffective-attr}/index.js +0 -7
  201. package/lib/no-ineffective-attr/meta.d.ts +5 -0
  202. package/lib/no-ineffective-attr/meta.js +4 -0
  203. package/lib/no-input-file-value/index.d.ts +10 -0
  204. package/lib/no-input-file-value/index.js +41 -0
  205. package/lib/no-input-file-value/meta.d.ts +4 -0
  206. package/lib/no-input-file-value/meta.js +3 -0
  207. package/lib/no-invalid-aria-prop-value/index.d.ts +3 -0
  208. package/lib/{wai-aria-value → no-invalid-aria-prop-value}/index.js +0 -1
  209. package/lib/no-invalid-aria-prop-value/meta.d.ts +4 -0
  210. package/lib/no-invalid-aria-prop-value/meta.js +3 -0
  211. package/lib/no-invalid-attr-value/index.d.ts +27 -0
  212. package/lib/no-invalid-attr-value/index.js +83 -0
  213. package/lib/no-invalid-attr-value/meta.d.ts +4 -0
  214. package/lib/no-invalid-attr-value/meta.js +3 -0
  215. package/lib/no-malformed-character-reference/index.d.ts +2 -0
  216. package/lib/no-malformed-character-reference/index.js +38 -0
  217. package/lib/no-malformed-character-reference/meta.d.ts +5 -0
  218. package/lib/no-malformed-character-reference/meta.js +20 -0
  219. package/lib/{correct-aspect-ratio → no-mismatched-aspect-ratio}/index.js +13 -3
  220. package/lib/no-mismatched-aspect-ratio/meta.d.ts +4 -0
  221. package/lib/no-mismatched-aspect-ratio/meta.js +3 -0
  222. package/lib/{correct-aspect-ratio → no-mismatched-aspect-ratio}/resolve-image-size.js +8 -2
  223. package/lib/no-mixed-srcset-descriptors/index.d.ts +12 -0
  224. package/lib/no-mixed-srcset-descriptors/index.js +47 -0
  225. package/lib/no-mixed-srcset-descriptors/meta.d.ts +4 -0
  226. package/lib/no-mixed-srcset-descriptors/meta.js +3 -0
  227. package/lib/no-nested-top-level-landmark/index.d.ts +10 -0
  228. package/lib/no-nested-top-level-landmark/index.js +52 -0
  229. package/lib/no-nested-top-level-landmark/meta.d.ts +4 -0
  230. package/lib/no-nested-top-level-landmark/meta.js +3 -0
  231. package/lib/no-nonstandard-features/index.d.ts +9 -0
  232. package/lib/no-nonstandard-features/index.js +53 -0
  233. package/lib/no-nonstandard-features/meta.d.ts +4 -0
  234. package/lib/no-nonstandard-features/meta.js +3 -0
  235. package/lib/no-obsolete-attr/index.d.ts +2 -0
  236. package/lib/no-obsolete-attr/index.js +27 -0
  237. package/lib/no-obsolete-attr/meta.d.ts +4 -0
  238. package/lib/no-obsolete-attr/meta.js +3 -0
  239. package/lib/no-obsolete-doctype/index.d.ts +2 -0
  240. package/lib/{doctype → no-obsolete-doctype}/index.js +9 -16
  241. package/lib/no-obsolete-doctype/meta.d.ts +4 -0
  242. package/lib/no-obsolete-doctype/meta.js +3 -0
  243. package/lib/no-obsolete-element/index.d.ts +2 -0
  244. package/lib/{deprecated-element → no-obsolete-element}/index.js +6 -10
  245. package/lib/no-obsolete-element/meta.d.ts +4 -0
  246. package/lib/no-obsolete-element/meta.js +3 -0
  247. package/lib/no-orphaned-end-tag/index.d.ts +0 -7
  248. package/lib/no-orphaned-end-tag/index.js +0 -7
  249. package/lib/no-orphaned-end-tag/meta.d.ts +2 -2
  250. package/lib/no-orphaned-end-tag/meta.js +5 -2
  251. package/lib/no-prohibited-naming/index.d.ts +8 -0
  252. package/lib/no-prohibited-naming/index.js +36 -0
  253. package/lib/no-prohibited-naming/meta.d.ts +4 -0
  254. package/lib/no-prohibited-naming/meta.js +3 -0
  255. package/lib/{use-list → no-pseudo-list}/index.d.ts +1 -8
  256. package/lib/{use-list → no-pseudo-list}/index.js +0 -7
  257. package/lib/no-pseudo-list/meta.d.ts +4 -0
  258. package/lib/no-pseudo-list/meta.js +3 -0
  259. package/lib/{redundant-accessible-name → no-redundant-accessible-name}/index.d.ts +0 -4
  260. package/lib/{redundant-accessible-name → no-redundant-accessible-name}/index.js +0 -4
  261. package/lib/no-redundant-accessible-name/meta.d.ts +4 -0
  262. package/lib/no-redundant-accessible-name/meta.js +3 -0
  263. package/lib/no-redundant-aria-prop/index.d.ts +10 -0
  264. package/lib/{wai-aria-implicit-props → no-redundant-aria-prop}/index.js +9 -3
  265. package/lib/no-redundant-aria-prop/meta.d.ts +4 -0
  266. package/lib/no-redundant-aria-prop/meta.js +3 -0
  267. package/lib/no-redundant-role/index.d.ts +3 -0
  268. package/lib/{wai-aria-implicit-role → no-redundant-role}/index.js +0 -1
  269. package/lib/no-redundant-role/meta.d.ts +4 -0
  270. package/lib/no-redundant-role/meta.js +3 -0
  271. package/lib/no-refer-to-non-existent-id/index.d.ts +0 -9
  272. package/lib/no-refer-to-non-existent-id/index.js +1 -62
  273. package/lib/no-refer-to-non-existent-id/meta.d.ts +1 -2
  274. package/lib/no-refer-to-non-existent-id/meta.js +1 -2
  275. package/lib/no-restricted-attr/index.d.ts +27 -0
  276. package/lib/no-restricted-attr/index.js +96 -0
  277. package/lib/no-restricted-attr/meta.d.ts +4 -0
  278. package/lib/no-restricted-attr/meta.js +3 -0
  279. package/lib/no-restricted-element/index.d.ts +2 -0
  280. package/lib/{disallowed-element → no-restricted-element}/index.js +7 -8
  281. package/lib/no-restricted-element/meta.d.ts +4 -0
  282. package/lib/no-restricted-element/meta.js +3 -0
  283. package/lib/no-skipped-heading-level/index.d.ts +13 -0
  284. package/lib/{heading-levels → no-skipped-heading-level}/index.js +10 -5
  285. package/lib/no-skipped-heading-level/meta.d.ts +4 -0
  286. package/lib/no-skipped-heading-level/meta.js +3 -0
  287. package/lib/no-stray-head-or-body-tag/index.d.ts +28 -0
  288. package/lib/no-stray-head-or-body-tag/index.js +61 -0
  289. package/lib/no-stray-head-or-body-tag/meta.d.ts +4 -0
  290. package/lib/no-stray-head-or-body-tag/meta.js +3 -0
  291. package/lib/no-table-cell-overlap/index.d.ts +12 -0
  292. package/lib/no-table-cell-overlap/index.js +30 -0
  293. package/lib/no-table-cell-overlap/meta.d.ts +4 -0
  294. package/lib/no-table-cell-overlap/meta.js +3 -0
  295. package/lib/no-table-span-overflow/index.d.ts +12 -0
  296. package/lib/no-table-span-overflow/index.js +37 -0
  297. package/lib/no-table-span-overflow/meta.d.ts +4 -0
  298. package/lib/no-table-span-overflow/meta.js +3 -0
  299. package/lib/no-unclosed-element-at-eof/index.d.ts +2 -0
  300. package/lib/no-unclosed-element-at-eof/index.js +86 -0
  301. package/lib/no-unclosed-element-at-eof/meta.d.ts +4 -0
  302. package/lib/no-unclosed-element-at-eof/meta.js +3 -0
  303. package/lib/no-unescaped-char/index.d.ts +14 -0
  304. package/lib/{character-reference → no-unescaped-char}/index.js +31 -20
  305. package/lib/no-unescaped-char/meta.d.ts +4 -0
  306. package/lib/no-unescaped-char/meta.js +3 -0
  307. package/lib/{invalid-attr → no-unknown-attr}/index.d.ts +4 -19
  308. package/lib/no-unknown-attr/index.js +91 -0
  309. package/lib/no-unknown-attr/meta.d.ts +4 -0
  310. package/lib/no-unknown-attr/meta.js +3 -0
  311. package/lib/no-unknown-role/index.d.ts +3 -0
  312. package/lib/{wai-aria-non-existent-role → no-unknown-role}/index.js +0 -1
  313. package/lib/no-unknown-role/meta.d.ts +4 -0
  314. package/lib/no-unknown-role/meta.js +3 -0
  315. package/lib/no-unpaired-srcset-sizes/index.d.ts +12 -0
  316. package/lib/no-unpaired-srcset-sizes/index.js +77 -0
  317. package/lib/no-unpaired-srcset-sizes/meta.d.ts +4 -0
  318. package/lib/no-unpaired-srcset-sizes/meta.js +3 -0
  319. package/lib/{no-unsupported-features → no-unsupported-browser-features}/index.d.ts +1 -10
  320. package/lib/no-unsupported-browser-features/index.js +81 -0
  321. package/lib/no-unsupported-browser-features/meta.d.ts +4 -0
  322. package/lib/no-unsupported-browser-features/meta.js +3 -0
  323. package/lib/permitted-contents/index.d.ts +0 -18
  324. package/lib/permitted-contents/index.js +0 -78
  325. package/lib/permitted-contents/meta.d.ts +1 -2
  326. package/lib/permitted-contents/meta.js +1 -2
  327. package/lib/permitted-contents/represent-transparent-nodes.js +15 -6
  328. package/lib/permitted-roles/index.d.ts +3 -0
  329. package/lib/{wai-aria-permitted-roles → permitted-roles}/index.js +0 -1
  330. package/lib/permitted-roles/meta.d.ts +4 -0
  331. package/lib/permitted-roles/meta.js +3 -0
  332. package/lib/placeholder-label-option/index.d.ts +10 -4
  333. package/lib/placeholder-label-option/index.js +30 -17
  334. package/lib/placeholder-label-option/meta.d.ts +1 -2
  335. package/lib/placeholder-label-option/meta.js +1 -2
  336. package/lib/progress-value-bounds/index.d.ts +10 -0
  337. package/lib/progress-value-bounds/index.js +59 -0
  338. package/lib/progress-value-bounds/meta.d.ts +4 -0
  339. package/lib/progress-value-bounds/meta.js +3 -0
  340. package/lib/require-accessible-name/index.d.ts +0 -7
  341. package/lib/require-accessible-name/index.js +0 -7
  342. package/lib/require-accessible-name/meta.d.ts +0 -1
  343. package/lib/require-accessible-name/meta.js +0 -1
  344. package/lib/require-adjacent-popover/index.d.ts +2 -0
  345. package/lib/{neighbor-popovers → require-adjacent-popover}/index.js +1 -8
  346. package/lib/require-adjacent-popover/meta.d.ts +4 -0
  347. package/lib/require-adjacent-popover/meta.js +3 -0
  348. package/lib/require-ancestor/index.d.ts +2 -0
  349. package/lib/require-ancestor/index.js +29 -0
  350. package/lib/require-ancestor/meta.d.ts +4 -0
  351. package/lib/require-ancestor/meta.js +3 -0
  352. package/lib/require-aria-prop/index.d.ts +3 -0
  353. package/lib/{wai-aria-required-props → require-aria-prop}/index.js +0 -1
  354. package/lib/require-aria-prop/meta.d.ts +4 -0
  355. package/lib/require-aria-prop/meta.js +3 -0
  356. package/lib/{required-attr → require-attr}/index.d.ts +2 -9
  357. package/lib/{required-attr → require-attr}/index.js +0 -7
  358. package/lib/require-attr/meta.d.ts +4 -0
  359. package/lib/require-attr/meta.js +3 -0
  360. package/lib/require-datetime/index.d.ts +0 -8
  361. package/lib/require-datetime/index.js +0 -8
  362. package/lib/require-datetime/meta.d.ts +1 -2
  363. package/lib/require-datetime/meta.js +1 -2
  364. package/lib/require-dialog-autofocus/index.d.ts +0 -10
  365. package/lib/require-dialog-autofocus/index.js +0 -10
  366. package/lib/require-dialog-autofocus/meta.d.ts +0 -1
  367. package/lib/require-dialog-autofocus/meta.js +0 -1
  368. package/lib/require-doctype/index.d.ts +2 -0
  369. package/lib/require-doctype/index.js +19 -0
  370. package/lib/require-doctype/meta.d.ts +5 -0
  371. package/lib/require-doctype/meta.js +10 -0
  372. package/lib/{required-element → require-element}/index.d.ts +1 -9
  373. package/lib/{required-element → require-element}/index.js +0 -8
  374. package/lib/require-element/meta.d.ts +4 -0
  375. package/lib/require-element/meta.js +3 -0
  376. package/lib/require-end-tag/index.d.ts +2 -0
  377. package/lib/{end-tag → require-end-tag}/index.js +0 -7
  378. package/lib/require-end-tag/meta.d.ts +4 -0
  379. package/lib/require-end-tag/meta.js +3 -0
  380. package/lib/require-h1/index.d.ts +17 -0
  381. package/lib/{required-h1 → require-h1}/index.js +6 -14
  382. package/lib/require-h1/meta.d.ts +4 -0
  383. package/lib/require-h1/meta.js +3 -0
  384. package/lib/require-landmark-label/index.d.ts +11 -0
  385. package/lib/require-landmark-label/index.js +55 -0
  386. package/lib/require-landmark-label/meta.d.ts +4 -0
  387. package/lib/require-landmark-label/meta.js +3 -0
  388. package/lib/require-owned-elements/index.d.ts +3 -0
  389. package/lib/{wai-aria-required-owned-elements → require-owned-elements}/index.js +0 -2
  390. package/lib/require-owned-elements/meta.d.ts +4 -0
  391. package/lib/require-owned-elements/meta.js +3 -0
  392. package/lib/require-parent-role/index.d.ts +3 -0
  393. package/lib/{wai-aria-required-parent-role → require-parent-role}/index.js +0 -1
  394. package/lib/require-parent-role/meta.d.ts +4 -0
  395. package/lib/require-parent-role/meta.js +3 -0
  396. package/lib/role-supports-aria-prop/index.d.ts +8 -0
  397. package/lib/{wai-aria-disallowed-props → role-supports-aria-prop}/index.js +11 -10
  398. package/lib/role-supports-aria-prop/meta.d.ts +4 -0
  399. package/lib/role-supports-aria-prop/meta.js +3 -0
  400. package/lib/rule-aliases.d.ts +2 -0
  401. package/lib/rule-aliases.js +325 -0
  402. package/lib/sizes-auto-requires-lazy-loading/index.d.ts +14 -0
  403. package/lib/sizes-auto-requires-lazy-loading/index.js +68 -0
  404. package/lib/sizes-auto-requires-lazy-loading/meta.d.ts +4 -0
  405. package/lib/sizes-auto-requires-lazy-loading/meta.js +3 -0
  406. package/lib/srcset-sizes-constraint/parse-srcset.d.ts +6 -0
  407. package/lib/srcset-sizes-constraint/parse-srcset.js +6 -0
  408. package/lib/srcset-sizes-constraint/sibling-helpers.d.ts +21 -0
  409. package/lib/srcset-sizes-constraint/sibling-helpers.js +37 -0
  410. package/lib/tab-requires-tabpanel/index.d.ts +3 -0
  411. package/lib/tab-requires-tabpanel/index.js +21 -0
  412. package/lib/tab-requires-tabpanel/meta.d.ts +4 -0
  413. package/lib/tab-requires-tabpanel/meta.js +3 -0
  414. package/lib/table-row-column-alignment/grid.d.ts +108 -52
  415. package/lib/table-row-column-alignment/grid.js +276 -203
  416. package/lib/table-row-column-alignment/types.d.ts +6 -8
  417. package/lib/usemap-references-map/index.d.ts +14 -0
  418. package/lib/usemap-references-map/index.js +46 -0
  419. package/lib/usemap-references-map/meta.d.ts +4 -0
  420. package/lib/usemap-references-map/meta.js +3 -0
  421. package/lib/valid-importmap/index.d.ts +2 -0
  422. package/lib/valid-importmap/index.js +176 -0
  423. package/lib/valid-importmap/meta.d.ts +4 -0
  424. package/lib/valid-importmap/meta.js +3 -0
  425. package/lib/valid-speculation-rules/index.d.ts +2 -0
  426. package/lib/valid-speculation-rules/index.js +292 -0
  427. package/lib/valid-speculation-rules/meta.d.ts +4 -0
  428. package/lib/valid-speculation-rules/meta.js +3 -0
  429. package/lib/wai-aria/checkings/contradictory-aria-prop.d.ts +23 -0
  430. package/lib/wai-aria/checkings/{implicit-props.js → contradictory-aria-prop.js} +22 -14
  431. package/lib/wai-aria/checkings/element-supports-aria-prop.d.ts +20 -0
  432. package/lib/wai-aria/checkings/element-supports-aria-prop.js +83 -0
  433. package/lib/wai-aria/checkings/prohibited-naming.d.ts +35 -0
  434. package/lib/wai-aria/checkings/prohibited-naming.js +64 -0
  435. package/lib/wai-aria/checkings/redundant-aria-prop.d.ts +23 -0
  436. package/lib/wai-aria/checkings/redundant-aria-prop.js +53 -0
  437. package/lib/wai-aria/checkings/required-prop.d.ts +4 -0
  438. package/lib/wai-aria/checkings/required-prop.js +16 -3
  439. package/lib/wai-aria/checkings/role-supports-aria-prop.d.ts +20 -0
  440. package/lib/wai-aria/checkings/role-supports-aria-prop.js +30 -0
  441. package/lib/wai-aria/checkings/tab-requires-tabpanel.d.ts +19 -0
  442. package/lib/wai-aria/checkings/tab-requires-tabpanel.js +56 -0
  443. package/lib/wai-aria/default-options.js +1 -0
  444. package/lib/wai-aria/types.d.ts +2 -0
  445. package/package.json +11 -10
  446. package/schema.json +275 -59
  447. package/SKILL.md +0 -77
  448. package/lib/attr-duplication/index.d.ts +0 -9
  449. package/lib/attr-duplication/meta.d.ts +0 -6
  450. package/lib/attr-duplication/meta.js +0 -5
  451. package/lib/character-reference/index.d.ts +0 -12
  452. package/lib/character-reference/meta.d.ts +0 -5
  453. package/lib/character-reference/meta.js +0 -4
  454. package/lib/correct-aspect-ratio/meta.js +0 -3
  455. package/lib/deprecated-attr/index.d.ts +0 -8
  456. package/lib/deprecated-attr/meta.d.ts +0 -5
  457. package/lib/deprecated-attr/meta.js +0 -4
  458. package/lib/deprecated-element/index.d.ts +0 -8
  459. package/lib/deprecated-element/meta.d.ts +0 -5
  460. package/lib/deprecated-element/meta.js +0 -4
  461. package/lib/disallowed-element/index.d.ts +0 -9
  462. package/lib/disallowed-element/meta.d.ts +0 -5
  463. package/lib/disallowed-element/meta.js +0 -4
  464. package/lib/doctype/index.d.ts +0 -15
  465. package/lib/doctype/meta.d.ts +0 -5
  466. package/lib/doctype/meta.js +0 -4
  467. package/lib/end-tag/index.d.ts +0 -9
  468. package/lib/end-tag/meta.d.ts +0 -5
  469. package/lib/end-tag/meta.js +0 -4
  470. package/lib/heading-levels/index.d.ts +0 -8
  471. package/lib/heading-levels/meta.d.ts +0 -5
  472. package/lib/heading-levels/meta.js +0 -4
  473. package/lib/id-duplication/index.d.ts +0 -9
  474. package/lib/id-duplication/meta.d.ts +0 -5
  475. package/lib/id-duplication/meta.js +0 -4
  476. package/lib/ineffective-attr/index.d.ts +0 -9
  477. package/lib/ineffective-attr/meta.d.ts +0 -6
  478. package/lib/ineffective-attr/meta.js +0 -5
  479. package/lib/invalid-attr/index.js +0 -207
  480. package/lib/invalid-attr/meta.d.ts +0 -5
  481. package/lib/invalid-attr/meta.js +0 -4
  482. package/lib/landmark-roles/index.d.ts +0 -22
  483. package/lib/landmark-roles/index.js +0 -142
  484. package/lib/landmark-roles/meta.d.ts +0 -5
  485. package/lib/landmark-roles/meta.js +0 -4
  486. package/lib/neighbor-popovers/index.d.ts +0 -10
  487. package/lib/neighbor-popovers/meta.d.ts +0 -5
  488. package/lib/neighbor-popovers/meta.js +0 -4
  489. package/lib/no-hard-code-id/index.d.ts +0 -10
  490. package/lib/no-hard-code-id/meta.d.ts +0 -5
  491. package/lib/no-hard-code-id/meta.js +0 -4
  492. package/lib/no-unsupported-features/index.js +0 -139
  493. package/lib/no-unsupported-features/meta.d.ts +0 -5
  494. package/lib/no-unsupported-features/meta.js +0 -4
  495. package/lib/no-use-event-handler-attr/index.d.ts +0 -18
  496. package/lib/no-use-event-handler-attr/meta.d.ts +0 -5
  497. package/lib/no-use-event-handler-attr/meta.js +0 -4
  498. package/lib/redundant-accessible-name/meta.d.ts +0 -5
  499. package/lib/redundant-accessible-name/meta.js +0 -4
  500. package/lib/required-attr/meta.d.ts +0 -5
  501. package/lib/required-attr/meta.js +0 -4
  502. package/lib/required-element/meta.d.ts +0 -5
  503. package/lib/required-element/meta.js +0 -4
  504. package/lib/required-h1/index.d.ts +0 -18
  505. package/lib/required-h1/meta.d.ts +0 -5
  506. package/lib/required-h1/meta.js +0 -4
  507. package/lib/srcset-sizes-constraint/index.d.ts +0 -6
  508. package/lib/srcset-sizes-constraint/index.js +0 -108
  509. package/lib/srcset-sizes-constraint/meta.d.ts +0 -5
  510. package/lib/srcset-sizes-constraint/meta.js +0 -4
  511. package/lib/table-row-column-alignment/index.d.ts +0 -10
  512. package/lib/table-row-column-alignment/index.js +0 -97
  513. package/lib/table-row-column-alignment/meta.d.ts +0 -5
  514. package/lib/table-row-column-alignment/meta.js +0 -4
  515. package/lib/use-list/meta.d.ts +0 -5
  516. package/lib/use-list/meta.js +0 -4
  517. package/lib/wai-aria/checkings/disallowed-prop.d.ts +0 -23
  518. package/lib/wai-aria/checkings/disallowed-prop.js +0 -84
  519. package/lib/wai-aria/checkings/implicit-props.d.ts +0 -20
  520. package/lib/wai-aria/index.d.ts +0 -13
  521. package/lib/wai-aria/index.js +0 -115
  522. package/lib/wai-aria/meta.d.ts +0 -5
  523. package/lib/wai-aria/meta.js +0 -4
  524. package/lib/wai-aria-default-value/index.d.ts +0 -4
  525. package/lib/wai-aria-default-value/meta.d.ts +0 -5
  526. package/lib/wai-aria-default-value/meta.js +0 -4
  527. package/lib/wai-aria-deprecated-props/index.d.ts +0 -4
  528. package/lib/wai-aria-deprecated-props/meta.d.ts +0 -5
  529. package/lib/wai-aria-deprecated-props/meta.js +0 -4
  530. package/lib/wai-aria-disallowed-props/index.d.ts +0 -4
  531. package/lib/wai-aria-disallowed-props/meta.d.ts +0 -5
  532. package/lib/wai-aria-disallowed-props/meta.js +0 -4
  533. package/lib/wai-aria-implicit-props/index.d.ts +0 -4
  534. package/lib/wai-aria-implicit-props/meta.d.ts +0 -5
  535. package/lib/wai-aria-implicit-props/meta.js +0 -4
  536. package/lib/wai-aria-implicit-role/index.d.ts +0 -4
  537. package/lib/wai-aria-interaction-in-hidden/index.d.ts +0 -4
  538. package/lib/wai-aria-interaction-in-hidden/meta.d.ts +0 -5
  539. package/lib/wai-aria-interaction-in-hidden/meta.js +0 -4
  540. package/lib/wai-aria-no-global-prop/index.d.ts +0 -4
  541. package/lib/wai-aria-no-global-prop/meta.d.ts +0 -5
  542. package/lib/wai-aria-no-global-prop/meta.js +0 -4
  543. package/lib/wai-aria-non-existent-role/index.d.ts +0 -4
  544. package/lib/wai-aria-permitted-roles/index.d.ts +0 -4
  545. package/lib/wai-aria-presentational-children/index.d.ts +0 -4
  546. package/lib/wai-aria-presentational-children/meta.d.ts +0 -5
  547. package/lib/wai-aria-presentational-children/meta.js +0 -4
  548. package/lib/wai-aria-required-parent-role/index.d.ts +0 -4
  549. package/lib/wai-aria-value/index.d.ts +0 -4
  550. package/lib/wai-aria-value/meta.d.ts +0 -5
  551. package/lib/wai-aria-value/meta.js +0 -4
  552. /package/lib/{wai-aria-abstract-role → aria-prop-requires-role}/meta.d.ts +0 -0
  553. /package/lib/{wai-aria-abstract-role → aria-prop-requires-role}/meta.js +0 -0
  554. /package/lib/{wai-aria-deprecated-role → element-supports-aria-prop}/meta.d.ts +0 -0
  555. /package/lib/{wai-aria-deprecated-role → element-supports-aria-prop}/meta.js +0 -0
  556. /package/lib/{wai-aria-implicit-role → no-abstract-role}/meta.d.ts +0 -0
  557. /package/lib/{wai-aria-implicit-role → no-abstract-role}/meta.js +0 -0
  558. /package/lib/{wai-aria-non-existent-role → no-aria-on-presentational-children}/meta.d.ts +0 -0
  559. /package/lib/{wai-aria-non-existent-role → no-aria-on-presentational-children}/meta.js +0 -0
  560. /package/lib/{wai-aria-permitted-roles → no-contradictory-aria-prop}/meta.d.ts +0 -0
  561. /package/lib/{wai-aria-permitted-roles → no-contradictory-aria-prop}/meta.js +0 -0
  562. /package/lib/{wai-aria-required-owned-elements → no-default-aria-value}/meta.d.ts +0 -0
  563. /package/lib/{wai-aria-required-owned-elements → no-default-aria-value}/meta.js +0 -0
  564. /package/lib/{wai-aria-required-parent-role → no-deprecated-aria-prop}/meta.d.ts +0 -0
  565. /package/lib/{wai-aria-required-parent-role → no-deprecated-aria-prop}/meta.js +0 -0
  566. /package/lib/{wai-aria-required-props → no-deprecated-role}/meta.d.ts +0 -0
  567. /package/lib/{wai-aria-required-props → no-deprecated-role}/meta.js +0 -0
  568. /package/lib/{correct-aspect-ratio → no-mismatched-aspect-ratio}/index.d.ts +0 -0
  569. /package/lib/{correct-aspect-ratio → no-mismatched-aspect-ratio}/resolve-image-size.d.ts +0 -0
  570. /package/lib/{no-unsupported-features → no-unsupported-browser-features}/compat-data.d.ts +0 -0
  571. /package/lib/{no-unsupported-features → no-unsupported-browser-features}/compat-data.js +0 -0
  572. /package/lib/{no-unsupported-features → no-unsupported-browser-features}/resolve-browsers.d.ts +0 -0
  573. /package/lib/{no-unsupported-features → no-unsupported-browser-features}/resolve-browsers.js +0 -0
@@ -1,139 +0,0 @@
1
- import { createRule, getAttrSpecs, getSpec } from '@markuplint/ml-core';
2
- import { checkAttributeSupport, checkElementSupport } from './compat-data.js';
3
- import meta from './meta.js';
4
- import { clearBrowserslistCache, resolveTargetBrowsers } from './resolve-browsers.js';
5
- /**
6
- * Rule that warns when using HTML elements or attributes that are not
7
- * supported by the project's target browsers (via browserslist),
8
- * or that are experimental/non-standard.
9
- */
10
- export default createRule({
11
- meta: meta,
12
- defaultSeverity: 'warning',
13
- defaultOptions: {
14
- checkExperimental: false,
15
- checkNonStandard: false,
16
- },
17
- async verify({ document, report, t }) {
18
- const options = document.rule.options;
19
- const targetBrowsers = resolveTargetBrowsers(document.filename, {
20
- browserslist: options.browserslist,
21
- browserslistConfig: options.browserslistConfig,
22
- browserslistEnv: options.browserslistEnv,
23
- });
24
- const hasTargetBrowsers = targetBrowsers != null && targetBrowsers.length > 0;
25
- const checkExperimental = options.checkExperimental ?? false;
26
- const checkNonStandard = options.checkNonStandard ?? false;
27
- // If no browserslist config and no experimental/nonStandard check, rule is no-op
28
- if (!hasTargetBrowsers && !checkExperimental && !checkNonStandard) {
29
- return;
30
- }
31
- const ignoreFeatures = new Set(options.ignoreFeatures);
32
- await document.walkOn('Element', async (el) => {
33
- // Only check HTML elements
34
- if (el.namespaceURI !== 'http://www.w3.org/1999/xhtml' || el.elementType !== 'html') {
35
- return;
36
- }
37
- const elName = el.localName;
38
- const elOptions = el.rule.options;
39
- const elIgnoreFeatures = new Set(elOptions.ignoreFeatures ?? ignoreFeatures);
40
- // Check element itself
41
- if (!elIgnoreFeatures.has(elName)) {
42
- // Experimental check (spec-based, no BCD needed)
43
- if (elOptions.checkExperimental ?? checkExperimental) {
44
- const spec = getSpec(el, document.specs.specs);
45
- if (spec?.experimental) {
46
- report({
47
- scope: el,
48
- message: t('{0} is {1:c}', t('the "{0*}" {1}', elName, 'element'), 'experimental'),
49
- });
50
- }
51
- }
52
- // NonStandard check (spec-based, no BCD needed)
53
- if (elOptions.checkNonStandard ?? checkNonStandard) {
54
- const spec = getSpec(el, document.specs.specs);
55
- if (spec?.nonStandard) {
56
- report({
57
- scope: el,
58
- message: t('{0} is {1:c}', t('the "{0*}" {1}', elName, 'element'), 'non-standard'),
59
- });
60
- }
61
- }
62
- // Browser support check (BCD-based)
63
- if (hasTargetBrowsers) {
64
- const unsupported = await checkElementSupport(elName, targetBrowsers);
65
- if (unsupported.length > 0) {
66
- report({
67
- scope: el,
68
- message: formatUnsupportedMessage(t, elName, 'element', unsupported),
69
- });
70
- }
71
- }
72
- }
73
- // Check attributes
74
- const attrSpecs = getAttrSpecs(el, document.specs);
75
- for (const attr of el.attributes) {
76
- if (attr.isDirective) {
77
- continue;
78
- }
79
- const attrName = attr.name;
80
- const ignoreKey = `${elName}[${attrName}]`;
81
- if (elIgnoreFeatures.has(ignoreKey)) {
82
- continue;
83
- }
84
- const attrSpec = attrSpecs?.find(s => s.name === attrName);
85
- // Experimental attribute check
86
- if ((elOptions.checkExperimental ?? checkExperimental) && attrSpec?.experimental) {
87
- report({
88
- scope: attr,
89
- line: attr.nameNode?.startLine,
90
- col: attr.nameNode?.startCol,
91
- raw: attr.nameNode?.raw,
92
- message: t('{0} is {1:c}', t('the "{0*}" {1}', attrName, 'attribute'), 'experimental'),
93
- });
94
- }
95
- // NonStandard attribute check
96
- if ((elOptions.checkNonStandard ?? checkNonStandard) && attrSpec?.nonStandard) {
97
- report({
98
- scope: attr,
99
- line: attr.nameNode?.startLine,
100
- col: attr.nameNode?.startCol,
101
- raw: attr.nameNode?.raw,
102
- message: t('{0} is {1:c}', t('the "{0*}" {1}', attrName, 'attribute'), 'non-standard'),
103
- });
104
- }
105
- // Browser support attribute check
106
- if (hasTargetBrowsers) {
107
- const unsupported = await checkAttributeSupport(elName, attrName, targetBrowsers);
108
- if (unsupported.length > 0) {
109
- report({
110
- scope: attr,
111
- line: attr.nameNode?.startLine,
112
- col: attr.nameNode?.startCol,
113
- raw: attr.nameNode?.raw,
114
- message: formatUnsupportedMessage(t, attrName, 'attribute', unsupported),
115
- });
116
- }
117
- }
118
- }
119
- });
120
- clearBrowserslistCache();
121
- },
122
- });
123
- /**
124
- * Format an unsupported feature message listing affected browsers.
125
- */
126
- function formatUnsupportedMessage(t, featureName, featureType, unsupported) {
127
- const browserDetails = unsupported
128
- .map(u => {
129
- if (u.addedVersion === false) {
130
- if (u.removedVersion) {
131
- return `${u.displayName} (removed in ${u.removedVersion})`;
132
- }
133
- return `${u.displayName} (not supported)`;
134
- }
135
- return `${u.displayName} (added in ${u.addedVersion}, target: ${u.targetVersion})`;
136
- })
137
- .join(', ');
138
- return t('{0} is not supported in {1}', t('the "{0*}" {1}', featureName, featureType), browserDetails);
139
- }
@@ -1,5 +0,0 @@
1
- /** Rule metadata for `no-unsupported-features`: categorized as a validation rule. */
2
- declare const _default: {
3
- readonly category: "validation";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for `no-unsupported-features`: categorized as a validation rule. */
2
- export default {
3
- category: 'validation',
4
- };
@@ -1,18 +0,0 @@
1
- /** Configuration options for the `no-use-event-handler-attr` rule. */
2
- type Options = {
3
- /** Attribute name pattern(s) to exclude from the check. */
4
- ignore?: string | string[];
5
- };
6
- /**
7
- * Rule that disallows inline event handler attributes (e.g., `onclick`,
8
- * `onchange`).
9
- *
10
- * Reports any attribute on an HTML element whose name starts with `on`,
11
- * indicating an inline event handler. An `ignore` option allows specific
12
- * attribute names or patterns to be excluded from the check.
13
- *
14
- * The value can be `true` (disallow all event handlers) or a `string[]`
15
- * of event names (without the `on` prefix) to selectively disallow.
16
- */
17
- declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean | readonly string[], Options>>;
18
- export default _default;
@@ -1,5 +0,0 @@
1
- /** Rule metadata for `no-use-event-handler-attr`: categorized as a maintainability rule. */
2
- declare const _default: {
3
- readonly category: "maintainability";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for `no-use-event-handler-attr`: categorized as a maintainability rule. */
2
- export default {
3
- category: 'maintainability',
4
- };
@@ -1,5 +0,0 @@
1
- /** Rule metadata for the `redundant-accessible-name` rule, categorized as accessibility. */
2
- declare const _default: {
3
- readonly category: "a11y";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for the `redundant-accessible-name` rule, categorized as accessibility. */
2
- export default {
3
- category: 'a11y',
4
- };
@@ -1,5 +0,0 @@
1
- /** Rule metadata for the `required-attr` rule, categorized as validation. */
2
- declare const _default: {
3
- readonly category: "validation";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for the `required-attr` rule, categorized as validation. */
2
- export default {
3
- category: 'validation',
4
- };
@@ -1,5 +0,0 @@
1
- /** Rule metadata for the `required-element` rule, categorized as validation. */
2
- declare const _default: {
3
- readonly category: "validation";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for the `required-element` rule, categorized as validation. */
2
- export default {
3
- category: 'validation',
4
- };
@@ -1,18 +0,0 @@
1
- /**
2
- * Configuration options for the required-h1 rule.
3
- */
4
- export interface Options {
5
- /** Whether to report a violation when more than one `<h1>` element is found. */
6
- 'expected-once': boolean;
7
- /** Whether to apply this rule in document fragments (components, partials). */
8
- 'in-document-fragment': boolean;
9
- }
10
- /**
11
- * Rule that requires exactly one `<h1>` element in the document.
12
- *
13
- * Reports a violation when no `<h1>` is present. Optionally reports when
14
- * multiple `<h1>` elements exist (controlled by `expected-once`). Can be
15
- * configured to skip document fragments via the `in-document-fragment` option.
16
- */
17
- declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, Options>>;
18
- export default _default;
@@ -1,5 +0,0 @@
1
- /** Rule metadata for the `required-h1` rule, categorized as accessibility. */
2
- declare const _default: {
3
- readonly category: "a11y";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for the `required-h1` rule, categorized as accessibility. */
2
- export default {
3
- category: 'a11y',
4
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Rule that enforces WHATWG constraints between the `srcset`, `sizes`,
3
- * and `loading` attributes on `<img>` and `<source>` elements.
4
- */
5
- declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, undefined>>;
6
- export default _default;
@@ -1,108 +0,0 @@
1
- import { createRule } from '@markuplint/ml-core';
2
- import meta from './meta.js';
3
- import { hasSizesAuto, parseSrcset } from './parse-srcset.js';
4
- /**
5
- * Rule that enforces WHATWG constraints between the `srcset`, `sizes`,
6
- * and `loading` attributes on `<img>` and `<source>` elements.
7
- */
8
- export default createRule({
9
- meta: meta,
10
- async verify({ document, report }) {
11
- await document.walkOn('Element', el => {
12
- const localName = el.localName;
13
- // Only check img and source (inside picture) elements
14
- if (localName !== 'img' && localName !== 'source') {
15
- return;
16
- }
17
- // source is only relevant inside <picture>
18
- if (localName === 'source' && el.parentElement?.localName !== 'picture') {
19
- return;
20
- }
21
- // Skip if element has spread attributes (dynamic props)
22
- if (el.hasSpreadAttr) {
23
- return;
24
- }
25
- const srcsetAttr = el.getAttributeNode('srcset');
26
- if (!srcsetAttr) {
27
- return;
28
- }
29
- const srcsetIsDynamic = srcsetAttr.isDynamicValue;
30
- const sizesAttr = el.getAttributeNode('sizes');
31
- const sizesValue = sizesAttr?.value ?? null;
32
- const sizesIsDynamic = sizesAttr?.isDynamicValue;
33
- // Parse srcset unless dynamic
34
- const parsed = srcsetIsDynamic ? null : parseSrcset(srcsetAttr.value);
35
- // Check 2: width and density descriptors must not be mixed
36
- if (parsed && parsed.hasWidth && (parsed.hasDensity || parsed.hasImplied)) {
37
- report({
38
- scope: el,
39
- line: srcsetAttr.valueNode?.startLine,
40
- col: srcsetAttr.valueNode?.startCol,
41
- raw: srcsetAttr.valueNode?.raw,
42
- message: 'The "srcset" attribute must not mix width and pixel density descriptors',
43
- });
44
- }
45
- // Check 1: sizes present → srcset must use width descriptors
46
- if (sizesAttr && !sizesIsDynamic && parsed && !parsed.hasWidth) {
47
- report({
48
- scope: el,
49
- line: srcsetAttr.valueNode?.startLine,
50
- col: srcsetAttr.valueNode?.startCol,
51
- raw: srcsetAttr.valueNode?.raw,
52
- message: 'The "srcset" attribute requires width descriptors when the "sizes" attribute is present',
53
- });
54
- }
55
- // Check 3: img[sizes=auto] → loading=lazy required
56
- if (localName === 'img' && sizesValue != null && !sizesIsDynamic && hasSizesAuto(sizesValue)) {
57
- const loading = el.getAttribute('loading');
58
- if (loading !== 'lazy') {
59
- report({
60
- scope: el,
61
- line: sizesAttr.valueNode?.startLine,
62
- col: sizesAttr.valueNode?.startCol,
63
- raw: sizesAttr.valueNode?.raw,
64
- message: 'The "sizes" attribute with "auto" requires the "loading" attribute to be "lazy"',
65
- });
66
- }
67
- }
68
- // Check 4: source[sizes=auto] → following sibling img must have loading=lazy
69
- if (localName === 'source' && sizesValue != null && !sizesIsDynamic && hasSizesAuto(sizesValue)) {
70
- const img = findFollowingImg(el);
71
- if (!img || img.getAttribute('loading') !== 'lazy') {
72
- report({
73
- scope: el,
74
- line: sizesAttr.valueNode?.startLine,
75
- col: sizesAttr.valueNode?.startCol,
76
- raw: sizesAttr.valueNode?.raw,
77
- message: 'The "source" element with sizes="auto" requires the following sibling "img" element to have loading="lazy"',
78
- });
79
- }
80
- }
81
- // Check 5: img with w descriptors → sizes required
82
- if (localName === 'img' && parsed && parsed.hasWidth && !sizesAttr) {
83
- report({
84
- scope: el,
85
- message: 'The "sizes" attribute is required when the "srcset" attribute uses width descriptors',
86
- });
87
- }
88
- });
89
- },
90
- });
91
- /**
92
- * Find the first following sibling `<img>` element.
93
- * Per the spec, the img does not have to be the immediately next sibling.
94
- *
95
- * @param el - The starting element to search from
96
- * @returns The first following sibling `<img>` element, or `null` if none found
97
- */
98
- // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
99
- function findFollowingImg(el) {
100
- let sibling = el.nextElementSibling;
101
- while (sibling != null) {
102
- if (sibling.localName === 'img') {
103
- return sibling;
104
- }
105
- sibling = sibling.nextElementSibling;
106
- }
107
- return null;
108
- }
@@ -1,5 +0,0 @@
1
- /** Rule metadata for `srcset-sizes-constraint`: categorized as a validation rule. */
2
- declare const _default: {
3
- readonly category: "validation";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for `srcset-sizes-constraint`: categorized as a validation rule. */
2
- export default {
3
- category: 'validation',
4
- };
@@ -1,10 +0,0 @@
1
- /**
2
- * Rule that validates table row and column alignment.
3
- *
4
- * Builds a grid model of each `<table>` and checks that all rows have a
5
- * consistent number of columns, that `colspan`/`rowspan` attributes do not
6
- * cause cell overlap, and that `rowspan` values do not exceed the available
7
- * rows in their table section.
8
- */
9
- declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, undefined>>;
10
- export default _default;
@@ -1,97 +0,0 @@
1
- import { createRule } from '@markuplint/ml-core';
2
- import { findChildren } from './find-children.js';
3
- import { Grid, getIndexes, getOverflowRowSpan } from './grid.js';
4
- import meta from './meta.js';
5
- /**
6
- * Rule that validates table row and column alignment.
7
- *
8
- * Builds a grid model of each `<table>` and checks that all rows have a
9
- * consistent number of columns, that `colspan`/`rowspan` attributes do not
10
- * cause cell overlap, and that `rowspan` values do not exceed the available
11
- * rows in their table section.
12
- */
13
- export default createRule({
14
- meta,
15
- defaultSeverity: 'warning',
16
- verify({ document, report, t }) {
17
- const tables = document.querySelectorAll('table');
18
- for (const table of tables) {
19
- const grid = new Grid(table);
20
- const baseColLength = grid.getBaseColLength();
21
- // grid.log();
22
- if (grid.hasOverlapped()) {
23
- report({
24
- scope: table,
25
- message: t(
26
- //
27
- '{0} are causing {1}', t(['rowspan', 'colspan'], true), 'cell overlap'),
28
- });
29
- break;
30
- }
31
- for (const { section, elements } of grid.getSections()) {
32
- const overflow = getOverflowRowSpan(section, elements);
33
- if (overflow) {
34
- report({
35
- scope: overflow.rowSpan,
36
- message: t('Exceeds the number of available {0}', 'rows'),
37
- });
38
- }
39
- }
40
- const rows = grid.getAllRows();
41
- const rowElements = grid.getAllRowElements();
42
- for (const [rowNum, row] of rows.entries()) {
43
- const colLength = row.length;
44
- const rowEl = rowElements[rowNum];
45
- if (!rowEl) {
46
- continue;
47
- }
48
- // Skip validation for rows that have expected column count differences due to rowspan/colspan
49
- const cells = findChildren(rowEl, 'th, td');
50
- let actualCellCount = 0;
51
- for (const cell of cells) {
52
- const colspan = Number.parseInt(cell.getAttribute('colspan') ?? '1');
53
- actualCellCount += colspan;
54
- }
55
- // Check for rowspan cells occupying spaces in this row
56
- const rowspanOccupiedCount = row.filter(cell => cell === '↓').length;
57
- const expectedColumnCount = actualCellCount + rowspanOccupiedCount;
58
- // Skip validation if the structure is valid accounting for spans
59
- if (expectedColumnCount === baseColLength || actualCellCount + rowspanOccupiedCount === baseColLength) {
60
- continue;
61
- }
62
- // Debug log
63
- // console.log(`Row ${rowNum}: baseColLength=${baseColLength}, colLength=${colLength}, actualCellCount=${actualCellCount}, rowspanOccupiedCount=${rowspanOccupiedCount}, expectedColumnCount=${expectedColumnCount}`);
64
- const indexes = getIndexes(row);
65
- if (colLength > baseColLength) {
66
- const index = indexes.slice(baseColLength)[0];
67
- const cells = findChildren(rowEl, 'th, td');
68
- const unexpected = typeof index === 'number' ? cells[index] : null;
69
- if (!unexpected) {
70
- const spanStart = cells.findLast(cell => Number.parseInt(cell.getAttribute('colspan') ?? '1') > 1);
71
- const colSpan = spanStart?.getAttributeNode('colspan');
72
- if (!colSpan) {
73
- continue;
74
- }
75
- report({
76
- scope: colSpan,
77
- message: t('Exceeds the number of available {0}', 'columns'),
78
- });
79
- continue;
80
- }
81
- const diff = colLength - baseColLength;
82
- report({
83
- scope: unexpected,
84
- message: t('{0} extra {1} in {2}', t(`${diff}`), t(diff === 1 ? 'column' : 'columns'), t('a {0}', t('row'))),
85
- });
86
- }
87
- if (colLength < baseColLength && expectedColumnCount < baseColLength) {
88
- const diff = baseColLength - colLength;
89
- report({
90
- scope: rowEl,
91
- message: t('{0} missing {1} in {2}', t(`${diff}`), t(diff === 1 ? 'column' : 'columns'), t('a {0}', t('row'))),
92
- });
93
- }
94
- }
95
- }
96
- },
97
- });
@@ -1,5 +0,0 @@
1
- /** Rule metadata for the `table-row-column-alignment` rule, categorized as accessibility. */
2
- declare const _default: {
3
- readonly category: "a11y";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for the `table-row-column-alignment` rule, categorized as accessibility. */
2
- export default {
3
- category: 'a11y',
4
- };
@@ -1,5 +0,0 @@
1
- /** Rule metadata for the `use-list` rule, categorized as accessibility. */
2
- declare const _default: {
3
- readonly category: "a11y";
4
- };
5
- export default _default;
@@ -1,4 +0,0 @@
1
- /** Rule metadata for the `use-list` rule, categorized as accessibility. */
2
- export default {
3
- category: 'a11y',
4
- };
@@ -1,23 +0,0 @@
1
- import type { Options } from '../types.js';
2
- import type { AttrChecker } from '@markuplint/ml-core';
3
- import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
4
- /**
5
- * Checks whether an ARIA property or state is disallowed on the element's computed role.
6
- *
7
- * Each ARIA role defines a set of supported states and properties. This checker reports
8
- * usage of ARIA attributes that are not in that set. It also considers element-specific
9
- * restrictions from the ARIA in HTML specification (e.g., properties that should not
10
- * be used on certain native HTML elements, and naming prohibition for elements with
11
- * no implicit role such as `<cite>` or `<abbr>`).
12
- *
13
- * @param attr - The ARIA attribute node to inspect.
14
- * @param role - The computed ARIA role of the element.
15
- * @param propSpecs - The list of ARIA property specifications for type lookup.
16
- * @param disallowSetImplicitProps - Whether to also enforce element-specific restrictions.
17
- * @returns A violation if the property is not allowed on the given role or element.
18
- */
19
- export declare const checkingDisallowedProp: AttrChecker<boolean, Options, {
20
- role: ARIARole | null;
21
- propSpecs: readonly ARIAProperty[];
22
- disallowSetImplicitProps: boolean;
23
- }>;
@@ -1,84 +0,0 @@
1
- import { ARIA_RECOMMENDED_VERSION, getARIA } from '@markuplint/ml-spec';
2
- /**
3
- * ARIA naming attributes subject to the "naming prohibition" constraint
4
- * defined by ARIA in HTML.
5
- *
6
- * @see https://w3c.github.io/html-aria/#dfn-naming-prohibited
7
- */
8
- const NAMING_ATTRS = new Set(['aria-label', 'aria-labelledby', 'aria-braillelabel']);
9
- /**
10
- * Checks whether an ARIA property or state is disallowed on the element's computed role.
11
- *
12
- * Each ARIA role defines a set of supported states and properties. This checker reports
13
- * usage of ARIA attributes that are not in that set. It also considers element-specific
14
- * restrictions from the ARIA in HTML specification (e.g., properties that should not
15
- * be used on certain native HTML elements, and naming prohibition for elements with
16
- * no implicit role such as `<cite>` or `<abbr>`).
17
- *
18
- * @param attr - The ARIA attribute node to inspect.
19
- * @param role - The computed ARIA role of the element.
20
- * @param propSpecs - The list of ARIA property specifications for type lookup.
21
- * @param disallowSetImplicitProps - Whether to also enforce element-specific restrictions.
22
- * @returns A violation if the property is not allowed on the given role or element.
23
- */
24
- export const checkingDisallowedProp = ({ attr, role, propSpecs, disallowSetImplicitProps }) => t => {
25
- if (!/^aria-/i.test(attr.name)) {
26
- return;
27
- }
28
- const ariaVersion = attr.rule.options?.version ??
29
- attr.ownerMLDocument.ruleCommonSettings?.ariaVersion ??
30
- ARIA_RECOMMENDED_VERSION;
31
- const propSpec = propSpecs.find(p => p.name === attr.name);
32
- const elAriaSpec = getARIA(attr.ownerMLDocument.specs, attr.ownerElement.localName, attr.ownerElement.namespaceURI, ariaVersion, attr.ownerElement.matches.bind(attr.ownerElement));
33
- // Naming prohibition (ARIA in HTML): elements with namingProhibited=true
34
- // must not use aria-label / aria-labelledby / aria-braillelabel unless
35
- // an explicit role that supports naming is set. When `role` is null and
36
- // the element is namingProhibited, the naming attrs are prohibited.
37
- // At time of writing, the affected elements (implicitRole=false +
38
- // namingProhibited=true in html-spec) are:
39
- // abbr, cite, figcaption, kbd, label, legend, mark, rt, var
40
- // This list is not hard-coded here; it is derived from html-spec data.
41
- if (!role && NAMING_ATTRS.has(attr.name) && elAriaSpec?.namingProhibited === true) {
42
- return {
43
- scope: attr,
44
- message: t('{0:c} on {1}', t('{0} is {1:c}', t('the "{0*}" {1}', attr.name, `ARIA ${propSpec?.type ?? 'property'}`), 'prohibited'), t('the "{0*}" {1}', attr.ownerElement.localName, 'element')),
45
- };
46
- }
47
- if (!role) {
48
- return;
49
- }
50
- const statesAndProp = role.ownedProperties.find(p => p.name === attr.name);
51
- if (disallowSetImplicitProps && elAriaSpec?.properties !== false && elAriaSpec?.properties?.without) {
52
- for (const ignore of elAriaSpec.properties.without) {
53
- if (ignore.name === attr.name) {
54
- const hasNativeAttr = ignore.alt?.method === 'set-attr' && attr.ownerElement.hasAttribute(ignore.alt.target);
55
- return {
56
- scope: attr,
57
- message: t('{0:c} on {1}', t(ignore.type === 'must-not'
58
- ? '{0} must not {1}'
59
- : ignore.type === 'should-not'
60
- ? '{0} should not {1}'
61
- : '{0} is not recommended to {1}',
62
- // {0}
63
- t('the "{0*}" {1}', attr.name, `ARIA ${propSpec?.type ?? 'property'}`),
64
- // {1}
65
- 'use'), t('the "{0*}" {1}', attr.ownerElement.localName, 'element')) +
66
- (hasNativeAttr
67
- ? t('. ') +
68
- t('As its {0} is already provided by {1}', t('state'), t('the "{0*}" {1}', ignore.alt.target, 'attribute'))
69
- : ignore.alt
70
- ? t('. ') +
71
- t('{0} if you {1} {2}', t(ignore.alt.method === 'remove-attr' ? 'Remove {0}' : 'Add {0}', t('the "{0*}" {1}', ignore.alt.target, 'attribute')), 'use', t('the {0}', `ARIA ${propSpec?.type ?? 'property'}`))
72
- : ''),
73
- };
74
- }
75
- }
76
- }
77
- if (statesAndProp) {
78
- return;
79
- }
80
- return {
81
- scope: attr,
82
- message: t('{0:c} on {1}', t('{0} is {1:c}', t('the "{0*}" {1}', attr.name, `ARIA ${propSpec?.type ?? 'property'}`), 'disallowed'), t('the "{0*}" {1}', role.name, 'role')),
83
- };
84
- };
@@ -1,20 +0,0 @@
1
- import type { Options } from '../types.js';
2
- import type { AttrChecker } from '@markuplint/ml-core';
3
- import type { ARIAProperty, Attribute } from '@markuplint/ml-spec';
4
- /**
5
- * Checks whether an ARIA property duplicates or contradicts semantics already
6
- * provided by an equivalent native HTML attribute.
7
- *
8
- * Many ARIA properties have equivalent HTML attributes (e.g., `aria-required` and `required`).
9
- * This checker reports when an ARIA property is redundant because the native attribute
10
- * already conveys the same semantics, or when the ARIA value contradicts the native attribute.
11
- *
12
- * @param attr - The ARIA attribute node to inspect.
13
- * @param propSpecs - The list of ARIA property specifications for equivalence lookup.
14
- * @param attrSpecs - The HTML attribute specifications for the element.
15
- * @returns A violation if the ARIA property duplicates or contradicts an equivalent HTML attribute.
16
- */
17
- export declare const checkingImplicitProps: AttrChecker<boolean, Options, {
18
- propSpecs: readonly ARIAProperty[];
19
- attrSpecs: readonly Attribute[] | null;
20
- }>;