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

Aperta
#156 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@allgandalf ci sta già lavorando.

Dal 26/2/2026.

  • #157 di @allgandalf — aperta
  • #180 di @ANAMASGARD — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
CSS
Stelle
7
Fork
25
Merge medio
3g 13h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PecanProject/PecanProject.github.io

Tutte le issue di PecanProject/PecanProject.github.io

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.