WebStorm, PHPStorm, Jetbrains IDE - Ignore JS and MAP files in Typescript project

Is there a way to ignore *.js and *.js.map in a TypeScript project in Jetbrains?

Right now, I have a TypeScript project in my PHPStorm and when I search for the ctrl+shift+N file, I get all the files - *.ts, *.js, *.js.map , which forces me to select one TypeScript file every time I search , and not just quickly jumping to a file.

Is there a way to filter compiled files from a search? I tried areas, etc., but that does not do the trick.

PS: I know that I am working on TypeScript, it would be desirable to use WebStorm, but I believe that PHPStorm gives me the best experience from their products.

+5
source share
1 answer

In fact, this functionality is included in my installation of PhpStorm 2016.2 on Linux, but I would suggest that it is no different from other operating systems, since it is cross-platform.

Option 1: There should be a filter button in the file search dialog box Ctrl+Shift+N in the upper right corner. filter button in the search dialog You can immediately deselect JavaScript files, and from now on they will no longer appear in the search. Since *.map not registered as the default file type, you will not find it in the list (at least not in my installation). To achieve also *.map filtering, register filetype Settings -> Editor -> File Types -> "Recognized File Types" add a new file type with a name map - no more parameters are needed and add *.map as the "Registered Template" (you You can see this in action also in Figure 2). Now this type of file should be available for exclusion from the search.

Option 2: You can hide the *.js files as well as the *.map files completely from your project on Settings -> Editor -> File Types -> "Ignore files and folders" add here *.js;*.map; settings dialog for creating a map file type Now these types of files will not only be hidden in the project, but will also not be displayed when searching for files (Ctrl + Shift + N). If you need to check your JS files and maps, you can open a second editor for such cases, but I think you won’t need to do this too often, right?

+1
source

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


All Articles