Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Sveltekit Snippets for +KitNew to Visual Studio Code? Get it now.
Sveltekit Snippets for +Kit

Sveltekit Snippets for +Kit

GarlandCrow

|
873 installs
| (0) | Free
| Sponsor
snippets for sveltekit since the pluskit changes
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-svelte-pluskit-snippets

Visual Studio Marketplace Version

Adds starter snippets for:

  • +page.ts
  • +page.server.ts
  • +page.svelte
  • +layout.ts
  • +layout.server.ts
  • +layout.svelte
  • +server.ts
  • +error.svelte

with the types imported and the common exported things, for example:

+page.ts

import { error, invalid, redirect } from "@sveltejs/kit";
import type { PageServerLoad, Actions } from "./$types";

export const load: PageServerLoad = async function (event) {
  return {};
};

export const actions: Actions = {
  default: async (event) => {
    return {};
  },
};

OK, and here's the really nice part, it adds a keyboard shortcut cmd+k n that automatically inserts the snippet that corresponds to the file you are in (make sure its blank). So you don't have to remember all the boilerplate for each file just create the file and cmd+k n in whatever file type of +kit.

File an issue here if there are more templates to be added or more things you think should be in the templates by default.

Sponsors

License

MIT License © 2022 Garland Crow

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft