next.js
3f75ff69 - Use Array.from to avoid @ts-ignore when copying i18n.locales (#82148)

Commit
87 days ago
Use Array.from to avoid @ts-ignore when copying i18n.locales (#82148) ### What? Replaces: ```ts // @ts-ignore locales are readonly const locales: string[] = i18n.locales; ``` with: ```ts const locales = Array.from(i18n.locales); ``` ### Why? Avoids suppressing TypeScript errors via @ts-ignore. Array.from safely creates a mutable copy without modifying the readonly original, making the code cleaner and more type-safe. ### How? Used Array.from(i18n.locales) instead of a forced type assertion.<br> <br> No functional change, purely a lint-/type-safety improvement. Co-authored-by: Joseph <joseph.chamochumbi@vercel.com>
Author
Parents
Loading