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

4
  • Shouldn’t be like that. Are you starting your template paths with./ ? Commented Mar 1, 2021 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. Commented Mar 2, 2021 at 8: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? Commented Mar 2, 2021 at 8:12
  • I don't know - but what you're seeing is definitely not normal... You seem to be doing something non-standard... Commented Mar 2, 2021 at 11:55

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.