HiveBrain v1.2.0
Get Started
← Back to all entries
patterntypescriptCritical

Hide .js.map files in Visual Studio Code: File Nesting

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
nestingfilesstudiovisualfilehidecodemap

Problem

I am working on a typescript project in Visual Studio code and would like to hide the .js.map (and maybe even the .js) files from appearing in the file explorer.

Is it possible to display only the .ts files in the file explorer?

Solution

In your settings (either user or workspace) there is a setting that you can tweak to hide anything you'd like:

{
    "files.exclude": {
        "**/.git": true,
        "**/.DS_Store": true
    }
}


So you can add in the following to hide .js and .js.map files

"**/*.js": true,
"**/*.js.map": true


As this other answer explains, most people probably only want to hide .js files when there is a matching .ts file.

So instead of doing:

"**/*.js": true


you might want to do:

"**/*.js": {"when": "$(basename).ts"}

Code Snippets

{
    "files.exclude": {
        "**/.git": true,
        "**/.DS_Store": true
    }
}
"**/*.js": true,
"**/*.js.map": true
"**/*.js": true
"**/*.js": {"when": "$(basename).ts"}

Context

Stack Overflow Q#31587949, score: 679

Revisions (0)

No revisions yet.