Skip to content

Conversation

@kazupon
Copy link
Member

@kazupon kazupon commented Nov 26, 2025

Description

Linked Issues

Additional context

Summary by CodeRabbit

  • Refactor
    • Improved internal option resolution logic for better consistency.
    • Enhanced handling of default values to provide more predictable configuration behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Walkthrough

The options.ts file in the unplugin-vue-i18n core module receives minor formatting adjustments to the compositionOnly conditional logic and updates the include parameter handling to default to an empty array instead of potentially remaining undefined.

Changes

Cohort / File(s) Summary
Options Resolution Update
packages/unplugin-vue-i18n/src/core/options.ts
Reformatted compositionOnly conditional logic without altering behavior when moduleType is 'vue-i18n'. Modified include parameter to default to an empty array (options.include || []) before normalization, ensuring consistent non-undefined values in the resolved options.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single-file change with minimal scope and low complexity
  • Formatting adjustment carries no behavioral risk
  • Include defaulting is straightforward and low-impact

Poem

🐰 Formatting tidied, arrays aligned with care,
Include now defaults where it's needed there—
Options resolve with clarity and grace,
No undefined shadows left in this space!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: setting a default value for the include option in unplugin-vue-i18n, which matches the primary alteration in the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/530

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b994fb and d5e0cbd.

📒 Files selected for processing (1)
  • packages/unplugin-vue-i18n/src/core/options.ts (2 hunks)
🔇 Additional comments (2)
packages/unplugin-vue-i18n/src/core/options.ts (2)

30-34: Formatting change with no functional impact.

The reformatting of the compositionOnly ternary expression doesn't alter its behavior - the logic remains the same.


62-62: The asymmetry between include and exclude is intentional and correct.

The include option must default to [] because it's spread into an array at line 79 in resource.ts ([...include, customBlockInclude]). Spreading undefined would cause an error, so the default is necessary.

The exclude option intentionally remains undefined when not provided. This is passed directly to createFilter() from @rollup/pluginutils, which handles undefined to mean "no exclusions." This is confirmed by the explicit handling in resolveIncludeExcludeForLegacy() (line 88), which deliberately constructs undefined for exclude. This is idiomatic in the Rollup ecosystem.

No changes required.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kazupon kazupon added the improvement Includes backwards-compatible fixes label Nov 26, 2025
@kazupon
Copy link
Member Author

kazupon commented Nov 26, 2025

@coderabbitai
Please review it!

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

@kazupon I'll review the changes in this PR right away!

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kazupon kazupon merged commit 2e9abb1 into v11 Nov 26, 2025
19 checks passed
@kazupon kazupon deleted the fix/530 branch November 26, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Includes backwards-compatible fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants