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

feat(vite-plugin): Add strict option to vite plugin #2192

Closed
wants to merge 4 commits into from

Conversation

hahn-kev
Copy link

@hahn-kev hahn-kev commented Mar 6, 2025

Description

Adds a new config option to the vite plugin to allow passing strict: true to the compile step. We'd like to have CI builds fail if there's missing translations but this option was hard coded.

Example:

const config: UserConfig = {
  plugins: [lingui({strict: true})],
};

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Note

I added a test, however these tests don't run on windows so I'm not able to run the test on my machine.
There's no docs for the vite plugin config so I'm not sure where this new option should be documented.

I recognize that there's not an issue for this, however this is such a minor change I figured I'd just do it rather than making an issue ahead of time.

Copy link

vercel bot commented Mar 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
js-lingui ✅ Ready (Inspect) Visit Preview Mar 11, 2025 11:04am

@hahn-kev hahn-kev changed the title Add strict option to vite plugin [feat] Add strict option to vite plugin Mar 6, 2025
@hahn-kev hahn-kev changed the title [feat] Add strict option to vite plugin feat(vite-plugin): Add strict option to vite plugin Mar 6, 2025
Copy link

github-actions bot commented Mar 6, 2025

size-limit report 📦

Path Size
packages/core/dist/index.mjs 2.91 KB (0%)
packages/detect-locale/dist/index.mjs 618 B (0%)
packages/react/dist/index.mjs 1.35 KB (0%)

@hahn-kev
Copy link
Author

Hum, I'm not sure what's going on, I don't know enough about how lingui works to write a good test for strict mode, does anyone have a suggestion?

@timofei-iatsenko
Copy link
Collaborator

Thanks for the contribution, i'll take it from there. Sorry for the late response.

@timofei-iatsenko
Copy link
Collaborator

Continue here #2198

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

Successfully merging this pull request may close these issues.

2 participants