Visual Code - Excluding Files with Multiple Conditions

It is possible to exclude generated files with the keyword "when",. Eg:

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

I also want to exclude .js files that are generated from .tsx files. neither

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

neither

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

have worked.

I also tried "**/*.js": { "when": "$(basename).ts*"} and "**/*.js": { "when": "$(basename).ts | $(basename).tsx"} in vain.

Is there any way to do this?

+5
source share
2 answers

Try the following:

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

Source: Microsoft / vscode # 1214

+9
source

These are my settings if they help. This is quite a mess in their creation. I think regexp will be great, but we live in difficult times ....

 "files.exclude": { "**/*.js": { "when": "$(basename).tsx"}, "**/*?.js": { "when": "$(basename).ts"}, "**/*.js.map": true } 
+2
source

Source: https://habr.com/ru/post/1240791/


All Articles