feat: add autocomplete support for locales#248
feat: add autocomplete support for locales#248prisis merged 2 commits intofaker-js:mainfrom ST-DDT:feature/locales/autocomplete
Conversation
|
✔️ Deploy Preview for vigilant-wescoff-04e480 ready! 🔨 Explore the source changes: 77e08ba 🔍 Inspect the deploy log: https://app.netlify.com/sites/vigilant-wescoff-04e480/deploys/61eb2cb9c1bb40000987678b 😎 Browse the preview: https://deploy-preview-248--vigilant-wescoff-04e480.netlify.app |
|
This doesn't work yet due to |
|
This PR depends on #249 |
| import zu_ZA from './zu_ZA'; | ||
|
|
||
| const locales: { [lang: string]: LocaleDefinition } = { | ||
| export type KnownLocale = |
There was a problem hiding this comment.
Couldn't you use keyof typeof locales, so we don't have to repeat the same thing again?
There was a problem hiding this comment.
Wont this result in a circular type?
One of them needs to be defined first, or not?
There was a problem hiding this comment.
yes, first create the locales, and then below it, create the KnownLocale type. There is no circular reference if they stay in the same file.
There was a problem hiding this comment.
Could you please create an issue (or PR) for that?
I currently work on something different and don't want to forget about it.

I will automate the generation/update for
KnownLocales in a later PR.The is the TypeScript related part for #210