Sveltekit Typescript Showcase screenshot

Sveltekit Typescript Showcase

Author Avatar Theme by Ivanhofer
Updated: 10 Jul 2023
727 Stars

This repository shows how Svelte and SvelteKit work together with TypeScript.

Categories

Overview

This repository showcases how Svelte and SvelteKit work together with TypeScript. It aims to provide an overview of all TypeScript-related topics for Svelte and SvelteKit. The creator, Ivan, is a passionate web developer who has recently been working extensively with TypeScript and has created an internationalization library called typesafe-i18n. Ivan has created this repository to share examples and improve the developer experience with TypeScript in Svelte projects.

Features

  • Project Setup: Tips for setting up the project with the official Svelte extension for VS Code and the Error Lens extension.
  • Examples: Demonstrations of TypeScript + Svelte in action.
  • TypeScript Tips: Tips for increasing type safety in projects.
  • JSDoc comments: How to benefit from type-checking without writing TypeScript code.

Installation

To set up the project, follow these steps:

  1. Install Visual Studio Code as your IDE.
  2. Install the official Svelte extension for VS Code.
  3. Install the Error Lens extension for code error visualization.
  4. Create a new SvelteKit project using the “Getting Started” guide in the official documentation.
  5. Use the command npm init svelte my-app and select the TypeScript option during the interactive project setup process.
  6. Enable the eslint and prettier options.
  7. Configure TypeScript in the root of the generated folder by modifying the tsconfig.json file. Enable strict options for advanced type-checking features.

Summary

This repository showcases the integration of Svelte and SvelteKit with TypeScript. It provides examples and tips to improve the developer experience and increase type safety in Svelte projects. The installation guide helps set up the project with the necessary extensions and configurations. Overall, this repository aims to support developers in building real business applications confidently using Svelte and TypeScript.