lint-mdx.js: multi-line opening tags (Card, CardGroup, etc.) silently skipped by attribute check
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript
- Lĩnh vực
- documentation, tooling
Hướng nghiên cứu
Bắt đầu trong scripts/lint-mdx.js tại checkMintlifyComponents và kiểm tra cách mỗi dòng được đối chiếu với regex của thẻ mở. Chạy linter trên các tệp MDX được nêu, sau đó xác minh rằng các thẻ Card nhiều dòng được kiểm tra, bao gồm một thẻ Card tổng hợp thiếu title=, trong khi các thẻ hợp lệ hiện có không tạo ra phát hiện mới.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 337
- Fork
- 798
- Merge trung bình
- 13 giờ 7 phút
- Pull request đã merge (30 ngày)
- 57
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của base/docs
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mksglu/context-mode#1200 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
neondatabase/website#5944 ·
-
module: core
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
bigbluebutton/bigbluebutton#25849 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
jaegertracing/jaeger-ui#4506 ·