We use tracking cookies to understand how you use the product and help us improve it. For more information on how we store cookies, read our  privacy policy.

IDE

VS Code configuration and recommended extensions

Plainform includes VS Code configuration for consistent formatting, debugging, and development experience.

Install these extensions for the best development experience:

Essential:

  • ESLint (dbaeumer.vscode-eslint) - Linting and auto-fix
  • Prettier (esbenp.prettier-vscode) - Code formatting
  • Tailwind CSS IntelliSense (bradlc.vscode-tailwindcss) - Tailwind autocomplete

Highly Recommended:

  • Prisma (Prisma.prisma) - Database schema syntax
  • MDX (unifiedjs.vscode-mdx) - MDX file support
  • TypeScript Error Translator (mattpocock.ts-error-translator) - Better TS errors
  • Pretty TypeScript Errors (yoavbls.pretty-ts-errors) - Readable type errors

Optional:

  • GitLens (eamodio.gitlens) - Git history and blame
  • Error Lens (usernamehw.errorlens) - Inline error display
  • Import Cost (wix.vscode-import-cost) - Bundle size awareness

Create .vscode/extensions.json to recommend extensions to your team.

VS Code Settings

The .vscode/settings.json file configures formatting and linting:

.vscode/settings.json
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll": "explicit"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "typescript.autoClosingTags": false
}

What this does:

  • Formats code with Prettier on save
  • Auto-fixes ESLint issues on save
  • Uses Prettier for .tsx and .json files
  • Disables auto-closing tags (personal preference)

Debugging Configuration

The .vscode/launch.json provides three debug modes:

Server-side debug config
{
  "name": "Next.js: debug server-side",
  "type": "node-terminal",
  "request": "launch",
  "command": "npm run dev"
}

Debug Server Components, API routes, and server-side code.

Use when: Debugging data fetching, API logic, middleware

Client-side debug config
{
  "name": "Next.js: debug client-side",
  "type": "chrome",
  "request": "launch",
  "url": "http://localhost:3000"
}

Debug Client Components and browser JavaScript.

Use when: Debugging React hooks, event handlers, client state

Full stack debug config
{
  "name": "Next.js: debug full stack",
  "type": "node-terminal",
  "request": "launch",
  "command": "npm run dev",
  "serverReadyAction": {
    "pattern": "- Local:.+(https?://.+)",
    "uriFormat": "%s",
    "action": "debugWithChrome"
  }
}

Debug both server and client simultaneously.

Use when: Debugging full request flow, SSR issues

How to Debug

  1. Set breakpoints by clicking left of line numbers
  2. Press F5 or click "Run and Debug" in sidebar
  3. Select debug configuration
  4. Code pauses at breakpoints
  5. Inspect variables, step through code

Use debugger; statement to programmatically trigger breakpoints.

Useful Shortcuts

ActionWindows/LinuxMac
Command PaletteCtrl+Shift+PCmd+Shift+P
Quick OpenCtrl+PCmd+P
Format DocumentShift+Alt+FShift+Option+F
Go to DefinitionF12F12
Find ReferencesShift+F12Shift+F12
Rename SymbolF2F2
Toggle TerminalCtrl+`Cmd+`
Multi-cursorCtrl+Alt+↓Cmd+Option+↓

Workspace Settings

Add these to your personal settings.json for better DX:

Personal settings.json
{
  // Auto-save files
  "files.autoSave": "onFocusChange",
  
  // Organize imports on save
  "editor.codeActionsOnSave": {
    "source.organizeImports": "explicit"
  },
  
  // Tailwind CSS sorting
  "tailwindCSS.experimental.classRegex": [
    ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
    ["cn\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
  ],
  
  // TypeScript settings
  "typescript.preferences.importModuleSpecifier": "relative",
  "typescript.updateImportsOnFileMove.enabled": "always",
  
  // File nesting (cleaner explorer)
  "explorer.fileNesting.enabled": true,
  "explorer.fileNesting.patterns": {
    "*.ts": "${capture}.test.ts, ${capture}.spec.ts",
    "*.tsx": "${capture}.test.tsx, ${capture}.spec.tsx"
  }
}

Troubleshooting

Next Steps

How is this guide ?

Last updated on