Add ESLint rule to catch broken internal links and standardize on npm
@allgandalf đang làm issue này rồi.
Từ ngày 26/2/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Problem
Internal links in JSX pages are prone to formatting bugs that break navigation. For example, PR #155 fixed links in gsoc.js where relative paths like href="gsoc_ideas" and href="gsoc_ideas.html" were used instead of the correct absolute path href="/gsoc_ideas/".
The same class of issues still exists in other files (e.g. news.js has href="gsoc.html" and URLs with leading whitespace like href=" https://...").
Currently nothing catches these at development time because:
- The project has no linting setup
onBrokenLinksis set to"ignore"indocusaurus.config.js
Additionally, the project has both a yarn.lock and package-lock.json even though CI exclusively uses npm, which causes confusion.
Proposed Solution
-
Add ESLint with a custom
no-bad-internal-linksrule that flagshrefandtoattributes in JSX where:- Whitespace in URLs: leading/trailing spaces (e.g.
href=" https://...") - Relative internal links: missing leading
/(e.g.href="gsoc.html"should behref="/gsoc/") .htmlextensions: Docusaurus uses clean URLs, so.htmlshould not be used- Missing trailing slash: internal links should end with
/
- Whitespace in URLs: leading/trailing spaces (e.g.
-
Add a GitHub Actions workflow so the lint check runs on every PR and push to master.
-
Fix all existing lint violations across the codebase.
-
Remove
yarn.lockand standardize on npm, consistent with all CI workflows.
- Ngôn ngữ chính
- CSS
- Star
- 7
- Fork
- 25
- Merge trung bình
- 3 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 PecanProject/PecanProject.github.io
-
Reloading /package-documentation/ shows pkgdown README instead of version chooserCó thể đã có người làm @ANAMASGARD đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
PecanProject/PecanProject.github.io#206 · 1 bình luận ·
-
Add lychee GitHub action to automatically check for broken linksCó thể đã có người làm @Avneetsingh18-doit đã nhận 261 ngày trước. Đang mởgood first issue
PecanProject/PecanProject.github.io#134 · 8 bình luận · 1 reaction · 1 người được giao ·
-
Enhance Site Navigation: Add Search Bar to NavbarCó thể đã có người làm @divine7022 đã nhận 653 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
PecanProject/PecanProject.github.io#90 · 23 bình luận ·