Skip to content
Tutorials Center
My learning

Topics

Lesson 39 of 40 ยท Projects and Practice

Project: Team Configuration and Onboarding

Design a shared VS Code setup for a team: a multi-root workspace, dev container, settings policy, profiles, onboarding checklist and automated checks.

A single developer can keep a perfect editor setup in their head. A team cannot. When five people each configure VS Code differently, you get noisy diffs from different formatters, "works on my machine" bugs and a slow first day for every newcomer. In this project you will design a team configuration: what belongs in the repository, what stays personal, and how to check that a new setup is right.

The result is a plan with files you can adapt. Nothing here runs inside VS Code on this site; the stand-ins model a settings policy checker and an onboarding checklist in JavaScript.

Decide what is shared and what is personal

Shared (commit it) Personal (do not commit)
Formatter and linter config (.prettierrc, eslint.config.js) Color theme, fonts, icon theme
.editorconfig Keyboard shortcuts
.vscode/extensions.json Zoom level, minimap, UI layout
.vscode/tasks.json, launch.json Personal snippets
.vscode/settings.json for project rules (format on save, exclude folders) Paths to your own tools
.devcontainer/devcontainer.json SSH hosts and secrets
Project snippets (.code-snippets) Settings Sync data

A simple rule: if it changes what the code looks like or how it is built and run, share it. If it changes what the editor looks like to you, keep it personal. The layered settings model from custom themes and profiles makes this possible: workspace settings override user settings only for the keys the project sets.

Add a .gitignore entry for personal files in .vscode, but keep shared ones:

TEXT
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/*.code-snippets

A multi-root workspace for a front end and an API

If the product has two repositories, put a workspace file in a third place (or in one of them) so one click opens both:

JSON
{
  "folders": [
    { "name": "Web", "path": "../web" },
    { "name": "API", "path": "../api" }
  ],
  "settings": {
    "files.exclude": { "**/node_modules": true },
    "window.title": "${rootName} - ${activeEditorShort}"
  },
  "extensions": { "recommendations": ["esbenp.prettier-vscode"] }
}

Workspace-level extensions recommendations work like extensions.json. Tasks can also live inside a .code-workspace file, under a "tasks" key.

A dev container as the source of truth

For the exact same toolchain, add a dev container:

JSON
{
  "name": "Team project",
  "image": "mcr.microsoft.com/devcontainers/javascript-node:22",
  "postCreateCommand": "npm ci",
  "forwardPorts": [3000],
  "customizations": {
    "vscode": {
      "extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"],
      "settings": { "editor.formatOnSave": true }
    }
  }
}

Use npm ci rather than npm install in automation: it installs exactly what the lock file says. Then the editor, the container and the CI server all read one set of configuration files.

Make style a tool, not a debate

  1. Pick one formatter and run it on save and in CI. Code review is then about design, not spaces.
  2. Keep lint rules in config files; do not rely on each person's settings.
  3. Use pre-commit checks (for example a Git hook tool) as a second safety net; the editor is a convenience, the hook and CI are the guarantee.
  4. Document why a rule exists, in a short CONTRIBUTING.md.

Security considerations

  • Workspace Trust: when someone opens a folder, VS Code asks if they trust its authors. Tasks, debug configurations and some extensions can run code, so Restricted Mode matters. Tell newcomers to read the prompt, not click through it.
  • Do not auto-run tasks from untrusted folders. runOptions.runOn: "folderOpen" is convenient but runs only in trusted workspaces; use it carefully.
  • Secrets: keep them out of settings.json, launch.json (env entries) and the dev container. Use environment files that are ignored by Git, or a secret manager.
  • Extensions: recommend only reviewed extensions, from verified publishers. See installing and managing extensions.

The onboarding checklist

A newcomer's first day should be a list, not a scavenger hunt:

  1. Install VS Code, Git and (if used) Docker.
  2. Clone the repository and open it (or Reopen in Container).
  3. Accept the recommended extensions.
  4. Run the check task (Ctrl+Shift+B). It must pass on a fresh clone.
  5. Press F5 and hit a breakpoint.
  6. Make a small change, see it formatted on save and commit it with a clear message.
  7. Read CONTRIBUTING.md.

If step 4 fails on a fresh clone, fix the repository, not the newcomer.

flowchart LR
    A["Clone"] --> B["Open / Reopen in Container"]
    B --> C["Install recommended extensions"]
    C --> D["Run check task"]
    D --> E["F5 debug"]
    E --> F["First commit"]

The onboarding path should be the same for everyone.

Runnable stand-ins

JS Stand-in: settings policy checker

Press Run (or Ctrl + Enter) to see the console output here.

No output.

JS Stand-in: onboarding progress

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which of these belongs in shared project configuration?

    Rules that change how code is formatted or built are shared; appearance and personal shortcuts are not.
  2. 2. Why use npm ci in a dev container's postCreateCommand?

    npm ci is deterministic: it installs the locked dependency versions.
  3. 3. What is the guarantee that style rules are followed?

    Editors are convenient, but hooks and CI enforce the rules.
  4. 4. What should you do if the check task fails on a fresh clone?

    A fresh clone should work; a failure is a bug in the shared setup.

Summary

  • Share what affects code and builds; keep personal appearance and shortcuts personal.
  • Use .vscode files, .code-workspace, .editorconfig and a dev container as the single source of truth.
  • Enforce style with tools in CI and hooks, not with debates.
  • Respect Workspace Trust, avoid secrets in config and recommend vetted extensions only.
  • Test onboarding on a fresh clone and keep a short checklist.

Next: Practice, Troubleshooting and Cheat Sheet