Giter VIP home page Giter VIP logo

vscode-svelte-pluskit-snippets's Introduction

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

vscode-svelte-pluskit-snippets's People

Forkers

zerokurns

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.