Hiding JavaScript Files in VS Code

07-09-2021

Like a lot of JavaScript developers these days I’m writing mostly Typescript. If using VS Code as your IDE it can be helpful to hide or ignore the .js files that are generated. Here are the steps to hide the JavaScript files that are compiled during the development process in VS Code:

  1. Open the Workspace Settings JSON File

CMS + Shift + P –> Preferences: Open Settings (JSON)

  1. Add the following lines to the JSON file
1
2
3
4
5
6
"files.exclude": {
// Hide all .js files when have a .ts file
"**/*.js": {"when": "$(basename).ts"},
"**/*.js.map": true,
"node_modules/": true // optional
}
  1. Save settings.json