Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return non-zero exit code on failure to extract strings #256

Open
djbb7 opened this issue Nov 28, 2023 · 0 comments
Open

Return non-zero exit code on failure to extract strings #256

djbb7 opened this issue Nov 28, 2023 · 0 comments

Comments

@djbb7
Copy link

djbb7 commented Nov 28, 2023

🚀 Feature Proposal

Motivation

The scanner sometimes fails to extract strings due to the selected keys. However, the command exit code is always 0.
We run the local extraction on a pre-commit hook, and this type of human errors are common. It would be very useful if the i18next-scanner could return non-zero exit code in this case.

Example

// The first case creates a string in the locale json file 
{t('key1, 'Foo')}

// The second case tries to create an object in the `nested1` key,
// but it fails since there is already a literal in that key
{t('key1.title', 'Bar')}

The exit code of the i18next-scanner in this case is 0 and the output is:

i18next-scanner: failed to process file Example.tsx
i18next-scanner: count=1, file="Example.tsx"
✨  Done in 6.30s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant