Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

HardcodedRoutes flags paths that only share a prefix with a route

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Từ ngày 21/10/2026.

  • #1363 của @RaphaelFakhri — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
Ngôn ngữ chính
TypeScript
Star
240
Fork
106
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

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

Tất cả issue của Shopify/theme-tools

Issue tương tự

Thêm issue về TypeScript

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.