Add ESLint rule to catch broken internal links and standardize on npm

Đang mở
#156 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@allgandalf đang làm issue này rồi.

Từ ngày 26/2/2026.

  • #157 của @allgandalf — đang mở
  • #180 của @ANAMASGARD — đang mở

Đá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
  • onBrokenLinks is set to "ignore" in docusaurus.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

  1. Add ESLint with a custom no-bad-internal-links rule that flags href and to attributes in JSX where:

    • Whitespace in URLs: leading/trailing spaces (e.g. href=" https://...")
    • Relative internal links: missing leading / (e.g. href="gsoc.html" should be href="/gsoc/")
    • .html extensions: Docusaurus uses clean URLs, so .html should not be used
    • Missing trailing slash: internal links should end with /
  2. Add a GitHub Actions workflow so the lint check runs on every PR and push to master.

  3. Fix all existing lint violations across the codebase.

  4. Remove yarn.lock and 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PecanProject/PecanProject.github.io

Tất cả issue của PecanProject/PecanProject.github.io

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.