This Extension adds snippets for SvelteKit.
Snippets for javascript
and typescript
.
Example:
$import
will expand to:
import {} from "@sveltejs/kit";
$get
in Javascript will expand to:
/** @type {import("./$types").RequestHandler} */
export function GET(event) {
return json({});
}
$get
in Typescript will expand to:
export const GET = ((event) => {
return json({});
}) satisfies RequestHandler;
$pagedata
in Javascript will expand to:
/** @type {import("./$types").PageData} */
export let data;
$pagedata
in Typescript will expand to:
import type { PageData } from "./$types";
export let data: PageData;
Many other snippets like:
$import
, $get
, $post
, $patch
, $put
, $delete
, $pageload
, $pageserverload
, $pagedata
, $layoutload
, $layoutserverload
, $layoutdata
, $actions
, $handle
, $handlefetch
, $handleservererror
, $handleclienterror
, $environment
, $forms
, $navigation
, $paths
, $stores
, $envstaticpublic
, $envstaticprivate
, $envdynamicpublic
, $envdynamicprivate
, $serviceworker
, $hooks
, $node
, $polyfills
, $vite
, $lib
, $internal
Fixed example on documentation
Added $actions
, $handle
, $handlefetch
, $handleservererror
, $handleclienterror
, $layoutload
, $layoutserverload
Added hints in snippets descriptions about in what files each snippet "should" be used most commonly (When applicable)
Fixed minor error on documentation
Added Issues Tracker to the documentation
Added basic support for TypeScript
Better documentation on README.md
Initial release of Svelte Snippets by MrAmericanMike
Do you have a request or idea for the extension. Please post it on our Discussion Board on GitHub
Please report any issues on GitHub Issues Tracker
Determine if it's possible for a snippets extension to have a configuration option and use it so the final user can decide if they want single or double quotes