Why I store all URLs in a one file: ✅ Support reuse ✅ Enforce consistency ✅...


Why I store all URLs in a one file:

✅ Support reuse
✅ Enforce consistency
✅ Easy to see duplication
✅ Test URLs in isolation
✅ Simple call sites = reads better
✅ Naming each URL documents intent
✅ Easily share full list with stakeholders

Another benefit: When I use #typescript, I create a strongly typed API around the site's URLs.

Benefits:
✅ Rich autocomplete support when referencing URLs
✅ The args I pass in to generate the URL are type safe
✅ Can easily find / rename all references to a given URL

View original on X