mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.16k stars 486 forks source link

chore(types): narrow string to Locale where possible #11323

Closed C17AN closed 1 week ago

C17AN commented 2 weeks ago

Summary

Problem

As the locale key value is widely used in the project, I thought it would be better to manage it more thoroughly.

Solution

Narrow locale property's type from string to Locale.

Before

image

After

image

C17AN commented 2 weeks ago

While correcting the Lint error, I realized that more changes were needed than I thought.

I think it would be meaningful to change the string type to the Locale type, but there is a concern that this change could lead to a breaking change.

I would appreciate it if you could feel free to leave your comments on what you think.

github-actions[bot] commented 2 weeks ago

This pull request has merge conflicts that must be resolved before it can be merged.

C17AN commented 1 week ago

Thank you for your review, @caugner! If there is anything else I need to do, please feel free to let me know, and have a great day!

caugner commented 1 week ago

If there is anything else I need to do, please feel free to let me know, and have a great day!

Thank you, we're all good, and I just merged! 🎉