Skip to content

prisma-labs/vscode-next

Repository files navigation

Prisma-Nextjs

Visual Studio Code extension

Features

Automatically adds types to your Next.js page components if you use getStaticSideProps or getServerSideProps. The returned types can not be automatically inferred and passed to the page.

This extension also enables type safety in js code by leveraging JsDocs.


Requirements

A Project with next as a dependency in your package.json

Extension Settings

Name Description Default
WillLuke.nextjs.root Option to set the path to a nextjs project
WillLuke.nextjs.hasPrompted Hides Autotypes Prompt if it has been shown false
WillLuke.nextjs.addTypesOnSave Automatically add NextJS page types on save false
WillLuke.debug Debug the Extension false

Trying it out

git clone https://github.com/williamluke4/vscode-next-types-example
yarn
  • Open VSCode
  • Accept Autotypes Prompt

  • Navigate to pages/songs/[id].tsx or pages/ssr-songs/[id].jsx
  • Hit Save ctrl-s or ctrl-p then search types

Known Issues

  • Workspaces not Supported

Development

Installing

git clone https://github.com/prisma-labs/vscode-next.git
cd vscode-next
yarn

Debugging/Developing

Use VSCode built in debugger and select Run Extension

Packaging

yarn pkg

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published