Answer the question
In order to leave comments, you need to log in
How to check project for TypeScript typing in VS Code?
Hello.
If you edit a TypeScript project file in VS Code and make a mistake in using types, it will throw an error, that's good.
But, if we suppose to change some type (interface), and the file that refers to it (by import) and uses is closed, then no error will be given. The program will then compile and run (after all, there are no errors in the javascript itself, only typing errors that do not interfere with compilation).
How to check all project files for correct typing?
I know there are ESLint, TSLint. If that's what they're used for, please share a source on how to quickly set it up for VS Code. Thank you in advance!
Answer the question
In order to leave comments, you need to log in
only typing errors that do not interfere with compilationIf the project compiles, then all types matched. If the project compiles, but there is still an error, then the types are described crookedly.
How to check all project files for correct typing?Compile the project.
But, if we suppose to change some type (interface), and the file that refers to and uses it is closed, then no error will be given.And this is good. If TypeScript LSP will recheck the entire project for every sneeze, and not just open files, then it will be impossible to write something more complicated than a todo list...
I know there are ESLint, TSLint.They are also for static analysis, but for a little different. In VSCode they also only check open files, for the same performance reasons.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question