phrase / ngx-translate-phraseapp

Integrate the Phrase In-Context Editor with ngx-translate
https://phrase.com
MIT License
3 stars 1 forks source link

Inaccurate config typings #64

Open json-derulo opened 2 months ago

json-derulo commented 2 months ago

Expected behavior

When omitting required attributes in the config, such as projectId or accountId, a type error should be thrown.

Actual behavior

No type error is being thrown. For example, the following code builds:

import { initializePhraseAppEditor } from 'ngx-translate-phraseapp';

initializePhraseAppEditor({});

But with this setup, on runtime the following error is thrown:

Config is not set up properly
Please set up the PHRASEAPP_CONFIG object with `accountId` and `projectId`, as well as any other needed options.

It would be good to catch this already on build time by providing more accurate typings for the config.

itsahsiao commented 2 months ago

Hi @json-derulo , thanks for reporting this. We will have a look into this.