Skip to content

Fix TS errors in the site - #419

Merged
mhkeller merged 12 commits into
mainfrom
chore/ts-fixes
Jul 18, 2026
Merged

Fix TS errors in the site#419
mhkeller merged 12 commits into
mainfrom
chore/ts-fixes

Conversation

@mhkeller

Copy link
Copy Markdown
Owner

Fixes some typescript errors to the documentation and some helper modules.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:site command (scripts/check-site.js) plus jsconfig.site.json to type-check site code while excluding library and demo/example content.
  • Replace a dependency helper (readdirFilterSync from indian-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.

Comment thread src/routes/example/[slug]/+page.svelte
Comment thread src/routes/example-ssr/[slug]/+page.svelte Outdated
Comment thread src/routes/example/[slug]/+page.svelte Outdated
Comment thread scripts/check-site.js
Comment thread scripts/check-site.js Outdated
mhkeller and others added 7 commits July 17, 2026 19:28
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Comment thread src/_modules/arrowUtils.js Outdated
Comment thread src/routes/_site-components/Nav.svelte Outdated
Comment thread src/routes/components/+page.svelte Outdated
Comment thread scripts/check-site.js
mhkeller and others added 4 commits July 17, 2026 19:51
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>
@mhkeller
mhkeller merged commit e7b421e into main Jul 18, 2026
5 checks passed
@mhkeller
mhkeller deleted the chore/ts-fixes branch July 18, 2026 01:10
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.

2 participants