Clear the vue-tsc baseline - #338
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
npx vue-tsc --noEmit -p tsconfig.jsonreported 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-vuetypesstrokeas a string. Every other icon in the app passesstroke-widthas a plain attribute; these two were the only ones using:stroke, so they now match the rest.useWebhookLogs.ts:85—router.reload({ only: ['logs'], preserveScroll: true }). Inertia declaresReloadOptions = Omit<VisitOptions, 'preserveScroll' | 'preserveState'>because a reload always preserves both. The option was inert; dropping it changes nothing at runtime.welcome/Connect.vue:56—form.errors.connecton auseForm({}). That error is added byStoreWelcomeConnectRequest::withValidator, so it never was a form field. It now comes fromusePageErrors(), 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— therouter.putpayload carriesmedia, andMediaItem.source_metawasRecord<string, unknown>, which cannot satisfyFormDataConvertible.A cast would have silenced it without fixing anything. But
FormDataConvertibleaccepts records and arrays recursively — the only thing it rejects isunknown. Checking whatsource_metaactually carries (TemplateImageGenerator.php:143,RegeneratePostMediaImage.php, and the Unsplash/Giphy pickers inGalleryBrowser.vue): strings, numbers, and lists of strings underkeywords. So the type says that:GalleryBrowser.vuehad its own copy of the field declared asRecord<string, unknown>; it imports the shared type now instead.Test
Moving where
Connect.vuereads its error had no coverage —WelcomeControllerTestassertsassertSessionHasErrors('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 withundefinedfails it.Verification
vue-tscpint --test,eslintCloses #337