Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In WebStorm, how do I exclude js files generated from ts/tsx?

When I use Enable Typescript Compiler, the TypeScript compiler generates a .js file for every .ts and .tsx file.

Enable Typescript Compiler

When doing code completion, WebStorm does not know that the files were generated and therefore it suggests completion from the generated files as well as from the TypeScript files. To prevent this, I have to go to every generated .js file and right click and Mark as Plain Text:

Mark as Plain Text

However, when I do a text search, I still get the hits from the generated JavaScript files:

enter image description here

Is there a simple way to exclude the generated files the way it is possible to exclude directories (except for creating a scope that excludes all the generated files)?

like image 492
Michael_Scharf Avatar asked Oct 31 '22 04:10

Michael_Scharf


People also ask

Does WebStorm work with TypeScript?

With WebStorm, you can run and debug client-side TypeScript code and TypeScript code running in Node. js. Learn more from Running and debugging TypeScript.


1 Answers

Text search supports scopes. I'd suggest adding a custom scope in Preferences | Appearance & Behavior | Scopes with your generated files excluded and using this scope in the Find in Path dialog as the custom scope.

like image 139
lena Avatar answered Nov 10 '22 15:11

lena