Add ESLint rule to catch broken internal links and standardize on npm
@allgandalf arbeitet bereits daran.
Seit 26.2.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- CSS
- Sterne
- 7
- Forks
- 25
- Ø Merge
- 3 T. 13 Std.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PecanProject/PecanProject.github.io
-
Reloading /package-documentation/ shows pkgdown README instead of version chooserEvtl. vergeben @ANAMASGARD hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
PecanProject/PecanProject.github.io#206 · 1 Kommentar ·
-
Add lychee GitHub action to automatically check for broken linksEvtl. vergeben @Avneetsingh18-doit hat das vor 261 Tagen übernommen. Offengood first issue
PecanProject/PecanProject.github.io#134 · 8 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
-
Enhance Site Navigation: Add Search Bar to NavbarEvtl. vergeben @divine7022 hat das vor 653 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
PecanProject/PecanProject.github.io#90 · 23 Kommentare ·