2

This question has previously been asked for hiding .js and .js.map files, when there is a .ts file with the same basename. The answer is that you set your VS Code settings to exclude "**/*.js": {"when": "$(basename).ts"}.

However, I'm wondering how I can hide the .js files when the basename is either .ts or .tsx. I need VS Code to check for either extension.

Essentially I need to have both "**/*.js": {"when": "$(basename).ts"} and "**/*.js": {"when": "$(basename).tsx"}. Any ideas on how to get that done?

1 Answer 1

8

You can do that with a bit of a trick, as mentioned in VS Code documentation.

To exclude JavaScript files generated from both .ts and .tsx source files, use this expression:

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

There is an open issue tracking a similar request, but no ETA at the moment.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.