lint-mdx.js: multi-line opening tags (Card, CardGroup, etc.) silently skipped by attribute check
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- javascript
- 領域
- documentation, tooling
調査の方向性
scripts/lint-mdx.js の checkMintlifyComponents から開始し、各行が開きタグ用の正規表現に対してどのように照合されるかを確認します。引用されている MDX ファイルに対して linter を実行し、その後、複数行にわたる Card タグが検査されることを、title= がない合成 Card タグも含めて確認します。同時に、既存の有効なタグから新しい検出結果が発生しないことも確認します。
索引モデルが issue の本文から書いたものです。
説明
Description
The opening-tag check in scripts/lint-mdx.js (checkMintlifyComponents) matches each line against a regex that expects the tag and its attributes on the same line. When a tag's name is on its own line, with attributes like title= spread across the following lines, the regex never matches - so the tag is silently skipped entirely. No required-attribute check runs, no CardGroup cols check runs, and it is not tracked for parent/child nesting rules.
Evidence
Found 5 multi-line opening tags across 2 files that were never being checked at all:
- docs/base-account/quickstart/ai-tools-available-for-devs.mdx - 3 multi-line Card tags (lines 10, 47, 67)
- docs/apps/resources/templates.mdx - 2 multi-line Card tags (lines 22, 28)
All 5 happen to already have a valid title= attribute, so this gap doesn't currently produce any wrong output in the lint report - but it means the linter would silently miss a genuinely missing title on any of these tags, or on any future multi-line tag written in this style.
Example (ai-tools-available-for-devs.mdx):
A Card tag opens on its own line, with title= and other attributes set on the following lines, closing several lines later. Because the check only reads the line containing <Card, it never sees the tag at all.
Fix
Companion PR makes the check accumulate lines starting at a lone opening-tag line until a closing > is found, then runs the existing regex against the accumulated text. Verified against all 5 real instances (no new findings, since they're all valid) and a synthetic multi-line Card missing title=, which is now correctly flagged.
- 主要言語
- JavaScript
- スター
- 337
- フォーク
- 798
- 平均マージ
- 13時間 7分
- マージ済み PR(30日)
- 57
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
base/docs のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
neondatabase/website#5944 ·
-
module: core
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bigbluebutton/bigbluebutton#25849 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·