Fix TS errors in the site - #419
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR primarily addresses TypeScript/svelte-check issues in the documentation site and helper modules by tightening JSDoc typing, improving DOM typing in Svelte pages, and adding a site-scoped type-check command.
Changes:
- Add/adjust JSDoc annotations and a few small runtime-safe casts to satisfy
checkJs/TypeScript across routes and helper modules. - Add a dedicated
check:sitecommand (scripts/check-site.js) plusjsconfig.site.jsonto type-check site code while excluding library and demo/example content. - Replace a dependency helper (
readdirFilterSyncfromindian-ocean) with a small local implementation in the components JSON endpoint.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes/guide/+page.svelte | Adds DOM/JSDoc typing and safer container guards. |
| src/routes/guide.json/+server.js | Types cached getSections() result. |
| src/routes/example/[slug]/+page.svelte | Adds JSDoc typings for markdown/highlight helpers. |
| src/routes/example/[slug].json/+server.js | Adds JSDoc param typing to helpers used to parse example files. |
| src/routes/example-ssr/[slug]/+page.svelte | Adds JSDoc typings for markdown/highlight helpers. |
| src/routes/example-ssr/[slug].json/+server.js | Adds JSDoc param typing and RequestHandler typing. |
| src/routes/components/+page.svelte | Adds JSDoc typings and DOM typing/guards for TOC behavior. |
| src/routes/components/[slug]/+page.svelte | Adds JSDoc typings in parsing/format helpers. |
| src/routes/components/[slug].json/+server.js | Removes indian-ocean usage and adds local readdirFilterSync + more JSDoc typing. |
| src/routes/api/guide-sections.json/+server.js | Types cached getSections() result. |
| src/routes/_site-components/Nav.svelte | Adds JSDoc typing for slimName. |
| src/routes/_site-components/GuideContents.svelte | Adds JSDoc typing for sections.map(...). |
| src/routes/_site-components/DownloadComponentBtn.svelte | Adds JSDoc typing for modules.map(...). |
| src/routes/_site-components/DownloadBtn.svelte | Adds JSDoc typing for reducers/loops and dependency lookups. |
| src/_modules/slugify.js | Adds function JSDoc signature for better TS inference. |
| src/_modules/processMarkdown.js | Adds function and local variable JSDoc typing. |
| src/_modules/hljsDefineSvelte.js | Adds JSDoc typing for hljs parameter. |
| src/_modules/getSections.js | Adds JSDoc typing, improves reduce typing, and adjusts hash lookup typing. |
| src/_modules/downloadBlob.js | Adds JSDoc typing and casts for Blob handling. |
| src/_modules/constructReplLink.js | Adds JSDoc typing and null-safe filename extraction. |
| src/_modules/cleanTitle.js | Adds function JSDoc signature for better TS inference. |
| src/_modules/calcThresholds.js | Adds JSDoc and defaults n to avoid undefined math. |
| src/_modules/arrowUtils.js | Adds JSDoc typing/casts to satisfy checkJs. |
| scripts/check-site.js | New script to run and post-filter svelte-check results for site-only code. |
| package.json | Adds check:site script entry. |
| jsconfig.site.json | Adds site-only jsconfig extending base config with excludes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Fixes some typescript errors to the documentation and some helper modules.