Closed lukejacksonn closed 3 years ago
This looks great. It would be awesome if you could make it optionally(?) to fail the entire build as a missing name implies a bug you should fix before deploying.
Yeh I can see value in that.. where would you expect such flags to live; in the theme?
@lukejacksonn Yeah, theme feels like the perfect spot for customization.
Ok @bebraw it is now possible to do themed({ strict: true })
which will cause oceanwind to throw rather than warn about missing or duplicate translations.
Great. 👍
Fixes #12
Warnings about missing or duplicate translations will now come with some stack trace info (thanks @JoviDeCroock!):
Clicking on the file path in dev tools will jump to the line in the file in the sources panel. Hopefully this makes tracking down mistakes a bit easier! I didn't really feel throwing was absolutely necessary here but I can see how that strictness might be reassuring in certain situations so it is now possible to opt into a strict mode that will error instead of warn:
This is possible by using a themed instance, with strict set to true:
Not sure if it will work everywhere 🤷♂️ if anyone has any better ideas then I'm all ears.
cc @bebraw