How to exclude JavaScript and TypeScript files from code analysis?
If you experience performance issues in a project containing js/ts code excluding js/ts files from code analysis can improve ReSharper performance noticeably.
It could be done in case you have in your project:
- big compiled js/ts libraries;
- libraries that include a big amount of js/ts files and these files are not considered by ReSharper as library code (e.g. jquery.js, fontawesome)
You can do all that stuff it via ReSharper | Options | Code Editing | Third-Party Code. (Please note that this feature is applied only to Web languages and C++, while ReSharper | Options | Code Inspection | Settings | Elements to skip is applied to C# code only)
There are two options:
- Skipped code option is preferable to use for big compiled bundles as it fully ignores files (without analyzing and even parsing), which is probably what you want for third-party dependencies. This is useful when you have a file in your project that ReSharper would normally recognize as JavaScript, TypeScript or JSON — perhaps a generated, minified file, or a script that is already gzipped, and you do not want the contents to appear in code completion or navigation and search results.
- Library code option is applied to library code and disables only code analysis while the file is parsed and used for resolve. This section is useful for including third party code, which you do not maintain yourself but need completion suggestions for it and need to be able to navigate there to check implementation details.
Please sign in to leave a comment.
How can I do that without loading a solution?