feat(markuplint)!: upgrade markuplint to v5.0.0-alpha.3#841
Draft
YusukeHirao wants to merge 6 commits intodevfrom
Draft
feat(markuplint)!: upgrade markuplint to v5.0.0-alpha.3#841YusukeHirao wants to merge 6 commits intodevfrom
YusukeHirao wants to merge 6 commits intodevfrom
Conversation
BREAKING CHANGE: upgrade markuplint and @markuplint/pug-parser to v5.0.0-alpha.3 - Use named rule group to disable performance/img-aspect-ratio (width/height are auto-injected at build time) - Remove outdated nodeRule comment for img required-attr override Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Adjust violation output order for CLI test - Add new v5 checks: ARIA parent role requirements, dialog autofocus, redundant-accessible-name - Remove class-naming violations from button-command test due to v5 -c flag now fully replacing .markuplintrc Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add name properties to all D-ZERO nodeRules (e.g., d-zero/img-require-alt, d-zero/button-require-command) and convert the disallowed-element rule to a NamedRuleGroup (d-zero/no-br) for better identification in violation output.
Add (ruleId) and [name] to markuplint test violation format string to verify that named rule groups are correctly applied. Update all test expectations accordingly.
Enable 6 new rules: - attr-order: id > class > role > aria-* > data-* > element-specific - head-element-order: enforce optimal <head> element ordering - no-boolean-attr-value: disallow redundant boolean attribute values - no-default-value: warn on explicit default attribute values - no-use-event-handler-attr: disallow inline event handlers - no-unsupported-features: detect unsupported browser features (requires browserslist config, see markuplint/markuplint#3328)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
markuplint を v4.14.0 から v5.0.0-alpha.3 にアップグレードし、v5 の新機能・新ルールを導入する。
変更内容
パッケージバージョン更新
markuplint:4.14.0→5.0.0-alpha.3@markuplint/pug-parser:4.6.23→5.0.0-alpha.3v5 Named Rule Groups への移行
D-ZERO 独自ルール(
nodeRules)にnameプロパティを追加し、v5 の Named Rule Groups 形式に変換。これにより違反メッセージに
[d-zero/rule-name]のようなラベルが付与され、どのルールによる違反か特定しやすくなる。対象ルール:
d-zero/html-allow-prefix-attrd-zero/img-require-altd-zero/img-src-kebab-cased-zero/media-src-kebab-cased-zero/a-href-conventiond-zero/button-require-commandd-zero/button-prefer-commandford-zero/button-prefer-command-actiond-zero/no-br(rules内に Named Rule Group として再構成)v5 新ルールの追加
recommended プリセットに含まれない以下のルールを採用:
attr-orderid > class > role > aria-* > data-* > 要素固有属性に統一head-element-order<head>内要素の順序を検証no-boolean-attr-valuedisabled="disabled")no-default-valuetype="text")no-use-event-handler-attrno-unsupported-featuresimg の performance/img-aspect-ratio 無効化
markuplint:recommended-static-htmlの performance プリセットに含まれるimg[src]に対するwidth/height必須ルールを無効化。ビルド時に自動付与されるため不要。(v4 では
nodeRulesで上書きしていたが、v5 ではrulesで直接無効化に変更)テストの更新
ruleIdとname(Named Rule Group名)を含めるよう変更attr-orderルールに準拠するよう修正no-default-valueルールにより冗長なtype="text"を削除attr-order専用テストケースを新規追加(正常5パターン + 違反5パターン)既知の問題
no-unsupported-featuresが Node.js v22+ で@mdn/browser-compat-dataの JSON インポート時にクラッシュする問題ありBREAKING CHANGE
markuplint v5 は ARIA 1.3 をデフォルトで使用する。一部の ARIA 属性の検証結果が v4 と異なる場合がある。
テスト計画
yarn testで全110テストパス🤖 Generated with Claude Code