Hiding JavaScript Files in VS Code

Jul 9, 2021 min read

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
  "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