@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.
- package/CHANGELOG.md +98 -0
- package/CLAUDE.md +31 -2
- package/lib/{wai-aria-deprecated-role → aria-prop-requires-role}/index.d.ts +0 -1
- package/lib/{wai-aria-no-global-prop → aria-prop-requires-role}/index.js +0 -1
- package/lib/attr-check.d.ts +0 -48
- package/lib/attr-check.js +0 -36
- package/lib/attr-eligibility.d.ts +41 -0
- package/lib/attr-eligibility.js +60 -0
- package/lib/attr-value-quotes/index.d.ts +0 -7
- package/lib/attr-value-quotes/index.js +0 -7
- package/lib/attr-value-quotes/meta.d.ts +0 -1
- package/lib/attr-value-quotes/meta.js +0 -1
- package/lib/case-sensitive-attr-name/index.d.ts +0 -8
- package/lib/case-sensitive-attr-name/index.js +0 -8
- package/lib/case-sensitive-attr-name/meta.d.ts +0 -1
- package/lib/case-sensitive-attr-name/meta.js +0 -1
- package/lib/case-sensitive-tag-name/index.d.ts +0 -8
- package/lib/case-sensitive-tag-name/index.js +0 -8
- package/lib/case-sensitive-tag-name/meta.d.ts +0 -1
- package/lib/case-sensitive-tag-name/meta.js +0 -1
- package/lib/class-naming/index.d.ts +0 -8
- package/lib/class-naming/index.js +0 -8
- package/lib/class-naming/meta.d.ts +1 -2
- package/lib/class-naming/meta.js +1 -2
- package/lib/consistent-table-row-length/index.d.ts +14 -0
- package/lib/consistent-table-row-length/index.js +69 -0
- package/lib/consistent-table-row-length/meta.d.ts +4 -0
- package/lib/consistent-table-row-length/meta.js +3 -0
- package/lib/create-message.d.ts +2 -25
- package/lib/create-message.js +2 -53
- package/lib/debug.d.ts +1 -9
- package/lib/debug.js +1 -5
- package/lib/element-supports-aria-prop/index.d.ts +12 -0
- package/lib/element-supports-aria-prop/index.js +38 -0
- package/lib/form-attr-references-form/index.d.ts +12 -0
- package/lib/form-attr-references-form/index.js +64 -0
- package/lib/{correct-aspect-ratio → form-attr-references-form}/meta.d.ts +1 -1
- package/lib/form-attr-references-form/meta.js +3 -0
- package/lib/head-element-order/meta.d.ts +1 -1
- package/lib/head-element-order/meta.js +1 -1
- package/lib/helpers.d.ts +8 -138
- package/lib/helpers.js +24 -165
- package/lib/index.d.ts +135 -78
- package/lib/index.js +167 -82
- package/lib/input-list-references-datalist/index.d.ts +13 -0
- package/lib/input-list-references-datalist/index.js +46 -0
- package/lib/input-list-references-datalist/meta.d.ts +4 -0
- package/lib/input-list-references-datalist/meta.js +3 -0
- package/lib/itemprop-requires-itemscope/index.d.ts +21 -0
- package/lib/itemprop-requires-itemscope/index.js +53 -0
- package/lib/itemprop-requires-itemscope/meta.d.ts +4 -0
- package/lib/itemprop-requires-itemscope/meta.js +3 -0
- package/lib/label-for-references-labelable/index.d.ts +12 -0
- package/lib/label-for-references-labelable/index.js +68 -0
- package/lib/label-for-references-labelable/meta.d.ts +4 -0
- package/lib/label-for-references-labelable/meta.js +3 -0
- package/lib/label-has-control/index.d.ts +5 -5
- package/lib/label-has-control/index.js +5 -18
- package/lib/label-has-control/meta.d.ts +0 -1
- package/lib/label-has-control/meta.js +0 -1
- package/lib/label-no-multiple-controls/index.d.ts +31 -0
- package/lib/label-no-multiple-controls/index.js +104 -0
- package/lib/label-no-multiple-controls/meta.d.ts +4 -0
- package/lib/label-no-multiple-controls/meta.js +3 -0
- package/lib/landmark-roles/roles.d.ts +32 -0
- package/lib/landmark-roles/roles.js +73 -0
- package/lib/link-types/index.d.ts +0 -5
- package/lib/link-types/index.js +5 -6
- package/lib/link-types/meta.d.ts +1 -2
- package/lib/link-types/meta.js +1 -2
- package/lib/map-id-name-match/index.d.ts +10 -0
- package/lib/map-id-name-match/index.js +39 -0
- package/lib/map-id-name-match/meta.d.ts +4 -0
- package/lib/map-id-name-match/meta.js +3 -0
- package/lib/meta-charset-position/index.d.ts +15 -0
- package/lib/meta-charset-position/index.js +31 -0
- package/lib/meta-charset-position/meta.d.ts +4 -0
- package/lib/meta-charset-position/meta.js +3 -0
- package/lib/meter-value-bounds/index.d.ts +10 -0
- package/lib/meter-value-bounds/index.js +123 -0
- package/lib/meter-value-bounds/meta.d.ts +4 -0
- package/lib/meter-value-bounds/meta.js +3 -0
- package/lib/{wai-aria-required-props → no-abstract-role}/index.d.ts +0 -1
- package/lib/{wai-aria-abstract-role → no-abstract-role}/index.js +0 -1
- package/lib/no-always-matching-source/index.d.ts +13 -0
- package/lib/no-always-matching-source/index.js +100 -0
- package/lib/no-always-matching-source/meta.d.ts +4 -0
- package/lib/no-always-matching-source/meta.js +3 -0
- package/lib/no-ambiguous-navigable-target-names/index.d.ts +0 -8
- package/lib/no-ambiguous-navigable-target-names/index.js +0 -8
- package/lib/no-ambiguous-navigable-target-names/meta.d.ts +1 -2
- package/lib/no-ambiguous-navigable-target-names/meta.js +1 -2
- package/lib/{wai-aria-required-owned-elements → no-aria-on-presentational-children}/index.d.ts +0 -1
- package/lib/{wai-aria-presentational-children → no-aria-on-presentational-children}/index.js +0 -1
- package/lib/no-aria-on-unsupported-element/index.d.ts +11 -0
- package/lib/no-aria-on-unsupported-element/index.js +35 -0
- package/lib/no-aria-on-unsupported-element/meta.d.ts +9 -0
- package/lib/no-aria-on-unsupported-element/meta.js +8 -0
- package/lib/no-boolean-attr-value/index.d.ts +0 -7
- package/lib/no-boolean-attr-value/index.js +0 -7
- package/lib/no-boolean-attr-value/meta.d.ts +0 -1
- package/lib/no-boolean-attr-value/meta.js +0 -1
- package/lib/no-broken-fragment-link/index.d.ts +15 -0
- package/lib/no-broken-fragment-link/index.js +93 -0
- package/lib/no-broken-fragment-link/meta.d.ts +4 -0
- package/lib/no-broken-fragment-link/meta.js +3 -0
- package/lib/no-consecutive-br/index.d.ts +0 -8
- package/lib/no-consecutive-br/index.js +0 -8
- package/lib/no-consecutive-br/meta.d.ts +0 -1
- package/lib/no-consecutive-br/meta.js +0 -1
- package/lib/no-content-after-body/index.d.ts +25 -0
- package/lib/no-content-after-body/index.js +51 -0
- package/lib/no-content-after-body/meta.d.ts +4 -0
- package/lib/no-content-after-body/meta.js +3 -0
- package/lib/no-contradictory-aria-prop/index.d.ts +10 -0
- package/lib/no-contradictory-aria-prop/index.js +34 -0
- package/lib/{wai-aria-abstract-role → no-default-aria-value}/index.d.ts +0 -1
- package/lib/{wai-aria-default-value → no-default-aria-value}/index.js +0 -1
- package/lib/no-default-value/index.d.ts +0 -7
- package/lib/no-default-value/index.js +0 -7
- package/lib/no-default-value/meta.d.ts +0 -1
- package/lib/no-default-value/meta.js +0 -1
- package/lib/no-deprecated-aria-prop/index.d.ts +3 -0
- package/lib/{wai-aria-deprecated-props → no-deprecated-aria-prop}/index.js +0 -1
- package/lib/no-deprecated-attr/index.d.ts +2 -0
- package/lib/{deprecated-attr → no-deprecated-attr}/index.js +5 -9
- package/lib/no-deprecated-attr/meta.d.ts +4 -0
- package/lib/no-deprecated-attr/meta.js +3 -0
- package/lib/no-deprecated-element/index.d.ts +2 -0
- package/lib/no-deprecated-element/index.js +27 -0
- package/lib/no-deprecated-element/meta.d.ts +4 -0
- package/lib/no-deprecated-element/meta.js +3 -0
- package/lib/no-deprecated-role/index.d.ts +3 -0
- package/lib/{wai-aria-deprecated-role → no-deprecated-role}/index.js +0 -1
- package/lib/no-disallowed-ancestor/index.d.ts +2 -0
- package/lib/no-disallowed-ancestor/index.js +25 -0
- package/lib/no-disallowed-ancestor/meta.d.ts +4 -0
- package/lib/no-disallowed-ancestor/meta.js +3 -0
- package/lib/no-disallowed-attr/index.d.ts +28 -0
- package/lib/no-disallowed-attr/index.js +77 -0
- package/lib/no-disallowed-attr/meta.d.ts +4 -0
- package/lib/no-disallowed-attr/meta.js +3 -0
- package/lib/no-duplicate-attr/index.d.ts +2 -0
- package/lib/{attr-duplication → no-duplicate-attr}/index.js +0 -7
- package/lib/no-duplicate-attr/meta.d.ts +6 -0
- package/lib/no-duplicate-attr/meta.js +10 -0
- package/lib/no-duplicate-autofocus/index.d.ts +0 -5
- package/lib/no-duplicate-autofocus/index.js +20 -6
- package/lib/no-duplicate-autofocus/meta.d.ts +1 -1
- package/lib/no-duplicate-autofocus/meta.js +1 -1
- package/lib/no-duplicate-dt/index.d.ts +0 -6
- package/lib/no-duplicate-dt/index.js +1 -6
- package/lib/no-duplicate-dt/meta.d.ts +1 -2
- package/lib/no-duplicate-dt/meta.js +1 -2
- package/lib/no-duplicate-h1/index.d.ts +18 -0
- package/lib/no-duplicate-h1/index.js +41 -0
- package/lib/no-duplicate-h1/meta.d.ts +4 -0
- package/lib/no-duplicate-h1/meta.js +3 -0
- package/lib/no-duplicate-id/index.d.ts +2 -0
- package/lib/{id-duplication → no-duplicate-id}/index.js +0 -7
- package/lib/no-duplicate-id/meta.d.ts +4 -0
- package/lib/no-duplicate-id/meta.js +3 -0
- package/lib/no-duplicate-sibling-attr/index.d.ts +2 -0
- package/lib/no-duplicate-sibling-attr/index.js +35 -0
- package/lib/no-duplicate-sibling-attr/meta.d.ts +4 -0
- package/lib/no-duplicate-sibling-attr/meta.js +3 -0
- package/lib/no-duplicate-visible-main/index.d.ts +0 -1
- package/lib/no-duplicate-visible-main/index.js +0 -1
- package/lib/no-duplicate-visible-main/meta.d.ts +1 -1
- package/lib/no-duplicate-visible-main/meta.js +1 -1
- package/lib/no-empty-palpable-content/index.d.ts +0 -8
- package/lib/no-empty-palpable-content/index.js +0 -8
- package/lib/no-empty-palpable-content/meta.d.ts +1 -2
- package/lib/no-empty-palpable-content/meta.js +1 -2
- package/lib/no-empty-table-track/index.d.ts +12 -0
- package/lib/no-empty-table-track/index.js +42 -0
- package/lib/no-empty-table-track/meta.d.ts +4 -0
- package/lib/no-empty-table-track/meta.js +3 -0
- package/lib/no-event-handler-attr/index.d.ts +7 -0
- package/lib/{no-use-event-handler-attr → no-event-handler-attr}/index.js +0 -11
- package/lib/no-event-handler-attr/meta.d.ts +4 -0
- package/lib/no-event-handler-attr/meta.js +3 -0
- package/lib/no-experimental-features/index.d.ts +9 -0
- package/lib/no-experimental-features/index.js +53 -0
- package/lib/no-experimental-features/meta.d.ts +4 -0
- package/lib/no-experimental-features/meta.js +3 -0
- package/lib/no-extra-selected-options/index.d.ts +10 -0
- package/lib/no-extra-selected-options/index.js +37 -0
- package/lib/no-extra-selected-options/meta.d.ts +4 -0
- package/lib/no-extra-selected-options/meta.js +3 -0
- package/lib/no-focusable-in-aria-hidden/index.d.ts +3 -0
- package/lib/{wai-aria-interaction-in-hidden → no-focusable-in-aria-hidden}/index.js +0 -1
- package/lib/no-focusable-in-aria-hidden/meta.d.ts +4 -0
- package/lib/no-focusable-in-aria-hidden/meta.js +3 -0
- package/lib/no-hardcoded-id/index.d.ts +2 -0
- package/lib/{no-hard-code-id → no-hardcoded-id}/index.js +0 -8
- package/lib/no-hardcoded-id/meta.d.ts +4 -0
- package/lib/no-hardcoded-id/meta.js +3 -0
- package/lib/no-ineffective-attr/index.d.ts +2 -0
- package/lib/{ineffective-attr → no-ineffective-attr}/index.js +0 -7
- package/lib/no-ineffective-attr/meta.d.ts +5 -0
- package/lib/no-ineffective-attr/meta.js +4 -0
- package/lib/no-input-file-value/index.d.ts +10 -0
- package/lib/no-input-file-value/index.js +41 -0
- package/lib/no-input-file-value/meta.d.ts +4 -0
- package/lib/no-input-file-value/meta.js +3 -0
- package/lib/no-invalid-aria-prop-value/index.d.ts +3 -0
- package/lib/{wai-aria-value → no-invalid-aria-prop-value}/index.js +0 -1
- package/lib/no-invalid-aria-prop-value/meta.d.ts +4 -0
- package/lib/no-invalid-aria-prop-value/meta.js +3 -0
- package/lib/no-invalid-attr-value/index.d.ts +27 -0
- package/lib/no-invalid-attr-value/index.js +83 -0
- package/lib/no-invalid-attr-value/meta.d.ts +4 -0
- package/lib/no-invalid-attr-value/meta.js +3 -0
- package/lib/no-malformed-character-reference/index.d.ts +2 -0
- package/lib/no-malformed-character-reference/index.js +38 -0
- package/lib/no-malformed-character-reference/meta.d.ts +5 -0
- package/lib/no-malformed-character-reference/meta.js +20 -0
- package/lib/{correct-aspect-ratio → no-mismatched-aspect-ratio}/index.js +13 -3
- package/lib/no-mismatched-aspect-ratio/meta.d.ts +4 -0
- package/lib/no-mismatched-aspect-ratio/meta.js +3 -0
- package/lib/{correct-aspect-ratio → no-mismatched-aspect-ratio}/resolve-image-size.js +8 -2
- package/lib/no-mixed-srcset-descriptors/index.d.ts +12 -0
- package/lib/no-mixed-srcset-descriptors/index.js +47 -0
- package/lib/no-mixed-srcset-descriptors/meta.d.ts +4 -0
- package/lib/no-mixed-srcset-descriptors/meta.js +3 -0
- package/lib/no-nested-top-level-landmark/index.d.ts +10 -0
- package/lib/no-nested-top-level-landmark/index.js +52 -0
- package/lib/no-nested-top-level-landmark/meta.d.ts +4 -0
- package/lib/no-nested-top-level-landmark/meta.js +3 -0
- package/lib/no-nonstandard-features/index.d.ts +9 -0
- package/lib/no-nonstandard-features/index.js +53 -0
- package/lib/no-nonstandard-features/meta.d.ts +4 -0
- package/lib/no-nonstandard-features/meta.js +3 -0
- package/lib/no-obsolete-attr/index.d.ts +2 -0
- package/lib/no-obsolete-attr/index.js +27 -0
- package/lib/no-obsolete-attr/meta.d.ts +4 -0
- package/lib/no-obsolete-attr/meta.js +3 -0
- package/lib/no-obsolete-doctype/index.d.ts +2 -0
- package/lib/{doctype → no-obsolete-doctype}/index.js +9 -16
- package/lib/no-obsolete-doctype/meta.d.ts +4 -0
- package/lib/no-obsolete-doctype/meta.js +3 -0
- package/lib/no-obsolete-element/index.d.ts +2 -0
- package/lib/{deprecated-element → no-obsolete-element}/index.js +6 -10
- package/lib/no-obsolete-element/meta.d.ts +4 -0
- package/lib/no-obsolete-element/meta.js +3 -0
- package/lib/no-orphaned-end-tag/index.d.ts +0 -7
- package/lib/no-orphaned-end-tag/index.js +0 -7
- package/lib/no-orphaned-end-tag/meta.d.ts +2 -2
- package/lib/no-orphaned-end-tag/meta.js +5 -2
- package/lib/no-prohibited-naming/index.d.ts +8 -0
- package/lib/no-prohibited-naming/index.js +36 -0
- package/lib/no-prohibited-naming/meta.d.ts +4 -0
- package/lib/no-prohibited-naming/meta.js +3 -0
- package/lib/{use-list → no-pseudo-list}/index.d.ts +1 -8
- package/lib/{use-list → no-pseudo-list}/index.js +0 -7
- package/lib/no-pseudo-list/meta.d.ts +4 -0
- package/lib/no-pseudo-list/meta.js +3 -0
- package/lib/{redundant-accessible-name → no-redundant-accessible-name}/index.d.ts +0 -4
- package/lib/{redundant-accessible-name → no-redundant-accessible-name}/index.js +0 -4
- package/lib/no-redundant-accessible-name/meta.d.ts +4 -0
- package/lib/no-redundant-accessible-name/meta.js +3 -0
- package/lib/no-redundant-aria-prop/index.d.ts +10 -0
- package/lib/{wai-aria-implicit-props → no-redundant-aria-prop}/index.js +9 -3
- package/lib/no-redundant-aria-prop/meta.d.ts +4 -0
- package/lib/no-redundant-aria-prop/meta.js +3 -0
- package/lib/no-redundant-role/index.d.ts +3 -0
- package/lib/{wai-aria-implicit-role → no-redundant-role}/index.js +0 -1
- package/lib/no-redundant-role/meta.d.ts +4 -0
- package/lib/no-redundant-role/meta.js +3 -0
- package/lib/no-refer-to-non-existent-id/index.d.ts +0 -9
- package/lib/no-refer-to-non-existent-id/index.js +1 -62
- package/lib/no-refer-to-non-existent-id/meta.d.ts +1 -2
- package/lib/no-refer-to-non-existent-id/meta.js +1 -2
- package/lib/no-restricted-attr/index.d.ts +27 -0
- package/lib/no-restricted-attr/index.js +96 -0
- package/lib/no-restricted-attr/meta.d.ts +4 -0
- package/lib/no-restricted-attr/meta.js +3 -0
- package/lib/no-restricted-element/index.d.ts +2 -0
- package/lib/{disallowed-element → no-restricted-element}/index.js +7 -8
- package/lib/no-restricted-element/meta.d.ts +4 -0
- package/lib/no-restricted-element/meta.js +3 -0
- package/lib/no-skipped-heading-level/index.d.ts +13 -0
- package/lib/{heading-levels → no-skipped-heading-level}/index.js +10 -5
- package/lib/no-skipped-heading-level/meta.d.ts +4 -0
- package/lib/no-skipped-heading-level/meta.js +3 -0
- package/lib/no-stray-head-or-body-tag/index.d.ts +28 -0
- package/lib/no-stray-head-or-body-tag/index.js +61 -0
- package/lib/no-stray-head-or-body-tag/meta.d.ts +4 -0
- package/lib/no-stray-head-or-body-tag/meta.js +3 -0
- package/lib/no-table-cell-overlap/index.d.ts +12 -0
- package/lib/no-table-cell-overlap/index.js +30 -0
- package/lib/no-table-cell-overlap/meta.d.ts +4 -0
- package/lib/no-table-cell-overlap/meta.js +3 -0
- package/lib/no-table-span-overflow/index.d.ts +12 -0
- package/lib/no-table-span-overflow/index.js +37 -0
- package/lib/no-table-span-overflow/meta.d.ts +4 -0
- package/lib/no-table-span-overflow/meta.js +3 -0
- package/lib/no-unclosed-element-at-eof/index.d.ts +2 -0
- package/lib/no-unclosed-element-at-eof/index.js +86 -0
- package/lib/no-unclosed-element-at-eof/meta.d.ts +4 -0
- package/lib/no-unclosed-element-at-eof/meta.js +3 -0
- package/lib/no-unescaped-char/index.d.ts +14 -0
- package/lib/{character-reference → no-unescaped-char}/index.js +31 -20
- package/lib/no-unescaped-char/meta.d.ts +4 -0
- package/lib/no-unescaped-char/meta.js +3 -0
- package/lib/{invalid-attr → no-unknown-attr}/index.d.ts +4 -19
- package/lib/no-unknown-attr/index.js +91 -0
- package/lib/no-unknown-attr/meta.d.ts +4 -0
- package/lib/no-unknown-attr/meta.js +3 -0
- package/lib/no-unknown-role/index.d.ts +3 -0
- package/lib/{wai-aria-non-existent-role → no-unknown-role}/index.js +0 -1
- package/lib/no-unknown-role/meta.d.ts +4 -0
- package/lib/no-unknown-role/meta.js +3 -0
- package/lib/no-unpaired-srcset-sizes/index.d.ts +12 -0
- package/lib/no-unpaired-srcset-sizes/index.js +77 -0
- package/lib/no-unpaired-srcset-sizes/meta.d.ts +4 -0
- package/lib/no-unpaired-srcset-sizes/meta.js +3 -0
- package/lib/{no-unsupported-features → no-unsupported-browser-features}/index.d.ts +1 -10
- package/lib/no-unsupported-browser-features/index.js +81 -0
- package/lib/no-unsupported-browser-features/meta.d.ts +4 -0
- package/lib/no-unsupported-browser-features/meta.js +3 -0
- package/lib/permitted-contents/index.d.ts +0 -18
- package/lib/permitted-contents/index.js +0 -78
- package/lib/permitted-contents/meta.d.ts +1 -2
- package/lib/permitted-contents/meta.js +1 -2
- package/lib/permitted-contents/represent-transparent-nodes.js +15 -6
- package/lib/permitted-roles/index.d.ts +3 -0
- package/lib/{wai-aria-permitted-roles → permitted-roles}/index.js +0 -1
- package/lib/permitted-roles/meta.d.ts +4 -0
- package/lib/permitted-roles/meta.js +3 -0
- package/lib/placeholder-label-option/index.d.ts +10 -4
- package/lib/placeholder-label-option/index.js +30 -17
- package/lib/placeholder-label-option/meta.d.ts +1 -2
- package/lib/placeholder-label-option/meta.js +1 -2
- package/lib/progress-value-bounds/index.d.ts +10 -0
- package/lib/progress-value-bounds/index.js +59 -0
- package/lib/progress-value-bounds/meta.d.ts +4 -0
- package/lib/progress-value-bounds/meta.js +3 -0
- package/lib/require-accessible-name/index.d.ts +0 -7
- package/lib/require-accessible-name/index.js +0 -7
- package/lib/require-accessible-name/meta.d.ts +0 -1
- package/lib/require-accessible-name/meta.js +0 -1
- package/lib/require-adjacent-popover/index.d.ts +2 -0
- package/lib/{neighbor-popovers → require-adjacent-popover}/index.js +1 -8
- package/lib/require-adjacent-popover/meta.d.ts +4 -0
- package/lib/require-adjacent-popover/meta.js +3 -0
- package/lib/require-ancestor/index.d.ts +2 -0
- package/lib/require-ancestor/index.js +29 -0
- package/lib/require-ancestor/meta.d.ts +4 -0
- package/lib/require-ancestor/meta.js +3 -0
- package/lib/require-aria-prop/index.d.ts +3 -0
- package/lib/{wai-aria-required-props → require-aria-prop}/index.js +0 -1
- package/lib/require-aria-prop/meta.d.ts +4 -0
- package/lib/require-aria-prop/meta.js +3 -0
- package/lib/{required-attr → require-attr}/index.d.ts +2 -9
- package/lib/{required-attr → require-attr}/index.js +0 -7
- package/lib/require-attr/meta.d.ts +4 -0
- package/lib/require-attr/meta.js +3 -0
- package/lib/require-datetime/index.d.ts +0 -8
- package/lib/require-datetime/index.js +0 -8
- package/lib/require-datetime/meta.d.ts +1 -2
- package/lib/require-datetime/meta.js +1 -2
- package/lib/require-dialog-autofocus/index.d.ts +0 -10
- package/lib/require-dialog-autofocus/index.js +0 -10
- package/lib/require-dialog-autofocus/meta.d.ts +0 -1
- package/lib/require-dialog-autofocus/meta.js +0 -1
- package/lib/require-doctype/index.d.ts +2 -0
- package/lib/require-doctype/index.js +19 -0
- package/lib/require-doctype/meta.d.ts +5 -0
- package/lib/require-doctype/meta.js +10 -0
- package/lib/{required-element → require-element}/index.d.ts +1 -9
- package/lib/{required-element → require-element}/index.js +0 -8
- package/lib/require-element/meta.d.ts +4 -0
- package/lib/require-element/meta.js +3 -0
- package/lib/require-end-tag/index.d.ts +2 -0
- package/lib/{end-tag → require-end-tag}/index.js +0 -7
- package/lib/require-end-tag/meta.d.ts +4 -0
- package/lib/require-end-tag/meta.js +3 -0
- package/lib/require-h1/index.d.ts +17 -0
- package/lib/{required-h1 → require-h1}/index.js +6 -14
- package/lib/require-h1/meta.d.ts +4 -0
- package/lib/require-h1/meta.js +3 -0
- package/lib/require-landmark-label/index.d.ts +11 -0
- package/lib/require-landmark-label/index.js +55 -0
- package/lib/require-landmark-label/meta.d.ts +4 -0
- package/lib/require-landmark-label/meta.js +3 -0
- package/lib/require-owned-elements/index.d.ts +3 -0
- package/lib/{wai-aria-required-owned-elements → require-owned-elements}/index.js +0 -2
- package/lib/require-owned-elements/meta.d.ts +4 -0
- package/lib/require-owned-elements/meta.js +3 -0
- package/lib/require-parent-role/index.d.ts +3 -0
- package/lib/{wai-aria-required-parent-role → require-parent-role}/index.js +0 -1
- package/lib/require-parent-role/meta.d.ts +4 -0
- package/lib/require-parent-role/meta.js +3 -0
- package/lib/role-supports-aria-prop/index.d.ts +8 -0
- package/lib/{wai-aria-disallowed-props → role-supports-aria-prop}/index.js +11 -10
- package/lib/role-supports-aria-prop/meta.d.ts +4 -0
- package/lib/role-supports-aria-prop/meta.js +3 -0
- package/lib/rule-aliases.d.ts +2 -0
- package/lib/rule-aliases.js +325 -0
- package/lib/sizes-auto-requires-lazy-loading/index.d.ts +14 -0
- package/lib/sizes-auto-requires-lazy-loading/index.js +68 -0
- package/lib/sizes-auto-requires-lazy-loading/meta.d.ts +4 -0
- package/lib/sizes-auto-requires-lazy-loading/meta.js +3 -0
- package/lib/srcset-sizes-constraint/parse-srcset.d.ts +6 -0
- package/lib/srcset-sizes-constraint/parse-srcset.js +6 -0
- package/lib/srcset-sizes-constraint/sibling-helpers.d.ts +21 -0
- package/lib/srcset-sizes-constraint/sibling-helpers.js +37 -0
- package/lib/tab-requires-tabpanel/index.d.ts +3 -0
- package/lib/tab-requires-tabpanel/index.js +21 -0
- package/lib/tab-requires-tabpanel/meta.d.ts +4 -0
- package/lib/tab-requires-tabpanel/meta.js +3 -0
- package/lib/table-row-column-alignment/grid.d.ts +108 -52
- package/lib/table-row-column-alignment/grid.js +276 -203
- package/lib/table-row-column-alignment/types.d.ts +6 -8
- package/lib/usemap-references-map/index.d.ts +14 -0
- package/lib/usemap-references-map/index.js +46 -0
- package/lib/usemap-references-map/meta.d.ts +4 -0
- package/lib/usemap-references-map/meta.js +3 -0
- package/lib/valid-importmap/index.d.ts +2 -0
- package/lib/valid-importmap/index.js +176 -0
- package/lib/valid-importmap/meta.d.ts +4 -0
- package/lib/valid-importmap/meta.js +3 -0
- package/lib/valid-speculation-rules/index.d.ts +2 -0
- package/lib/valid-speculation-rules/index.js +292 -0
- package/lib/valid-speculation-rules/meta.d.ts +4 -0
- package/lib/valid-speculation-rules/meta.js +3 -0
- package/lib/wai-aria/checkings/contradictory-aria-prop.d.ts +23 -0
- package/lib/wai-aria/checkings/{implicit-props.js → contradictory-aria-prop.js} +22 -14
- package/lib/wai-aria/checkings/element-supports-aria-prop.d.ts +20 -0
- package/lib/wai-aria/checkings/element-supports-aria-prop.js +83 -0
- package/lib/wai-aria/checkings/prohibited-naming.d.ts +35 -0
- package/lib/wai-aria/checkings/prohibited-naming.js +64 -0
- package/lib/wai-aria/checkings/redundant-aria-prop.d.ts +23 -0
- package/lib/wai-aria/checkings/redundant-aria-prop.js +53 -0
- package/lib/wai-aria/checkings/required-prop.d.ts +4 -0
- package/lib/wai-aria/checkings/required-prop.js +16 -3
- package/lib/wai-aria/checkings/role-supports-aria-prop.d.ts +20 -0
- package/lib/wai-aria/checkings/role-supports-aria-prop.js +30 -0
- package/lib/wai-aria/checkings/tab-requires-tabpanel.d.ts +19 -0
- package/lib/wai-aria/checkings/tab-requires-tabpanel.js +56 -0
- package/lib/wai-aria/default-options.js +1 -0
- package/lib/wai-aria/types.d.ts +2 -0
- package/package.json +11 -10
- package/schema.json +275 -59
- package/SKILL.md +0 -77
- package/lib/attr-duplication/index.d.ts +0 -9
- package/lib/attr-duplication/meta.d.ts +0 -6
- package/lib/attr-duplication/meta.js +0 -5
- package/lib/character-reference/index.d.ts +0 -12
- package/lib/character-reference/meta.d.ts +0 -5
- package/lib/character-reference/meta.js +0 -4
- package/lib/correct-aspect-ratio/meta.js +0 -3
- package/lib/deprecated-attr/index.d.ts +0 -8
- package/lib/deprecated-attr/meta.d.ts +0 -5
- package/lib/deprecated-attr/meta.js +0 -4
- package/lib/deprecated-element/index.d.ts +0 -8
- package/lib/deprecated-element/meta.d.ts +0 -5
- package/lib/deprecated-element/meta.js +0 -4
- package/lib/disallowed-element/index.d.ts +0 -9
- package/lib/disallowed-element/meta.d.ts +0 -5
- package/lib/disallowed-element/meta.js +0 -4
- package/lib/doctype/index.d.ts +0 -15
- package/lib/doctype/meta.d.ts +0 -5
- package/lib/doctype/meta.js +0 -4
- package/lib/end-tag/index.d.ts +0 -9
- package/lib/end-tag/meta.d.ts +0 -5
- package/lib/end-tag/meta.js +0 -4
- package/lib/heading-levels/index.d.ts +0 -8
- package/lib/heading-levels/meta.d.ts +0 -5
- package/lib/heading-levels/meta.js +0 -4
- package/lib/id-duplication/index.d.ts +0 -9
- package/lib/id-duplication/meta.d.ts +0 -5
- package/lib/id-duplication/meta.js +0 -4
- package/lib/ineffective-attr/index.d.ts +0 -9
- package/lib/ineffective-attr/meta.d.ts +0 -6
- package/lib/ineffective-attr/meta.js +0 -5
- package/lib/invalid-attr/index.js +0 -207
- package/lib/invalid-attr/meta.d.ts +0 -5
- package/lib/invalid-attr/meta.js +0 -4
- package/lib/landmark-roles/index.d.ts +0 -22
- package/lib/landmark-roles/index.js +0 -142
- package/lib/landmark-roles/meta.d.ts +0 -5
- package/lib/landmark-roles/meta.js +0 -4
- package/lib/neighbor-popovers/index.d.ts +0 -10
- package/lib/neighbor-popovers/meta.d.ts +0 -5
- package/lib/neighbor-popovers/meta.js +0 -4
- package/lib/no-hard-code-id/index.d.ts +0 -10
- package/lib/no-hard-code-id/meta.d.ts +0 -5
- package/lib/no-hard-code-id/meta.js +0 -4
- package/lib/no-unsupported-features/index.js +0 -139
- package/lib/no-unsupported-features/meta.d.ts +0 -5
- package/lib/no-unsupported-features/meta.js +0 -4
- package/lib/no-use-event-handler-attr/index.d.ts +0 -18
- package/lib/no-use-event-handler-attr/meta.d.ts +0 -5
- package/lib/no-use-event-handler-attr/meta.js +0 -4
- package/lib/redundant-accessible-name/meta.d.ts +0 -5
- package/lib/redundant-accessible-name/meta.js +0 -4
- package/lib/required-attr/meta.d.ts +0 -5
- package/lib/required-attr/meta.js +0 -4
- package/lib/required-element/meta.d.ts +0 -5
- package/lib/required-element/meta.js +0 -4
- package/lib/required-h1/index.d.ts +0 -18
- package/lib/required-h1/meta.d.ts +0 -5
- package/lib/required-h1/meta.js +0 -4
- package/lib/srcset-sizes-constraint/index.d.ts +0 -6
- package/lib/srcset-sizes-constraint/index.js +0 -108
- package/lib/srcset-sizes-constraint/meta.d.ts +0 -5
- package/lib/srcset-sizes-constraint/meta.js +0 -4
- package/lib/table-row-column-alignment/index.d.ts +0 -10
- package/lib/table-row-column-alignment/index.js +0 -97
- package/lib/table-row-column-alignment/meta.d.ts +0 -5
- package/lib/table-row-column-alignment/meta.js +0 -4
- package/lib/use-list/meta.d.ts +0 -5
- package/lib/use-list/meta.js +0 -4
- package/lib/wai-aria/checkings/disallowed-prop.d.ts +0 -23
- package/lib/wai-aria/checkings/disallowed-prop.js +0 -84
- package/lib/wai-aria/checkings/implicit-props.d.ts +0 -20
- package/lib/wai-aria/index.d.ts +0 -13
- package/lib/wai-aria/index.js +0 -115
- package/lib/wai-aria/meta.d.ts +0 -5
- package/lib/wai-aria/meta.js +0 -4
- package/lib/wai-aria-default-value/index.d.ts +0 -4
- package/lib/wai-aria-default-value/meta.d.ts +0 -5
- package/lib/wai-aria-default-value/meta.js +0 -4
- package/lib/wai-aria-deprecated-props/index.d.ts +0 -4
- package/lib/wai-aria-deprecated-props/meta.d.ts +0 -5
- package/lib/wai-aria-deprecated-props/meta.js +0 -4
- package/lib/wai-aria-disallowed-props/index.d.ts +0 -4
- package/lib/wai-aria-disallowed-props/meta.d.ts +0 -5
- package/lib/wai-aria-disallowed-props/meta.js +0 -4
- package/lib/wai-aria-implicit-props/index.d.ts +0 -4
- package/lib/wai-aria-implicit-props/meta.d.ts +0 -5
- package/lib/wai-aria-implicit-props/meta.js +0 -4
- package/lib/wai-aria-implicit-role/index.d.ts +0 -4
- package/lib/wai-aria-interaction-in-hidden/index.d.ts +0 -4
- package/lib/wai-aria-interaction-in-hidden/meta.d.ts +0 -5
- package/lib/wai-aria-interaction-in-hidden/meta.js +0 -4
- package/lib/wai-aria-no-global-prop/index.d.ts +0 -4
- package/lib/wai-aria-no-global-prop/meta.d.ts +0 -5
- package/lib/wai-aria-no-global-prop/meta.js +0 -4
- package/lib/wai-aria-non-existent-role/index.d.ts +0 -4
- package/lib/wai-aria-permitted-roles/index.d.ts +0 -4
- package/lib/wai-aria-presentational-children/index.d.ts +0 -4
- package/lib/wai-aria-presentational-children/meta.d.ts +0 -5
- package/lib/wai-aria-presentational-children/meta.js +0 -4
- package/lib/wai-aria-required-parent-role/index.d.ts +0 -4
- package/lib/wai-aria-value/index.d.ts +0 -4
- package/lib/wai-aria-value/meta.d.ts +0 -5
- package/lib/wai-aria-value/meta.js +0 -4
- /package/lib/{wai-aria-abstract-role → aria-prop-requires-role}/meta.d.ts +0 -0
- /package/lib/{wai-aria-abstract-role → aria-prop-requires-role}/meta.js +0 -0
- /package/lib/{wai-aria-deprecated-role → element-supports-aria-prop}/meta.d.ts +0 -0
- /package/lib/{wai-aria-deprecated-role → element-supports-aria-prop}/meta.js +0 -0
- /package/lib/{wai-aria-implicit-role → no-abstract-role}/meta.d.ts +0 -0
- /package/lib/{wai-aria-implicit-role → no-abstract-role}/meta.js +0 -0
- /package/lib/{wai-aria-non-existent-role → no-aria-on-presentational-children}/meta.d.ts +0 -0
- /package/lib/{wai-aria-non-existent-role → no-aria-on-presentational-children}/meta.js +0 -0
- /package/lib/{wai-aria-permitted-roles → no-contradictory-aria-prop}/meta.d.ts +0 -0
- /package/lib/{wai-aria-permitted-roles → no-contradictory-aria-prop}/meta.js +0 -0
- /package/lib/{wai-aria-required-owned-elements → no-default-aria-value}/meta.d.ts +0 -0
- /package/lib/{wai-aria-required-owned-elements → no-default-aria-value}/meta.js +0 -0
- /package/lib/{wai-aria-required-parent-role → no-deprecated-aria-prop}/meta.d.ts +0 -0
- /package/lib/{wai-aria-required-parent-role → no-deprecated-aria-prop}/meta.js +0 -0
- /package/lib/{wai-aria-required-props → no-deprecated-role}/meta.d.ts +0 -0
- /package/lib/{wai-aria-required-props → no-deprecated-role}/meta.js +0 -0
- /package/lib/{correct-aspect-ratio → no-mismatched-aspect-ratio}/index.d.ts +0 -0
- /package/lib/{correct-aspect-ratio → no-mismatched-aspect-ratio}/resolve-image-size.d.ts +0 -0
- /package/lib/{no-unsupported-features → no-unsupported-browser-features}/compat-data.d.ts +0 -0
- /package/lib/{no-unsupported-features → no-unsupported-browser-features}/compat-data.js +0 -0
- /package/lib/{no-unsupported-features → no-unsupported-browser-features}/resolve-browsers.d.ts +0 -0
- /package/lib/{no-unsupported-features → no-unsupported-browser-features}/resolve-browsers.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,104 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.0.0-rc.5](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.4...v5.0.0-rc.5) (2026-08-28)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **html-spec:** div in dl allows exactly one dt+dd group per HTML LS ([6f344bb](https://github.com/markuplint/markuplint/commit/6f344bbc72bc82dbe2d1ebf05600a5fce9838de1))
|
|
11
|
+
- **html-spec:** forbid aria-expanded / aria-pressed on summary in details ([#3927](https://github.com/markuplint/markuplint/issues/3927)) ([92efa50](https://github.com/markuplint/markuplint/commit/92efa500ff6033d0bb82f816cbc27090afb5dbfe))
|
|
12
|
+
- **rules:** apply always-matching check to srcset-less sources ([2b6960d](https://github.com/markuplint/markuplint/commit/2b6960d59f6be3b35cc44466d549813c9c14f2c3))
|
|
13
|
+
- **rules:** apply deprecated-element and no-unsupported-features to pretendered components ([9becedd](https://github.com/markuplint/markuplint/commit/9becedd2e6403721fe57cc4624673d46343b811b)), closes [#3740](https://github.com/markuplint/markuplint/issues/3740)
|
|
14
|
+
- **rules:** flag placeholder-label-option on empty required select ([#3936](https://github.com/markuplint/markuplint/issues/3936)) ([8a80802](https://github.com/markuplint/markuplint/commit/8a80802fb27010f4cba5a604857ee85608398caa))
|
|
15
|
+
- **rules:** heading-levels must only fire when preceded by another heading ([34d380c](https://github.com/markuplint/markuplint/commit/34d380c4ada1315a389a18357feabb93daab2c93))
|
|
16
|
+
- **rules:** keep transparent element itself in parent content-model check ([#3960](https://github.com/markuplint/markuplint/issues/3960)) ([88c0412](https://github.com/markuplint/markuplint/commit/88c04125a0a582436d865c7463c3d52b528e529e)), closes [#3928](https://github.com/markuplint/markuplint/issues/3928) [#3928](https://github.com/markuplint/markuplint/issues/3928) [#3928](https://github.com/markuplint/markuplint/issues/3928) [#3838](https://github.com/markuplint/markuplint/issues/3838)
|
|
17
|
+
- **rules:** log when the permitted-contents transparent pattern cap is exceeded ([3d26ed4](https://github.com/markuplint/markuplint/commit/3d26ed4018a6a219fe0f69864d2d1e39cd3130c7)), closes [#3895](https://github.com/markuplint/markuplint/issues/3895)
|
|
18
|
+
- **rules:** only require aria-valuenow on focusable separators ([fe97162](https://github.com/markuplint/markuplint/commit/fe971625962a25540a1cd0aff790fd882541da30)), closes [#3682](https://github.com/markuplint/markuplint/issues/3682)
|
|
19
|
+
- **rules:** preserve [invalid-attr-valid-007] structure and mark breaking change inline ([de27044](https://github.com/markuplint/markuplint/commit/de27044fd64526ddcdf345795dca17ebb8456cf1))
|
|
20
|
+
- **rules:** quote input-button-non-empty-value description in YAML frontmatter ([d289824](https://github.com/markuplint/markuplint/commit/d289824ed6b394d4a130de3f6ac819e568b06761))
|
|
21
|
+
- **rules:** rename test fixture id "myform" to "form1" for cspell ([a9a1194](https://github.com/markuplint/markuplint/commit/a9a11943809e434d81a724aad516f18e29df794b))
|
|
22
|
+
- **rules:** replace "unparseable" with "unparsable" for cspell ([fb63696](https://github.com/markuplint/markuplint/commit/fb6369612fcdae0f4f12a3581e467fe92faaad96))
|
|
23
|
+
- **rules:** script-content guards Tier 1 errors and covers scopes specifier-map branches ([7004652](https://github.com/markuplint/markuplint/commit/700465223ad504b7b014d0314fe6a1c456ad20f7))
|
|
24
|
+
- **rules:** skip condition-disallow when a referenced attr value is dynamic ([f04557d](https://github.com/markuplint/markuplint/commit/f04557d2f5526ad0b47a3ffc2691ccba9a67fa49))
|
|
25
|
+
- **rules:** srcset-sizes-constraint now covers source-in-picture for w-without-sizes ([fb442a6](https://github.com/markuplint/markuplint/commit/fb442a6c3a9e2d4e20f1adcad1723621fbaa3c2c))
|
|
26
|
+
- **rules:** strip only ASCII whitespace in always-matching media check ([e309e97](https://github.com/markuplint/markuplint/commit/e309e97bc4ba0bb2cf66b2c07a17c826b544482c))
|
|
27
|
+
- **rules:** surface disallowed-element reason via reasonOnly (close [#3815](https://github.com/markuplint/markuplint/issues/3815)) ([#3986](https://github.com/markuplint/markuplint/issues/3986)) ([0142cec](https://github.com/markuplint/markuplint/commit/0142cec667f70fee086f2a6e06d7a26e66bda380))
|
|
28
|
+
- **rules:** tighten new conformance rules from QA review ([3096626](https://github.com/markuplint/markuplint/commit/3096626bcf34c1897c8fb77cc0ff6a4f3d4c9fb4))
|
|
29
|
+
- **rules:** wrap attr-bearing tags in description so MDX accepts them ([1ad1225](https://github.com/markuplint/markuplint/commit/1ad12256f67246d6ec18d5b97078ef1e2a85fd85))
|
|
30
|
+
- **types): strict charset=utf-8; feat(rules:** usemap-references-map ([#3969](https://github.com/markuplint/markuplint/issues/3969)) ([c63070e](https://github.com/markuplint/markuplint/commit/c63070e29ccb283da7468b2fc67db372ebfcf42a)), closes [#3945](https://github.com/markuplint/markuplint/issues/3945) [#3966](https://github.com/markuplint/markuplint/issues/3966) [#3966](https://github.com/markuplint/markuplint/issues/3966) [#3928](https://github.com/markuplint/markuplint/issues/3928)
|
|
31
|
+
|
|
32
|
+
### Code Refactoring
|
|
33
|
+
|
|
34
|
+
- **rules:** redesign v5 rule system — naming, splits, specConformance ([#3989](https://github.com/markuplint/markuplint/issues/3989)) ([e925565](https://github.com/markuplint/markuplint/commit/e925565ce537848d7d1573369723cbce724a841b)), closes [#4](https://github.com/markuplint/markuplint/issues/4) [#aside-conditional-role-mapping-aria-13](https://github.com/markuplint/markuplint/issues/aside-conditional-role-mapping-aria-13)
|
|
35
|
+
|
|
36
|
+
- feat(rules)!: enforce ARIA naming prohibition on autonomous custom elements ([7e01a4b](https://github.com/markuplint/markuplint/commit/7e01a4b691df643255ad5b1e6542688198b01a01))
|
|
37
|
+
- fix(rules)!: scope invalid-attr virtual rules to narrow checks (#3803) ([77acb1d](https://github.com/markuplint/markuplint/commit/77acb1d1ac7cadd35203fa209ca016f802775b59)), closes [#3803](https://github.com/markuplint/markuplint/issues/3803)
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
- **config-presets:** forbid <base> after <link> or <script> in <head> ([#3925](https://github.com/markuplint/markuplint/issues/3925)) ([ceb892d](https://github.com/markuplint/markuplint/commit/ceb892d64772d459a6bd9564684218e3afbdec2e))
|
|
42
|
+
- **html-spec:** enforce X-UA-Compatible content="IE=edge" ([#3929](https://github.com/markuplint/markuplint/issues/3929)) ([2638fba](https://github.com/markuplint/markuplint/commit/2638fba826a489ad745ee30c4b8ed195b2362403)), closes [#3928](https://github.com/markuplint/markuplint/issues/3928) [#3928](https://github.com/markuplint/markuplint/issues/3928) [#3734](https://github.com/markuplint/markuplint/issues/3734)
|
|
43
|
+
- **rules:** add form-attr-references-form rule ([6b541f0](https://github.com/markuplint/markuplint/commit/6b541f032b76c3712c99ea35596b6b0aa79b6137))
|
|
44
|
+
- **rules:** add input-button-non-empty-value rule ([2cc73dd](https://github.com/markuplint/markuplint/commit/2cc73ddd0f874fae9faf005f498d73fa364b682c))
|
|
45
|
+
- **rules:** add input-file-empty-value rule ([228cbd7](https://github.com/markuplint/markuplint/commit/228cbd752956d3df8f525e4f19f9278a44d87160))
|
|
46
|
+
- **rules:** add input-list-references-datalist rule ([#3931](https://github.com/markuplint/markuplint/issues/3931)) ([bf4ef54](https://github.com/markuplint/markuplint/commit/bf4ef54a1b2937ecbe05fbe5121ddfe199781a95))
|
|
47
|
+
- **rules:** add itemprop-requires-itemscope rule ([2b4cba4](https://github.com/markuplint/markuplint/commit/2b4cba4a3afe205f1b4c96744e8d5115ea3bc0ee)), closes [#3852](https://github.com/markuplint/markuplint/issues/3852)
|
|
48
|
+
- **rules:** add label-for-references-labelable rule ([#3932](https://github.com/markuplint/markuplint/issues/3932)) ([3713e6b](https://github.com/markuplint/markuplint/commit/3713e6b435a76fe03a941a36a5e33c0ab06c9a80)), closes [#3918](https://github.com/markuplint/markuplint/issues/3918)
|
|
49
|
+
- **rules:** add label-no-multiple-controls rule ([5da3f85](https://github.com/markuplint/markuplint/commit/5da3f8523dd6ffd9f44ea73d9012952aad85d821))
|
|
50
|
+
- **rules:** add map-id-name-match rule ([1472daf](https://github.com/markuplint/markuplint/commit/1472daf62470bf56c4cb326ab47dc43ba87a8cb3))
|
|
51
|
+
- **rules:** add meter-value-bounds rule ([82cb9a0](https://github.com/markuplint/markuplint/commit/82cb9a01edaf574f5b3b1e8e8ce531d0fab21f1c))
|
|
52
|
+
- **rules:** add no-extra-selected-options rule ([3ea75ac](https://github.com/markuplint/markuplint/commit/3ea75ac0b6850c36d5419924b18c1002dfb864a9))
|
|
53
|
+
- **rules:** add progress-value-bounds rule ([#3926](https://github.com/markuplint/markuplint/issues/3926)) ([1e259ec](https://github.com/markuplint/markuplint/commit/1e259ec9929ceb3c7ac5864ce2807420646e9602))
|
|
54
|
+
- **rules:** add script-content rule for `<script type=importmap>` JSON validation ([c635970](https://github.com/markuplint/markuplint/commit/c6359707af6b37abb0bca130e880cb1e9b5b9005))
|
|
55
|
+
- **rules:** add wai-aria-tab-requires-tabpanel rule ([#3955](https://github.com/markuplint/markuplint/issues/3955)) ([eac9abe](https://github.com/markuplint/markuplint/commit/eac9abef20ef304c3da2114849686b9cf0733942))
|
|
56
|
+
- **rules:** character-reference consumes parse5 malformed-reference codes via parseErrors hook ([a33bb4e](https://github.com/markuplint/markuplint/commit/a33bb4e6674c23ae06b6a12d45ace1c2e954b3be)), closes [#3844](https://github.com/markuplint/markuplint/issues/3844)
|
|
57
|
+
- **rules:** declare mirrorsParseErrorCodes on attr-duplication / doctype / no-orphaned-end-tag ([06893f0](https://github.com/markuplint/markuplint/commit/06893f07584be548c9719153cfae288bd2fdf83e)), closes [#3844](https://github.com/markuplint/markuplint/issues/3844)
|
|
58
|
+
- **rules:** detect always-matching source in srcset-sizes-constraint ([a11199c](https://github.com/markuplint/markuplint/commit/a11199cb13011a775630788a80820ade189b21bd))
|
|
59
|
+
- **rules:** disallow aria-\* on elements where html-spec says properties: false ([1850ee3](https://github.com/markuplint/markuplint/commit/1850ee3a854d25fd5291d4c2a555b8be3f99f245)), closes [#3735](https://github.com/markuplint/markuplint/issues/3735) [#3735](https://github.com/markuplint/markuplint/issues/3735)
|
|
60
|
+
- **rules:** extend label-no-multiple-controls for external labeled control ([#3933](https://github.com/markuplint/markuplint/issues/3933)) ([392f051](https://github.com/markuplint/markuplint/commit/392f051c0d7ee8be8f3dc12afae6a902c6c8ea2b))
|
|
61
|
+
- **rules:** report HTML LS table model errors in table-row-column-alignment ([#3953](https://github.com/markuplint/markuplint/issues/3953)) ([bacdcd6](https://github.com/markuplint/markuplint/commit/bacdcd697f76300153388f5b1cabaa8504f08d1f)), closes [#3916](https://github.com/markuplint/markuplint/issues/3916) [#3915](https://github.com/markuplint/markuplint/issues/3915) [#3916](https://github.com/markuplint/markuplint/issues/3916) [#3915](https://github.com/markuplint/markuplint/issues/3915)
|
|
62
|
+
- **rules:** script-content validates the integrity top-level key ([cc1a050](https://github.com/markuplint/markuplint/commit/cc1a0504ab0664c96ae326e6c5580d4fe04fed58))
|
|
63
|
+
- **rules:** surface parse5-silent HTML LS parse errors (close nu-only umbrella [#3943](https://github.com/markuplint/markuplint/issues/3943)) ([#3980](https://github.com/markuplint/markuplint/issues/3980)) ([89951fa](https://github.com/markuplint/markuplint/commit/89951fa274007d56370510cb0cf11aead808ce13))
|
|
64
|
+
- **rules:** validate `<script type="speculationrules">` content ([d000a84](https://github.com/markuplint/markuplint/commit/d000a84badfc359c11258f8d46230c44a254cc05)), closes [#3882](https://github.com/markuplint/markuplint/issues/3882)
|
|
65
|
+
- **types:** enforce element-context autocomplete constraints (select webauthn, input[type=hidden] on/off) ([#3930](https://github.com/markuplint/markuplint/issues/3930)) ([dc51d46](https://github.com/markuplint/markuplint/commit/dc51d460731541c963c9aa8bdf407c20974dced4))
|
|
66
|
+
- **types:** reject general-enclosed matches in MediaQueryList and SourceSizeList ([#3934](https://github.com/markuplint/markuplint/issues/3934)) ([2fc8615](https://github.com/markuplint/markuplint/commit/2fc8615c475540d4e5b85661baa1491d791cb661))
|
|
67
|
+
- **types:** validate CSP3 grammar for meta[content][http-equiv=content-security-policy] ([#3982](https://github.com/markuplint/markuplint/issues/3982)) ([b2d1d84](https://github.com/markuplint/markuplint/commit/b2d1d84ea92c754fe2dbf54950ae8fdb74fe51eb)), closes [#3942](https://github.com/markuplint/markuplint/issues/3942) [#3942](https://github.com/markuplint/markuplint/issues/3942) [#3942](https://github.com/markuplint/markuplint/issues/3942) [#3946](https://github.com/markuplint/markuplint/issues/3946)
|
|
68
|
+
|
|
69
|
+
### BREAKING CHANGES
|
|
70
|
+
|
|
71
|
+
- **rules:** with no alias coverage.
|
|
72
|
+
- **rules:** is visible in the test source, not only in git history.
|
|
73
|
+
|
|
74
|
+
Also drop the duplicate `//user:pass@sample.com/path/to` case from
|
|
75
|
+
[invalid-attr-invalid-044]; valid-007 now carries the canonical
|
|
76
|
+
assertion for that URL, while invalid-044 covers the empty-userinfo
|
|
77
|
+
variant (`http://@host`) and the other six URL LS categories.
|
|
78
|
+
|
|
79
|
+
- <my-widget aria-label="x"> now reports an error
|
|
80
|
+
under wai-aria-disallowed-props. Add an explicit role
|
|
81
|
+
(<my-widget role="button" aria-label="x">) or remove the naming
|
|
82
|
+
attribute. Affects autonomous custom elements only;
|
|
83
|
+
customised-built-in elements (<button is="x-y">) are unaffected.
|
|
84
|
+
|
|
85
|
+
Source: https://w3c.github.io/html-aria/#docconformance
|
|
86
|
+
|
|
87
|
+
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
|
88
|
+
|
|
89
|
+
- Named rules wrapping `invalid-attr` (e.g., `a11y/no-accesskey`)
|
|
90
|
+
only perform their configured allow/disallow checks and no longer fall back to
|
|
91
|
+
HTML-spec validation. To retain spec validation, extend `markuplint:html-standard`
|
|
92
|
+
or set `"invalid-attr": true` in your config.
|
|
93
|
+
|
|
94
|
+
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|
95
|
+
|
|
96
|
+
# [5.0.0-rc.4](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.3...v5.0.0-rc.4) (2026-04-19)
|
|
97
|
+
|
|
98
|
+
**Note:** Version bump only for package @markuplint/rules
|
|
99
|
+
|
|
100
|
+
# [5.0.0-rc.3](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.2...v5.0.0-rc.3) (2026-04-19)
|
|
101
|
+
|
|
102
|
+
**Note:** Version bump only for package @markuplint/rules
|
|
103
|
+
|
|
6
104
|
# [5.0.0-rc.2](https://github.com/markuplint/markuplint/compare/v5.0.0-rc.1...v5.0.0-rc.2) (2026-04-15)
|
|
7
105
|
|
|
8
106
|
### Bug Fixes
|
package/CLAUDE.md
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
# @markuplint/rules
|
|
2
2
|
|
|
3
|
+
## Adding a New Rule (checklist — steps 2–4 have NO enforcing test; forgetting them fails silently)
|
|
4
|
+
|
|
5
|
+
1. `src/<rule-name>/`: `index.ts`, `meta.ts`, `schema.json`, spec file(s), `README.md` **and** `README.ja.md` — both languages are website source and MUST stay in sync; updating only one is a recurring mistake
|
|
6
|
+
- `meta.ts`'s `category` must be one of the v5 9-category scheme: `syntax`, `structure`, `attributes`, `references`, `forms`, `a11y`, `style`, `maintainability`, `compat` (see the [Categories section](https://markuplint.dev/docs/migration/v4-to-v5/rules/rule-names#categories) of the website's rule-names guide for what each covers)
|
|
7
|
+
- `meta.ts` should also declare `specConformance` (`sources`/`level`/`cites`) once you know the rule's governing spec and requirement strength — `level: 'must'` or `'should'` requires a non-empty `cites`. The rollout across pre-existing rules is incremental and partial by design (enforced only for rules that declare it — see `spec-conformance.spec.ts` and `@markuplint/config-presets`'s `html-standard-entries.spec.ts`), but a **new** rule should declare it from the start
|
|
8
|
+
2. Register the rule in `src/index.ts` (import + registry entry)
|
|
9
|
+
3. Add a `$ref` entry to `packages/@markuplint/rules/schema.json` — this file is a **manually maintained registry** (no generator produces it, despite looking generated)
|
|
10
|
+
4. If the rule belongs in a preset, update `packages/@markuplint/config-presets/src/`
|
|
11
|
+
|
|
3
12
|
## Test ID Convention (MANDATORY)
|
|
4
13
|
|
|
5
|
-
Every `test()` block in `src
|
|
14
|
+
Every `test()` block in rule spec files — `src/<rule-name>/**/*.spec.ts` — MUST have a unique ID prefix:
|
|
6
15
|
|
|
7
16
|
```
|
|
8
17
|
[rule-name-category-NNN] description
|
|
9
18
|
```
|
|
10
19
|
|
|
20
|
+
Repo-wide meta specs directly under `src/` (e.g. `mirrors-parse-error-codes.spec.ts`) are NOT rule specs and are exempt.
|
|
21
|
+
|
|
11
22
|
### Categories
|
|
12
23
|
|
|
13
24
|
| Category | When to use |
|
|
@@ -24,4 +35,22 @@ Every `test()` block in `src/**/*.spec.ts` MUST have a unique ID prefix:
|
|
|
24
35
|
- Numbers are sequential per category per file, starting at `001`
|
|
25
36
|
- Multiple tests for the same issue: `[rule-name-issue-NNNN-001]`, `[rule-name-issue-NNNN-002]`
|
|
26
37
|
- When adding a new test, assign the next available number in the appropriate category
|
|
27
|
-
- Run `/list-rule-test` (or `node .claude/
|
|
38
|
+
- Run `/list-rule-test` (or `node .claude/skills/list-rule-test/scripts/list-rule-test.mjs --no-id`) to check for missing IDs — the only expected hits are the exempt meta specs noted above
|
|
39
|
+
|
|
40
|
+
## Assertion Convention (MANDATORY)
|
|
41
|
+
|
|
42
|
+
When asserting reported violations in rule specs, use `toStrictEqual` with the exact violation object `{ severity, line, col, message, raw }`. Never loose or partial matchers for violation objects. (Assertions on other values — counts, fixed code strings, registry invariants — use whatever matcher fits.)
|
|
43
|
+
|
|
44
|
+
## parse5 mirror declaration (`meta.mirrorsParseErrorCodes`)
|
|
45
|
+
|
|
46
|
+
When a rule's detection covers a parse5 `onParseError` code, declare the code in the rule's
|
|
47
|
+
`meta.ts` via `mirrorsParseErrorCodes` so ml-core suppresses the duplicate `parse-error`
|
|
48
|
+
channel violation. The declaration criterion (rule scope must be at least as broad as the
|
|
49
|
+
parse5 event) and the ruleset dual-lookup semantics are documented in JSDoc:
|
|
50
|
+
`@markuplint/ml-core` `src/ml-rule/types.ts` (the meta field) and
|
|
51
|
+
`src/ml-core.ts` `#pushNonFatalParseErrors`. Canonical example of a rule that actively
|
|
52
|
+
consumes `document.parseErrors` and reports them under its own ruleId: `no-malformed-character-reference`.
|
|
53
|
+
|
|
54
|
+
Enforced by tests: `src/mirrors-parse-error-codes.spec.ts` (no duplicate declarations across
|
|
55
|
+
rules) and `@markuplint/html-parser`'s `parse-error-code-sync.spec.ts` (compile-time alignment
|
|
56
|
+
with parse5's code list).
|
|
@@ -3,7 +3,6 @@ import { ARIA_RECOMMENDED_VERSION } from '@markuplint/ml-spec';
|
|
|
3
3
|
import { checkingNoGlobalProp } from '../wai-aria/checkings/no-global-prop.js';
|
|
4
4
|
import { defaultOptions } from '../wai-aria/default-options.js';
|
|
5
5
|
import meta from './meta.js';
|
|
6
|
-
/** Warns when a non-global ARIA property is used on an element without an explicit role. */
|
|
7
6
|
export default createRule({
|
|
8
7
|
meta,
|
|
9
8
|
defaultOptions,
|
package/lib/attr-check.d.ts
CHANGED
|
@@ -2,65 +2,17 @@ import type { Translator } from '@markuplint/i18n';
|
|
|
2
2
|
import type { Attribute as AttrSpec, AttributeType } from '@markuplint/ml-spec';
|
|
3
3
|
import type { Type } from '@markuplint/types';
|
|
4
4
|
import type { ReadonlyDeep } from 'type-fest';
|
|
5
|
-
/**
|
|
6
|
-
* Discriminated union tag representing the kind of attribute invalidity.
|
|
7
|
-
*/
|
|
8
5
|
type InvalidTYpe = 'non-existent' | 'invalid-value' | 'disallowed-attr';
|
|
9
|
-
/**
|
|
10
|
-
* Describes a single attribute validation failure, including the kind
|
|
11
|
-
* of invalidity, a human-readable message, and an optional source location.
|
|
12
|
-
*
|
|
13
|
-
* @template T - The specific invalidity tag (defaults to any `InvalidTYpe`)
|
|
14
|
-
*/
|
|
15
6
|
type Invalid<T extends InvalidTYpe = InvalidTYpe> = {
|
|
16
7
|
invalidType: T;
|
|
17
8
|
message: string;
|
|
18
9
|
loc?: Loc;
|
|
19
10
|
};
|
|
20
|
-
/**
|
|
21
|
-
* Source location information pointing to the invalid portion of an attribute value.
|
|
22
|
-
*/
|
|
23
11
|
type Loc = {
|
|
24
12
|
raw: string;
|
|
25
13
|
line: number;
|
|
26
14
|
col: number;
|
|
27
15
|
};
|
|
28
|
-
/**
|
|
29
|
-
* Validates an attribute against its specification. Used by the `invalid-attr`
|
|
30
|
-
* and `wai-aria` rules.
|
|
31
|
-
*
|
|
32
|
-
* Performs the following checks in order:
|
|
33
|
-
* 1. Skips `data-*`, `aria-*`/`role`, and `adapt-*` attributes (unless `isCustomRule` is `true`)
|
|
34
|
-
* 2. Verifies the attribute exists in the spec
|
|
35
|
-
* 3. Checks case-sensitive name matching
|
|
36
|
-
* 4. Checks whether the attribute is marked as `noUse` (disallowed)
|
|
37
|
-
* 5. Safety-net fallback for `ConditionalAttributeType[]` (#3685); in normal flow,
|
|
38
|
-
* `isValidAttr()` resolves conditional types before calling this function (#3598)
|
|
39
|
-
* 6. Validates the attribute value against all declared types
|
|
40
|
-
*
|
|
41
|
-
* @param t - The i18n translator for generating localized error messages
|
|
42
|
-
* @param name - The attribute name to check
|
|
43
|
-
* @param value - The attribute value to validate
|
|
44
|
-
* @param isCustomRule - When `true`, skips the built-in bypass for `data-*`, `aria-*`, and `adapt-*` attributes
|
|
45
|
-
* @param spec - The attribute specification to validate against; if absent, the attribute is considered non-existent
|
|
46
|
-
* @param allAttrNames - Optional list of all valid attribute names for the element;
|
|
47
|
-
* used to suggest a similar attribute name via Levenshtein distance when the attribute is non-existent
|
|
48
|
-
* @returns `false` if the attribute is valid, a single `Invalid` object for existence/disallowed errors,
|
|
49
|
-
* or an array of `Invalid<'invalid-value'>` objects for value validation failures
|
|
50
|
-
*/
|
|
51
16
|
export declare function attrCheck(t: Translator, name: string, value: string, isCustomRule: boolean, spec?: AttrSpec, allAttrNames?: readonly string[]): Invalid | Invalid<'invalid-value'>[] | false;
|
|
52
|
-
/**
|
|
53
|
-
* Validates an attribute value against a single attribute type definition.
|
|
54
|
-
* Returns `false` if the value is valid, or a tuple of `[message, location]`
|
|
55
|
-
* describing the mismatch.
|
|
56
|
-
*
|
|
57
|
-
* Boolean attributes are always considered valid (their mere presence is sufficient).
|
|
58
|
-
*
|
|
59
|
-
* @param t - The i18n translator for generating localized error messages
|
|
60
|
-
* @param name - The attribute name (used in error messages)
|
|
61
|
-
* @param value - The attribute value to validate
|
|
62
|
-
* @param type - The attribute type definition to validate against
|
|
63
|
-
* @returns `false` if the value is valid, or a `[message, location]` tuple on failure
|
|
64
|
-
*/
|
|
65
17
|
export declare function valueCheck(t: Translator, name: string, value: string, type: ReadonlyDeep<AttributeType | Type>): [string, Loc] | false;
|
|
66
18
|
export {};
|
package/lib/attr-check.js
CHANGED
|
@@ -3,29 +3,6 @@ import { toNonNullableArrayFromItemOrArray } from '@markuplint/shared';
|
|
|
3
3
|
import { check, getCandidate } from '@markuplint/types';
|
|
4
4
|
import { createMessageValueExpected } from './create-message.js';
|
|
5
5
|
import { log } from './debug.js';
|
|
6
|
-
/**
|
|
7
|
-
* Validates an attribute against its specification. Used by the `invalid-attr`
|
|
8
|
-
* and `wai-aria` rules.
|
|
9
|
-
*
|
|
10
|
-
* Performs the following checks in order:
|
|
11
|
-
* 1. Skips `data-*`, `aria-*`/`role`, and `adapt-*` attributes (unless `isCustomRule` is `true`)
|
|
12
|
-
* 2. Verifies the attribute exists in the spec
|
|
13
|
-
* 3. Checks case-sensitive name matching
|
|
14
|
-
* 4. Checks whether the attribute is marked as `noUse` (disallowed)
|
|
15
|
-
* 5. Safety-net fallback for `ConditionalAttributeType[]` (#3685); in normal flow,
|
|
16
|
-
* `isValidAttr()` resolves conditional types before calling this function (#3598)
|
|
17
|
-
* 6. Validates the attribute value against all declared types
|
|
18
|
-
*
|
|
19
|
-
* @param t - The i18n translator for generating localized error messages
|
|
20
|
-
* @param name - The attribute name to check
|
|
21
|
-
* @param value - The attribute value to validate
|
|
22
|
-
* @param isCustomRule - When `true`, skips the built-in bypass for `data-*`, `aria-*`, and `adapt-*` attributes
|
|
23
|
-
* @param spec - The attribute specification to validate against; if absent, the attribute is considered non-existent
|
|
24
|
-
* @param allAttrNames - Optional list of all valid attribute names for the element;
|
|
25
|
-
* used to suggest a similar attribute name via Levenshtein distance when the attribute is non-existent
|
|
26
|
-
* @returns `false` if the attribute is valid, a single `Invalid` object for existence/disallowed errors,
|
|
27
|
-
* or an array of `Invalid<'invalid-value'>` objects for value validation failures
|
|
28
|
-
*/
|
|
29
6
|
export function attrCheck(t, name, value, isCustomRule, spec, allAttrNames) {
|
|
30
7
|
if (!isCustomRule) {
|
|
31
8
|
if (/^data-.+$/.test(name)) {
|
|
@@ -98,19 +75,6 @@ export function attrCheck(t, name, value, isCustomRule, spec, allAttrNames) {
|
|
|
98
75
|
}
|
|
99
76
|
return [...invalidMap.values()];
|
|
100
77
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Validates an attribute value against a single attribute type definition.
|
|
103
|
-
* Returns `false` if the value is valid, or a tuple of `[message, location]`
|
|
104
|
-
* describing the mismatch.
|
|
105
|
-
*
|
|
106
|
-
* Boolean attributes are always considered valid (their mere presence is sufficient).
|
|
107
|
-
*
|
|
108
|
-
* @param t - The i18n translator for generating localized error messages
|
|
109
|
-
* @param name - The attribute name (used in error messages)
|
|
110
|
-
* @param value - The attribute value to validate
|
|
111
|
-
* @param type - The attribute type definition to validate against
|
|
112
|
-
* @returns `false` if the value is valid, or a `[message, location]` tuple on failure
|
|
113
|
-
*/
|
|
114
78
|
export function valueCheck(t, name, value, type) {
|
|
115
79
|
if (type === 'Boolean') {
|
|
116
80
|
// Valid because an attribute is exist
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Translator } from '@markuplint/i18n';
|
|
2
|
+
import type { PlainData } from '@markuplint/ml-config';
|
|
3
|
+
import type { Element, RuleConfigValue } from '@markuplint/ml-core';
|
|
4
|
+
import type { Attribute } from '@markuplint/ml-spec';
|
|
5
|
+
/**
|
|
6
|
+
* Result of resolving whether an attribute name is known to the spec and,
|
|
7
|
+
* if so, whether it currently applies. Shared by `no-unknown-attr` (acts on
|
|
8
|
+
* `unknown`/`case-mismatch`), `no-disallowed-attr` (acts on `no-use`/
|
|
9
|
+
* `condition-not-met`), and `no-invalid-attr-value` (acts on `ok`, using the
|
|
10
|
+
* resolved `spec.type` for value-checking). Splitting this into one function
|
|
11
|
+
* keeps the three rules' notion of "what the spec says about this name" in
|
|
12
|
+
* sync without re-deriving it three times.
|
|
13
|
+
*/
|
|
14
|
+
export type AttrEligibility = {
|
|
15
|
+
readonly status: 'exempt';
|
|
16
|
+
} | {
|
|
17
|
+
readonly status: 'unknown';
|
|
18
|
+
readonly candidate: string | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
readonly status: 'case-mismatch';
|
|
21
|
+
readonly expectedName: string;
|
|
22
|
+
} | {
|
|
23
|
+
readonly status: 'no-use';
|
|
24
|
+
} | {
|
|
25
|
+
readonly status: 'condition-not-met';
|
|
26
|
+
} | {
|
|
27
|
+
readonly status: 'ok';
|
|
28
|
+
readonly spec: Attribute;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Resolves an attribute name against the element's `attrSpecs`, following
|
|
32
|
+
* the same order the pre-split `invalid-attr` rule used: existence, then
|
|
33
|
+
* case-sensitivity, then `noUse`, then `condition` (with
|
|
34
|
+
* `ConditionalAttributeType[]` resolved to a concrete type first, per #3598).
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveAttrEligibility<T extends RuleConfigValue, O extends PlainData>(name: string, node: Element<T, O>, attrSpecs: readonly Attribute[]): AttrEligibility;
|
|
37
|
+
/**
|
|
38
|
+
* Formats the "did you mean" suffix shared by `no-unknown-attr`'s two typo
|
|
39
|
+
* paths (spec-driven candidate, case-sensitivity mismatch).
|
|
40
|
+
*/
|
|
41
|
+
export declare function suggestionSuffix(t: Translator, candidate: string | undefined): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { isConditionalAttributeTypeArray } from '@markuplint/ml-spec';
|
|
2
|
+
import { getCandidate } from '@markuplint/types';
|
|
3
|
+
import { attrMatches, conditionDependsOnDynamicAttr } from './helpers.js';
|
|
4
|
+
/**
|
|
5
|
+
* Attribute namespaces that are exempt from spec-based name/eligibility
|
|
6
|
+
* checking regardless of what `attrSpecs` says: `data-*` and `adapt-*` are
|
|
7
|
+
* any-type by definition, and ARIA (`aria-*` / `role`) is validated by the
|
|
8
|
+
* dedicated ARIA rules, not here.
|
|
9
|
+
*/
|
|
10
|
+
const EXEMPT_NAME_PATTERN = /^(?:data-.+|adapt-.+|aria-.+|role)$/;
|
|
11
|
+
/**
|
|
12
|
+
* Resolves an attribute name against the element's `attrSpecs`, following
|
|
13
|
+
* the same order the pre-split `invalid-attr` rule used: existence, then
|
|
14
|
+
* case-sensitivity, then `noUse`, then `condition` (with
|
|
15
|
+
* `ConditionalAttributeType[]` resolved to a concrete type first, per #3598).
|
|
16
|
+
*/
|
|
17
|
+
export function resolveAttrEligibility(name,
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
|
|
19
|
+
node, attrSpecs) {
|
|
20
|
+
if (EXEMPT_NAME_PATTERN.test(name)) {
|
|
21
|
+
return { status: 'exempt' };
|
|
22
|
+
}
|
|
23
|
+
let spec = attrSpecs.find(s => s.name.toLowerCase() === name.toLowerCase());
|
|
24
|
+
if (!spec) {
|
|
25
|
+
const candidate = getCandidate(name, attrSpecs.map(s => s.name));
|
|
26
|
+
return { status: 'unknown', candidate };
|
|
27
|
+
}
|
|
28
|
+
const nameCaseSensitive = /[A-Z]/.test(spec.name);
|
|
29
|
+
if (nameCaseSensitive && name !== spec.name) {
|
|
30
|
+
return { status: 'case-mismatch', expectedName: spec.name };
|
|
31
|
+
}
|
|
32
|
+
if (spec.noUse) {
|
|
33
|
+
return { status: 'no-use' };
|
|
34
|
+
}
|
|
35
|
+
// Resolve ConditionalAttributeType[] to a concrete type based on element matching (#3598).
|
|
36
|
+
if (isConditionalAttributeTypeArray(spec.type)) {
|
|
37
|
+
const matched = spec.type.find(entry => {
|
|
38
|
+
const cond = typeof entry.condition === 'string' ? entry.condition : entry.condition.join(',');
|
|
39
|
+
return node.matches(cond);
|
|
40
|
+
});
|
|
41
|
+
// Fallback to 'Any' when no condition matches: input types without an explicit
|
|
42
|
+
// entry (text, search, tel, password, hidden, checkbox, radio, file, submit,
|
|
43
|
+
// image, reset, button) have no value constraints per the HTML spec.
|
|
44
|
+
spec = { ...spec, type: matched ? matched.type : 'Any' };
|
|
45
|
+
}
|
|
46
|
+
if (spec.condition != null &&
|
|
47
|
+
!node.hasSpreadAttr &&
|
|
48
|
+
!conditionDependsOnDynamicAttr(node, spec.condition) &&
|
|
49
|
+
!attrMatches(node, spec.condition)) {
|
|
50
|
+
return { status: 'condition-not-met' };
|
|
51
|
+
}
|
|
52
|
+
return { status: 'ok', spec };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Formats the "did you mean" suffix shared by `no-unknown-attr`'s two typo
|
|
56
|
+
* paths (spec-driven candidate, case-sensitivity mismatch).
|
|
57
|
+
*/
|
|
58
|
+
export function suggestionSuffix(t, candidate) {
|
|
59
|
+
return candidate ? t('. ') + t('Did you mean "{0*}"?', candidate) : '';
|
|
60
|
+
}
|
|
@@ -6,12 +6,5 @@ export type Quote = '"' | "'";
|
|
|
6
6
|
export type QuoteMap = {
|
|
7
7
|
[P in Type]: Quote;
|
|
8
8
|
};
|
|
9
|
-
/**
|
|
10
|
-
* Rule that enforces consistent quotation marks around attribute values.
|
|
11
|
-
*
|
|
12
|
-
* Verifies that all attribute values use the configured quote style (double
|
|
13
|
-
* or single). Attributes without values, dynamic values, and directives are
|
|
14
|
-
* skipped. Includes an auto-fix that replaces mismatched quotes.
|
|
15
|
-
*/
|
|
16
9
|
declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<Type, undefined>>;
|
|
17
10
|
export default _default;
|
|
@@ -7,13 +7,6 @@ const quoteList = {
|
|
|
7
7
|
double: '"',
|
|
8
8
|
single: "'",
|
|
9
9
|
};
|
|
10
|
-
/**
|
|
11
|
-
* Rule that enforces consistent quotation marks around attribute values.
|
|
12
|
-
*
|
|
13
|
-
* Verifies that all attribute values use the configured quote style (double
|
|
14
|
-
* or single). Attributes without values, dynamic values, and directives are
|
|
15
|
-
* skipped. Includes an auto-fix that replaces mismatched quotes.
|
|
16
|
-
*/
|
|
17
10
|
export default createRule({
|
|
18
11
|
meta: meta,
|
|
19
12
|
defaultSeverity: 'warning',
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/** The enforced letter case for attribute names. */
|
|
2
2
|
export type Value = 'lower' | 'upper';
|
|
3
|
-
/**
|
|
4
|
-
* Rule that enforces consistent letter case for HTML attribute names.
|
|
5
|
-
*
|
|
6
|
-
* Reports attribute names that do not match the configured case (lower or upper)
|
|
7
|
-
* on HTML elements. Foreign elements and case-sensitive attributes (per spec)
|
|
8
|
-
* are excluded. Includes an auto-fix that converts attribute names to the
|
|
9
|
-
* configured case.
|
|
10
|
-
*/
|
|
11
3
|
declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<Value, undefined>>;
|
|
12
4
|
export default _default;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { createRule, getAttrSpecs } from '@markuplint/ml-core';
|
|
2
2
|
import meta from './meta.js';
|
|
3
|
-
/**
|
|
4
|
-
* Rule that enforces consistent letter case for HTML attribute names.
|
|
5
|
-
*
|
|
6
|
-
* Reports attribute names that do not match the configured case (lower or upper)
|
|
7
|
-
* on HTML elements. Foreign elements and case-sensitive attributes (per spec)
|
|
8
|
-
* are excluded. Includes an auto-fix that converts attribute names to the
|
|
9
|
-
* configured case.
|
|
10
|
-
*/
|
|
11
3
|
export default createRule({
|
|
12
4
|
meta: meta,
|
|
13
5
|
defaultSeverity: 'warning',
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/** The enforced letter case for tag names. */
|
|
2
2
|
export type Value = 'lower' | 'upper';
|
|
3
|
-
/**
|
|
4
|
-
* Rule that enforces consistent letter case for HTML tag names.
|
|
5
|
-
*
|
|
6
|
-
* Reports opening and closing tag names that do not match the configured
|
|
7
|
-
* case (lower or upper) on HTML elements. Skipped when the document is
|
|
8
|
-
* tag-name-case-sensitive or for foreign elements. Includes an auto-fix
|
|
9
|
-
* that converts tag names to the configured case.
|
|
10
|
-
*/
|
|
11
3
|
declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<Value, undefined>>;
|
|
12
4
|
export default _default;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { createRule } from '@markuplint/ml-core';
|
|
2
2
|
import meta from './meta.js';
|
|
3
|
-
/**
|
|
4
|
-
* Rule that enforces consistent letter case for HTML tag names.
|
|
5
|
-
*
|
|
6
|
-
* Reports opening and closing tag names that do not match the configured
|
|
7
|
-
* case (lower or upper) on HTML elements. Skipped when the document is
|
|
8
|
-
* tag-name-case-sensitive or for foreign elements. Includes an auto-fix
|
|
9
|
-
* that converts tag names to the configured case.
|
|
10
|
-
*/
|
|
11
3
|
export default createRule({
|
|
12
4
|
meta: meta,
|
|
13
5
|
defaultSeverity: 'warning',
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/** One or more regex or glob patterns that class names must match, or `null` to disable. */
|
|
2
2
|
export type Value = string | string[] | null;
|
|
3
|
-
/**
|
|
4
|
-
* Rule that validates class attribute values against configured naming patterns.
|
|
5
|
-
*
|
|
6
|
-
* Splits the `class` attribute into individual class names and checks each
|
|
7
|
-
* one against the provided string or regex patterns. Reports any class name
|
|
8
|
-
* that does not match at least one of the configured patterns. Dynamic
|
|
9
|
-
* values are excluded from the check.
|
|
10
|
-
*/
|
|
11
3
|
declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<Value, undefined>>;
|
|
12
4
|
export default _default;
|
|
@@ -2,14 +2,6 @@ import { createRule } from '@markuplint/ml-core';
|
|
|
2
2
|
import { toNoEmptyStringArrayFromStringOrArray } from '@markuplint/shared';
|
|
3
3
|
import { match } from '../helpers.js';
|
|
4
4
|
import meta from './meta.js';
|
|
5
|
-
/**
|
|
6
|
-
* Rule that validates class attribute values against configured naming patterns.
|
|
7
|
-
*
|
|
8
|
-
* Splits the `class` attribute into individual class names and checks each
|
|
9
|
-
* one against the provided string or regex patterns. Reports any class name
|
|
10
|
-
* that does not match at least one of the configured patterns. Dynamic
|
|
11
|
-
* values are excluded from the check.
|
|
12
|
-
*/
|
|
13
5
|
export default createRule({
|
|
14
6
|
meta: meta,
|
|
15
7
|
defaultSeverity: 'warning',
|
package/lib/class-naming/meta.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flags rows whose width disagrees with the table's base column count.
|
|
3
|
+
*
|
|
4
|
+
* Unlike the sibling splits of `table-row-column-alignment`, this is not a table model error:
|
|
5
|
+
* HTML LS §4.9.12.1 Step 7 grows `xwidth` to fit a wider row, and a narrower row is only a table
|
|
6
|
+
* model error where {@link import('../no-empty-table-track/index.js')} already catches it (a
|
|
7
|
+
* column no cell ever anchors to). A ragged table is nevertheless almost always a mistake, which
|
|
8
|
+
* is why this check exists and why it stays a `warning` rather than the `error` of its siblings.
|
|
9
|
+
*
|
|
10
|
+
* Skips a table that `no-table-cell-overlap` already reports on — once two cells claim the same
|
|
11
|
+
* slot, row widths derived from the grid model are no longer reliable.
|
|
12
|
+
*/
|
|
13
|
+
declare const _default: Readonly<import("@markuplint/ml-core").RuleSeed<boolean, undefined>>;
|
|
14
|
+
export default _default;
|