Renato Fontes
Renato Fontes

Reputation: 68

Visual studio code "files.exclude" not working

Yesterday I added files.exclude to my user settings in visual studio code to hide .js and .map files and it worked correctly. But today (and without restarting or closing code) it stopped working.

This is the full settings.json file

// Place your settings in this file to overwrite the default settings
{
    "files.exclude": {
        "app/*.js": true,
        "app/*.map": true
    }
}

Anyone knows how to fix this?

Upvotes: 1

Views: 637

Answers (3)

jfgrissom
jfgrissom

Reputation: 622

I'm running VSCode 1.47.3 (in 2020) and this works well for typescript.

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

Upvotes: 0

Himadri
Himadri

Reputation: 11

You might have already got the answer but thought of posting as this might be a solution for others. Below worked for me.

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

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

Upvotes: 1

Renato Fontes
Renato Fontes

Reputation: 68

I got it to work by adding "**/" before each exclude, I might have opened the project in a different way and didn't notice the parent folder had been added to the project structure

Upvotes: 1

Related Questions