Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

HardcodedRoutes flags paths that only share a prefix with a route

Aperta
#1,362 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@RaphaelFakhri ci sta già lavorando.

Dal 21/10/2026.

  • #1363 di @RaphaelFakhri — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

Start by locating the HardcodedRoutes rule in the theme-tools repository and read how it matches route paths against the Liquid examples in the issue. Check the rule's existing tests for prefix matching and add coverage for the reported paths. Done means only actual route paths are reported, including /collections/all-shoes as /collections; pull request #1363 is already open for this issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

HardcodedRoutes matches routes with a plain string prefix. Any path that starts with the same characters as a route is reported, even when it is a different page. For /collections/all-shoes, the check suggests routes.all_products_collection_url, which points to a different page.

Source

<a href="/cartography"></a>
<a href="/searching"></a>
<a href="/accounting"></a>
{{ 'Carts' | link_to: '/carts' }}
<a href="/collections/all-shoes"></a>

Expected behaviour

No offense for /cartography, /searching, /accounting and /carts. /collections/all-shoes is reported as /collections with routes.collections_url.

Actual behaviour

  • /cartography: "Use routes object {{ routes.cart_url }} instead of hardcoding /cart"
  • /searching: "Use routes object {{ routes.search_url }} instead of hardcoding /search"
  • /accounting: "Use routes object {{ routes.account_url }} instead of hardcoding /account"
  • /carts: "Use routes object {{ routes.cart_url }} instead of hardcoding /cart"
  • /collections/all-shoes: "Use routes object {{ routes.all_products_collection_url }} instead of hardcoding /collections/all"

Debugging information

  • Theme Check version: @shopify/theme-check-common on main (3f810a1)
Lingua principale
TypeScript
Stelle
239
Fork
104
Merge medio
1g 2h
PR unite (30g)
23

Preparare l'ambiente

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 Shopify/theme-tools

Tutte le issue di Shopify/theme-tools

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.