Dev tools and workflow · Beginner · 15 min
Set up VS Code for a team project with workspace settings, tasks and recommended extensions
By Padding · Updated 18 Nov 2026
VS Code 1.148 (stable, November 2026) · Node.js 26 · macOS, Windows or Linux
You will have a small Node.js project whose committed .vscode folder gives every teammate the same formatter, extension prompts, test and lint tasks and a working debug configuration.
On this page
When four people open the same repository in VS Code, they often get four different results. One editor formats with Prettier on save, another reflows nothing, a third has a different tab width, and nobody can remember how to start the debugger. The fix is a small .vscode folder committed next to the code. VS Code reads it whenever someone opens the folder, so the project, not each person's habits, decides how the editor behaves.
In this tutorial you build a tiny Node.js project and give it four shared files: settings.json for formatting and file rules, extensions.json for the extensions the project needs, tasks.json for running tests and lint, and launch.json for debugging. You then keep your own preferences in a profile so they never leak into the repository, and decide what belongs in Git.
The settings here use VS Code 1.148, the stable release in November 2026. The file formats have been stable for years, so older and newer releases read them the same way.
Step 1 · Make a small project to configure
You need something real for the settings to act on. Create a throwaway folder in your home directory, then install ESLint and Prettier as development dependencies so every teammate gets the same versions. On Windows, run these commands in Git Bash, which comes with Git for Windows; PowerShell and Command Prompt do not understand mkdir -p, cat <<'EOF' or rm -rf.
mkdir -p ~/vscode-team-demo/src ~/vscode-team-demo/test
cd ~/vscode-team-demo
git init
npm init -y
npm pkg set type=module
npm pkg set scripts.test="node --test" scripts.lint="eslint ." scripts.start="node src/index.js"
npm install --save-dev eslint@10.15.0 @eslint/js@10.0.1 globals@17.14.0 prettier@3.10.1Add an ESLint configuration, a small module, an entry point and a test:
cat > eslint.config.js <<'EOF'
import js from "@eslint/js";
import globals from "globals";
export default [
js.configs.recommended,
{ languageOptions: { globals: globals.node } },
];
EOF
cat > src/price.js <<'EOF'
export function totalWithTax(amount, rate) {
return Math.round(amount * (1 + rate) * 100) / 100;
}
EOF
cat > src/index.js <<'EOF'
import { totalWithTax } from "./price.js";
const basket = 2500;
const total = totalWithTax(basket, 0.075);
console.log(`Total: ${total}`);
EOF
cat > test/price.test.js <<'EOF'
import { test } from "node:test";
import assert from "node:assert/strict";
import { totalWithTax } from "../src/price.js";
test("adds 7.5% tax", () => {
assert.equal(totalWithTax(2500, 0.075), 2687.5);
});
EOF
echo '{ "singleQuote": true }' > .prettierrc.json
code .The last line opens the folder in VS Code. If code is not found, open VS Code and choose File > Open Folder, then pick ~/vscode-team-demo. On macOS you can add the command from the Command Palette with Shell Command: Install 'code' command in PATH.
The first time VS Code opens a new folder it asks whether you trust the authors of the files in it. You wrote them, so choose Yes, I trust the authors. If you choose not to, the folder opens in Restricted Mode, which turns off tasks, debugging, workspace settings and most extensions, and the checks in the steps below will not work. You can change your answer later with Workspaces: Manage Workspace Trust from the Command Palette.
The .prettierrc.json file asks for single quotes on purpose. The source files use double quotes, so you will see the formatter take over in the next step.
Check it worked
The Explorer on the left shows src, test, node_modules, eslint.config.js, package.json and .prettierrc.json. In the integrated terminal (View > Terminal), npm test reports one passing test.
Step 2 · Share formatting and file rules in settings.json
VS Code has two main levels of settings. User settings follow you into every project. Workspace settings live in .vscode/settings.json inside the project and win over user settings when that folder is open. Team rules go in the workspace file. Personal taste, such as your colour theme or font size, stays in user settings.
Open the Command Palette with Ctrl+Shift+P (Cmd+Shift+P on macOS), run Preferences: Open Workspace Settings (JSON), and replace its contents with this:
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.tabSize": 2,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"files.exclude": {
"coverage": true,
"**/*.log": true
}
}What each part does:
editor.formatOnSavewitheditor.defaultFormattermakes every save run the same formatter. The language blocks in square brackets apply only to that file type, so you can choose a different formatter for, say, Python files without affecting JavaScript.editor.codeActionsOnSaveasks the ESLint extension to apply its safe fixes on save."explicit"means it runs when you save by hand, not on auto-save after a delay.files.insertFinalNewlineandfiles.trimTrailingWhitespacestop noisy whitespace changes from appearing in pull requests.files.excludehides generated clutter from the Explorer and from Quick Open. It does not delete anything.
Prettier itself reads .prettierrc.json, so formatting rules such as quote style live there and work the same from the command line. The VS Code settings only say which tool runs and when. If the team also uses other editors, keep indentation and line endings in an EditorConfig file too; see share editor settings across editors with EditorConfig.
Some settings are ignored at workspace level on purpose: those about updates and security, and those that point to programs to run, such as git.path. A cloned repository cannot change them on your machine.
Check it worked
Open File > Preferences > Settings (Code > Settings on macOS) and select the Workspace tab. Search for format on save: the box is ticked, and the setting is marked as modified in the workspace. A file called settings.json now sits in a new .vscode folder in the Explorer. Formatting on save starts working once the Prettier extension is installed in the next step.
Step 3 · Recommend the extensions the project needs
The settings above name two extensions. A teammate without them would see nothing happen on save. A recommendations file makes VS Code offer to install them.
Run Extensions: Configure Recommended Extensions (Workspace Folder) from the Command Palette. It creates .vscode/extensions.json. Replace the contents with:
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}Each entry is an extension ID in the form publisher.extension. To find the ID of any other extension, open it in the Extensions view; the ID is shown on its details page.
Keep the list short. Recommend only what the project's settings and tasks depend on, not your favourite themes or tools. Each extension is a download for every new teammate, which matters for anyone working on prepaid mobile data or a slow connection.
Check it worked
Run Extensions: Show Recommended Extensions. The Extensions view opens with @recommended in its search box, and ESLint and Prettier appear under the workspace recommendations. Install both. Now open src/index.js, change nothing, and save with Ctrl+S (Cmd+S): the double quotes turn into single quotes, because Prettier ran with the project's .prettierrc.json.
Step 4 · Add test and lint tasks
VS Code already detects the scripts in package.json, but named tasks with problem matchers do more: they put lint errors in the Problems panel with links to the exact line, and they let everyone use the same keyboard shortcut.
Create .vscode/tasks.json with this content:
{
"version": "2.0.0",
"tasks": [
{
"label": "Test",
"type": "shell",
"command": "npm test",
"group": { "kind": "test", "isDefault": true },
"problemMatcher": []
},
{
"label": "Lint",
"type": "shell",
"command": "npm run lint",
"group": { "kind": "build", "isDefault": true },
"problemMatcher": ["$eslint-stylish"]
}
]
}labelis the name people see when they pick a task.groupputs Test in the test group and Lint in the build group. Making each the default means one shortcut runs it with no menu.$eslint-stylishis a problem matcher built into VS Code. It reads ESLint's default output format and turns each line into an entry in the Problems panel. The empty list on Test tells VS Code not to scan that output.
The tasks call the same npm scripts that continuous integration would run, so the editor and the pipeline cannot drift apart.
To see the matcher work, add an unused variable to src/index.js:
const unused = 1;Check it worked
You may notice the error before you run anything: the ESLint extension you installed in the last step already underlines unused and lists 'unused' is assigned a value but never used in the Problems panel as you type. Press Ctrl+Shift+B (Cmd+Shift+B) to run the default build task. The terminal panel opens a terminal tab for the Lint task, and ESLint prints the same message. The Problems panel may now list the error twice: the entry whose source is eslint-stylish comes from the task, and that is the proof the problem matcher worked. Click it to jump to the line. Delete the line and run the task again: the problem disappears. Then run Tasks: Run Test Task from the Command Palette and the test passes.
Step 5 · Add a debug configuration
A shared launch.json means nobody has to work out how to start the debugger. Open the Run and Debug view from the Activity Bar, select create a launch.json file, choose Node.js, and replace the generated file with:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run the app",
"program": "${workspaceFolder}/src/index.js",
"skipFiles": ["<node_internals>/**"]
},
{
"type": "node",
"request": "launch",
"name": "Debug the tests",
"program": "${workspaceFolder}/test/price.test.js",
"skipFiles": ["<node_internals>/**"]
}
]
}${workspaceFolder} stands for wherever the repository is on each person's computer. Never write a path such as /Users/ada/projects/... or C:\Users\... into a shared file: it works for you and fails for everyone else. skipFiles stops the debugger stepping into Node.js's own code.
Open src/price.js and click in the margin to the left of the return line. A red dot marks the breakpoint.
Check it worked
Pick Run the app in the dropdown at the top of the Run and Debug view and press F5. Execution stops on your breakpoint, the line is highlighted, and the Variables section shows amount: 2500 and rate: 0.075. Press F5 again to continue: the Debug Console prints Total: 2687.5. For a deeper look at debugging Node.js, see debug a Node.js app with the inspector.
Step 6 · Keep your personal setup in a profile
Shared settings cover the project. Your own extensions, theme and keyboard habits belong somewhere else. A profile is a named set of settings, extensions and keybindings, and VS Code can link one to a folder so it switches automatically.
Open File > Preferences > Profiles (Code > Settings > Profiles on macOS), or use the Manage gear at the bottom of the Activity Bar. Select New Profile, name it Node work, choose to copy from your Default profile or start empty, and select Create. With the demo folder open, the new profile becomes associated with it. Install anything personal, such as a theme, while this profile is active.
Profiles also help when you join a team whose recommended extensions conflict with ones you use elsewhere: install them only in the profile you use for that project. You can export a profile to a file or a private GitHub gist from its menu in the Profiles editor; machine-specific settings, such as local paths, are left out of the export.
Check it worked
In the Profiles editor, the Node work profile lists vscode-team-demo under Folders & Workspaces. Close the window and reopen the folder: the profile is active again, and Profiles: Switch Profile in the Command Palette shows it ticked. Open another folder and your Default profile is back.
Step 7 · Learn the commands that save the most time
You do not need hundreds of shortcuts. These cover most of a working day, and all of them are the defaults (Windows and Linux first, macOS second):
- Command Palette: Ctrl+Shift+P / Cmd+Shift+P. Every command in VS Code, by name. If you remember one shortcut, make it this one.
- Quick Open: Ctrl+P / Cmd+P. Type part of a file name to jump to it. Files hidden by
files.excludedo not appear. - Go to Definition: F12. Jump from a function call to where it is written.
- Rename Symbol: F2. Rename a function or variable everywhere it is used, not only in the current file.
- Toggle terminal: Ctrl+` on every system.
- Run build task and start debugging: Ctrl+Shift+B / Cmd+Shift+B and F5, which you set up in the last two steps.
- Format Document: Shift+Alt+F on Windows, Shift+Option+F on macOS, Ctrl+Shift+I on Linux. Useful on a file you have not saved since installing Prettier.
To find or change any shortcut, open File > Preferences > Keyboard Shortcuts. Changes made there are personal and are stored with your profile, not in the repository.
Check it worked
Without touching the mouse, press Ctrl+P (Cmd+P), type index.js and press Enter so that file is open in a tab. Then press Ctrl+P again, type price.test, press Enter, put the cursor on totalWithTax and press F12. VS Code opens src/price.js at the function. Press F2 on the name, type addTax and press Enter: the function, the import in src/index.js and the call in the test all change. This project has no jsconfig.json, so VS Code only knows about the JavaScript files it has seen; keeping the files open in tabs makes sure the rename reaches them all. If a file was missed, open it and rename that use too. Run the Test task again to confirm it still passes. A rename is one edit across several files, so to get the original name back press Ctrl+Z (Cmd+Z) once in any of the changed files and confirm that you want to undo it in all of them.
Step 8 · Decide what goes into Git
The four files you made are meant to be shared. Other things in .vscode, or a personal .code-workspace file, may not be. A common pattern is to ignore the folder and then allow the shared files back in. Create .gitignore in the project root:
node_modules/
coverage/
*.log
.vscode/*
!.vscode/settings.json
!.vscode/extensions.json
!.vscode/tasks.json
!.vscode/launch.jsonBefore committing, read each shared file once more and check for:
- Absolute paths to your home folder or drive. Replace them with
${workspaceFolder}. - Personal preferences such as
workbench.colorTheme,editor.fontSizeor zoom level. Move them to your user settings or profile. - Secrets of any kind: tokens, passwords, API keys. These never go in
settings.jsonorlaunch.json. If a debug configuration needs one, read it from an environment variable or a local.envfile that Git ignores, and document the variable name in the README.
Then commit:
git add .gitignore .prettierrc.json eslint.config.js package.json package-lock.json src test .vscode/settings.json .vscode/extensions.json .vscode/tasks.json .vscode/launch.json
git commit -m "Add shared VS Code settings, tasks and debug configuration"Check it worked
git status reports a clean working tree, and the Source Control view in VS Code shows no pending changes. git ls-files .vscode lists exactly four files. For a final test, clone the repository into a second folder, run npm install, and open it with VS Code. VS Code asks again whether you trust the authors, because it is a new folder; choose Yes, I trust the authors. Then the extension prompt appears, saving a file formats it, and F5 offers the same two debug configurations.
When you have finished, delete the demo with rm -rf ~/vscode-team-demo and any second clone you made.
Next steps
- Make the formatting rules hold outside VS Code too, with lint and format JavaScript with ESLint and Prettier.
- Cover teammates on other editors with share editor settings across editors with EditorConfig.
- Give everyone the same tools and runtime, not only the same editor settings, with develop inside a dev container.
- Go further with breakpoints and the inspector in debug a Node.js app with the inspector.
Related tutorials
- Write a README people actually readYou will have rewritten the README of a small open-source tool so that a stranger can tell what it does, install it, run it and find help in under five minutes, and you will have proved it by following it in a fresh folder.
- Use AI coding assistants responsiblyYou will have a one-page policy for using AI coding assistants on your team, covering what goes into a prompt, how generated code and new packages are checked, what an agent may run without asking and who approves anything that deploys.
- Share indentation and line-ending rules across editors with EditorConfigYou will have a mixed Python, JavaScript, Makefile and Markdown repository with one .editorconfig that every editor follows, an editorconfig-checker run that passes, and a .gitattributes file that keeps Git storing LF line endings.
Need this done for you?
Padding does this work for growing companies, from the first diagnosis to a system that keeps working.
Get new tutorials