Support regex in files.exclude => when
See original GitHub issueI would like to ignore JS files in my project when there’s a matching TS or matching TSX file. Right now I have to choose one or the other. Please support making the “when” directive in the “files.exclude” workspace setting use a regex, so I could do this:
{
"files.exclude": {
"**/*.js": { "when": "$(basename).tsx?"},
}
}
Issue Analytics
- State:
- Created 8 years ago
- Reactions:50
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Regular expression for excluding file types .exe and .js
The regular expression is working with some small issue. When I am adding more than one exe file then the tool is not...
Read more >Exclude or filter files using file type and regular expressions ...
Open the Code42 app. · Select settings button Settings. · Select Backup Sets. · Next to File Exclusions, select Change. · Enter a...
Read more >How Do I Exclude Files Using Regular Expressions? - Rigor
How Do I Exclude Files Using Regular Expressions? · Edit Real Browser Check > Advanced > + Add Excluded File · From the...
Read more >RegEx Files and Directories Exclusion - Akeeba Backup
You are supposed to specify a full regular expression, including its opening and ending separators. · The application supports an extension to the...
Read more >How to exclude Test files From Searches in VS Code?
Search in VS Code doesn't utilize regex in excluding files (see open issue). It is configured with glob patterns.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is a work around 😄. Define define different regular expression that matches the same files:
@bpasero can you pls check that we cover
when
in our docs.I would like to ignore
*.d.ts
when there is a corresponding.ts
file. Unfortunately this rule just hides alld.ts
files:"src/**/*.d.ts": { "when": "$(basename).ts" },
Apparently,
$(basename)
doesn’t match the*
in*.d.ts
but instead matches*.dt
. This could be fixed using regular expressions (negative lookahead). A new variable like$(matchedname)
might solve it but I see other problems with that approach.