Skip to content

Clear the vue-tsc baseline - #338

Merged
paulocastellano merged 1 commit into
mainfrom
fix/vue-tsc-baseline
Sep 7, 2026
Merged

Clear the vue-tsc baseline#338
paulocastellano merged 1 commit into
mainfrom
fix/vue-tsc-baseline

Conversation

@paulocastellano

Copy link
Copy Markdown
Contributor

npx vue-tsc --noEmit -p tsconfig.json reported six errors on main; it reports none now. None of them were in the repurpose module, so #335 left them where they were.

The mechanical four

  • PostPlatformMetrics.vue:113,129:stroke="1.75" binds a number and @tabler/icons-vue types stroke as a string. Every other icon in the app passes stroke-width as a plain attribute; these two were the only ones using :stroke, so they now match the rest.
  • useWebhookLogs.ts:85router.reload({ only: ['logs'], preserveScroll: true }). Inertia declares ReloadOptions = Omit<VisitOptions, 'preserveScroll' | 'preserveState'> because a reload always preserves both. The option was inert; dropping it changes nothing at runtime.
  • welcome/Connect.vue:56form.errors.connect on a useForm({}). That error is added by StoreWelcomeConnectRequest::withValidator, so it never was a form field. It now comes from usePageErrors(), which is how the platform settings panels already read errors with no matching field.

The two that needed a decision

posts/Edit.vue:287,328 — the router.put payload carries media, and MediaItem.source_meta was Record<string, unknown>, which cannot satisfy FormDataConvertible.

A cast would have silenced it without fixing anything. But FormDataConvertible accepts records and arrays recursively — the only thing it rejects is unknown. Checking what source_meta actually carries (TemplateImageGenerator.php:143, RegeneratePostMediaImage.php, and the Unsplash/Giphy pickers in GalleryBrowser.vue): strings, numbers, and lists of strings under keywords. So the type says that:

export type SourceMetaValue = string | number | boolean | null | SourceMetaValue[];

GalleryBrowser.vue had its own copy of the field declared as Record<string, unknown>; it imports the shared type now instead.

Test

Moving where Connect.vue reads its error had no coverage — WelcomeControllerTest asserts assertSessionHasErrors('connect') three times, but nothing asserted the page renders it. The continue button stays disabled until an account connects, so the error only reaches the screen when the account disappears between page load and submit; the new browser test does exactly that. Confirmed it catches a break: replacing the message with undefined fails it.

Verification

vue-tsc 6 → 0
PostgreSQL 4390 passing, 1 skipped
Browser 43 passing (was 42)
pint --test, eslint clean

Closes #337

Six type errors had been sitting in the baseline. Four were mechanical:

PostPlatformMetrics bound stroke as a number, and @tabler/icons-vue types
that prop as a string. Every other icon in the app passes stroke-width as a
plain attribute, so these two now match.

useWebhookLogs passed preserveScroll to router.reload. Inertia declares
ReloadOptions as VisitOptions minus preserveScroll and preserveState
precisely because a reload always keeps both, so the option never did
anything.

Connect.vue read form.errors.connect from a useForm({}). The connect error
comes from StoreWelcomeConnectRequest's withValidator, not from a field, so
it reads from usePageErrors — where the platform settings panels already
read the errors that have no matching form field.

The last two needed a type, not a cast. FormDataConvertible accepts records
and arrays recursively; the only thing it cannot take is unknown. What
source_meta actually holds is strings, numbers and lists of strings, so it
says that now, and the gallery's private copy of the field imports the type
instead of redeclaring it.

Moving where Connect.vue reads its error had nothing covering it — the
backend asserts the error three times, the page not once. The button is
disabled until an account connects, so the error only surfaces when the
account disappears between load and submit, which is what the new browser
test does.

Closes #337
@paulocastellano
paulocastellano merged commit 59ee9e0 into main Sep 7, 2026
5 checks passed
@paulocastellano
paulocastellano deleted the fix/vue-tsc-baseline branch September 7, 2026 20:06
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.

Clear the vue-tsc baseline (6 errors)

1 participant