IDE
VS Code configuration and recommended extensions
Plainform includes VS Code configuration for consistent formatting, debugging, and development experience.
Recommended Extensions
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:
{
"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
.tsxand.jsonfiles - Disables auto-closing tags (personal preference)
Debugging Configuration
The .vscode/launch.json provides three debug modes:
{
"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
{
"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
{
"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
- Set breakpoints by clicking left of line numbers
- Press
F5or click "Run and Debug" in sidebar - Select debug configuration
- Code pauses at breakpoints
- Inspect variables, step through code
Use debugger; statement to programmatically trigger breakpoints.
Useful Shortcuts
| Action | Windows/Linux | Mac |
|---|---|---|
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Quick Open | Ctrl+P | Cmd+P |
| Format Document | Shift+Alt+F | Shift+Option+F |
| Go to Definition | F12 | F12 |
| Find References | Shift+F12 | Shift+F12 |
| Rename Symbol | F2 | F2 |
| Toggle Terminal | Ctrl+` | Cmd+` |
| Multi-cursor | Ctrl+Alt+↓ | Cmd+Option+↓ |
Workspace Settings
Add these to your personal settings.json for better DX:
{
// 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
- Environment Variables - Configure your environment
- Git Workflow - Commit conventions and hooks
- Build & Deploy - Production deployment
How is this guide ?
Last updated on