How to ignore a non-existent directory

Context: I have basically this setup https://developers.cloudflare.com/pages/tutorials/use-r2-as-static-asset-storage-for-pages/

So Image src have paths that look like this:

<img src="/media/images/cat1.jpg" width="320" />

Webstorm complains that the directory media can't be resolved. Which makes  sense because the directory doesn't exist in the repo.

However I was unable to exclude that directory so webstorm would stop complaining about it.

I also tried many other different ways to exclude the media folder but I can't figure out what to put here or if this is even the right spot.

0
3 comments

Exclude files: is supposed to be used to exclude existing files from indexing. It can't be used to make the IDE magically resolve non-existing folders in URLs.

To get rid of the error, you can either disable the HTML | Unresolved file in a link inspection in Settings | Editor | Inspections or suppress it for statement:

 

<!--suppress HtmlUnknownTarget -->
<img src="/media/images/cat1.jpg" width="320" />

 

0

Elena Pogorelova Thanks! So there is no way to only disable the warning for this specific folder only? I have to do it either on a case-by-case basis or by removing the inspection entirely?

0

There is no way to do this at the moment.

0

Please sign in to leave a comment.