Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  7] [ 4]  / answers: 1 / hits: 51887  / 8 Years ago, tue, january 17, 2017, 12:00:00

I'm using VS Code for TypeScript/JavaScript development. When I open a file it will check that file for errors. The problem is if I'm refactoring (like I move some shared code to a new location or change a name) it won't show me the errors this caused until I open the file with the problem. ...so if I want to do extensive refactoring I have to open every file just to make it scan the file for errors.



How can I make VS Code scan the whole project for errors without having to open each file one by one manually?


More From » typescript

 Answers
48

Figured it out. Note this answer is specific to TypeScript, which is what I am using. Here it is:



Make sure typescript is installed globally (I just had mine installed locally apparently):
npm install -g typescript



Then in VS Code press Shift+Ctrl+B. If you don't have a task runner set up it will ask what you want. I selected typescript and the tasks.json file will look like this:



{
version: 0.1.0,
command: tsc,
isShellCommand: true,
args: [-p, .],
showOutput: silent,
problemMatcher: $tsc
}


Then pressing Shift+Ctrl+B (or Shift+Command+B in macOS) will check the entire project for problems and they will be reported in your problems panel.


[#59326] Saturday, January 14, 2017, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
joep

Total Points: 32
Total Questions: 97
Total Answers: 104

Location: Wales
Member since Thu, Jul 1, 2021
3 Years ago
;