Skip to content

gitignore .svelte-kit, add lean root tsconfig.json#25

Open
familiarcow wants to merge 1 commit into
mainfrom
svelte-kit-gitignore-and-tsconfig
Open

gitignore .svelte-kit, add lean root tsconfig.json#25
familiarcow wants to merge 1 commit into
mainfrom
svelte-kit-gitignore-and-tsconfig

Conversation

@familiarcow

Copy link
Copy Markdown
Owner

Summary

Replaces #22 with a focused fix:

  • Adds `.svelte-kit/` to `.gitignore` and removes it from tracking (it's autogenerated by SvelteKit, was drifting on every dev/build)
  • Adds a minimal root `tsconfig.json` extending the SvelteKit-generated one with `verbatimModuleSyntax: true` — silences the warning that prints on every build today
The TypeScript option verbatimModuleSyntax is now required when using
Svelte files with lang="ts". Please add it to your tsconfig.json.

That warning is real: `Affiliates.svelte` and `TokenWhitelist.svelte` use `<script lang="ts">`. Verified the warning is gone after this change.

Why not merge #22 as-is

#22 bundled three things; this PR keeps the one that fixes the actual problem and drops the rest:

Change in #22 Decision
Add root `tsconfig.json` with `verbatimModuleSyntax` Kept
Rebuild 470 lines of `.svelte-kit/` autogen Dropped — band-aid; gitignoring is the real fix
Add `strict: true` + `checkJs: true` + `isolatedModules` Dropped — would lock 2319 svelte-check errors in as the IDE/CI baseline. Worth a separate, deliberate decision.

Credits @koitsu for identifying the warning fix; closing #22 in favor of this.

Test plan

  • `npx vite build` succeeds with no `verbatimModuleSyntax` warning
  • `npx svelte-check` no longer prints the `verbatimModuleSyntax` warning
  • `.svelte-kit/` is gitignored (verified via `git status` — fresh dev run no longer shows tracked deletions)
  • Run `npm run dev` locally and visit a few pages to confirm runtime behavior matches main

The .svelte-kit/ directory is regenerated on every dev/build run, but it was
tracked in git — the working tree has been showing autogen drift since we
started. Add it to .gitignore and remove it from tracking.

Add a minimal root tsconfig.json that extends the SvelteKit-generated one
and sets verbatimModuleSyntax: true. This silences the warning printed on
every build:

  The TypeScript option verbatimModuleSyntax is now required when using
  Svelte files with lang="ts". Please add it to your tsconfig.json.

(Affiliates.svelte and TokenWhitelist.svelte use lang="ts", so the warning
is real today.)

Replaces the autogen-rebuild approach in #22 with the underlying fix, and
deliberately omits the strict / checkJs / isolatedModules options from
that PR — those would lock in 2300+ existing svelte-check errors as the
new IDE baseline, which is a significant policy change that deserves its
own decision.

Co-authored-by: koitsu <jdc@koitsu.org>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rune-tools with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0c914fc
Status:🚫  Build failed.

View logs

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.

1 participant