0

I am new to working with VS Code for my Angular 6 project. All my components use templateUrl to define the template location. Everything compiles and runs from the command line and in the dev server every template is delivered ok. The problem is that in VS Code all the templateUrl s are flagged as template cannot be found. But the path to the file is correct.

So can I ignore this lint or block it in some way? I do not wish to add annotations to my file as other members of the team use different IDEs. Or is there a setting somewhere to set the path that it is reading from? I am not sure if this is VS Code or ES lint.

enter image description here

Gurnard
  • 1,773
  • 22
  • 43
  • Shouldn’t be like that. Are you starting your template paths with./ ? – MikeOne Mar 01 '21 at 17:15
  • @MikeOne if I replace it with ./templat.html (i know a typo :-) ) then the linting passes and I can compile but when running in the server the files are not found because it is missing the correct/path/to part in the url to retrieve the template. So that is a no go. – Gurnard Mar 02 '21 at 08:01
  • yeah if i go two directories up it also fixes the linting but that is an incorrect path. What I would be happy with is a way to ignore templateUrl in the linting. Is there such a thing? – Gurnard Mar 02 '21 at 08:12
  • I don't know - but what you're seeing is definitely not normal... You seem to be doing something non-standard... – MikeOne Mar 02 '21 at 11:55

1 Answers1

0

In the end I removed the Angular Language Service extension and I no longer get the linting!. So I guess nothing to do with ESlint. Seems strange though.

Gurnard
  • 1,773
  • 22
  • 43