Conversation
📝 WalkthroughWalkthroughExtends the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
Deploying vue-i18n-next with
|
| Latest commit: |
a1ce118
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3dd15f68.vue-i18n-next.pages.dev |
| Branch Preview URL: | https://fix-1113.vue-i18n-next.pages.dev |
Size ReportBundles
Usages
|
@intlify/core
@intlify/core-base
@intlify/devtools-types
@intlify/message-compiler
petite-vue-i18n
@intlify/shared
vue-i18n
@intlify/vue-i18n-core
commit: |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/vue-i18n/src/vue.d.ts (1)
497-509: JSDoc param descriptions for$dshould mention string inputs.All
$doverloads (including this base one) describevalueas "A value, timestamp number orDateinstance" but string/ISO 8601 is now a valid input type per this PR. This inconsistency will surface in IDE tooltips.📝 Suggested JSDoc update (applies to all `$d` overload doc blocks)
- * `@param` value - A value, timestamp number or `Date` instance + * `@param` value - A value, timestamp number, `Date` instance, or ISO 8601 date string🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/vue-i18n/src/vue.d.ts` around lines 497 - 509, Update the JSDoc for the $d datetime formatter (and all its overloads) to document that the value parameter accepts string inputs (e.g., ISO 8601) in addition to a timestamp number or Date; specifically, modify the `@param` description for $d (and references like Composer#d) to read something like "A value — timestamp number, Date instance, or ISO 8601/string" so IDE tooltips reflect the actual accepted types.packages/vue-i18n-core/test/composer.test-d.ts (1)
346-351: Test coverage for string inputs is incomplete — missing the(value, key, locale)overload and thepart: truereturn type.The added tests cover
d(string),d(string, key), andd(string, options)— but skip:
d(string, key, locale)— the 3-arg overload whose signature was widenedd(string, { ..., part: true })— to confirm theIsPartconditional return type (Intl.DateTimeFormatPart[]) still works with string inputs✅ Suggested additional test cases
expectTypeOf( strictDirectComposer.d('2022-08-08T08:56:45.846Z', { key: 'short', locale: 'zh' }) ).toEqualTypeOf<string>() + expectTypeOf( + strictDirectComposer.d('2022-08-08T08:56:45.846Z', 'short', 'ja-JP') + ).toEqualTypeOf<string>() + expectTypeOf( + strictDirectComposer.d('2022-08-08T08:56:45.846Z', { + key: 'short', + locale: 'zh', + part: true + }) + ).toEqualTypeOf<Intl.DateTimeFormatPart[]>()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/vue-i18n-core/test/composer.test-d.ts` around lines 346 - 351, Add tests for the missing d overloads on strictDirectComposer: call strictDirectComposer.d('2022-08-08T08:56:45.846Z', 'short', 'zh') and assert its type is string; also call strictDirectComposer.d('2022-08-08T08:56:45.846Z', { key: 'short', locale: 'zh', part: true }) and assert its type is Intl.DateTimeFormatPart[] (or the library's IsPart result) to verify the (value, key, locale) 3-arg overload and the part:true conditional return type are covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/vue-i18n-core/test/composer.test-d.ts`:
- Around line 346-351: Add tests for the missing d overloads on
strictDirectComposer: call strictDirectComposer.d('2022-08-08T08:56:45.846Z',
'short', 'zh') and assert its type is string; also call
strictDirectComposer.d('2022-08-08T08:56:45.846Z', { key: 'short', locale: 'zh',
part: true }) and assert its type is Intl.DateTimeFormatPart[] (or the library's
IsPart result) to verify the (value, key, locale) 3-arg overload and the
part:true conditional return type are covered.
In `@packages/vue-i18n/src/vue.d.ts`:
- Around line 497-509: Update the JSDoc for the $d datetime formatter (and all
its overloads) to document that the value parameter accepts string inputs (e.g.,
ISO 8601) in addition to a timestamp number or Date; specifically, modify the
`@param` description for $d (and references like Composer#d) to read something
like "A value — timestamp number, Date instance, or ISO 8601/string" so IDE
tooltips reflect the actual accepted types.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/vue-i18n-core/test/composer.test-d.tspackages/vue-i18n/src/vue.d.tspackages/vue-i18n/src/vue.ts
resolve #1113
related #2098
Summary by CodeRabbit