Can I stop ReSharper objecting to Ionic HTML tags?

2019-06-16 19:18发布

I've just opened my first Ionic based mobile project, and the HTML templates are really full of Ionic tags, like <ion-modal-view>, which courtesy, ReSharper (I deeply suspect), has a wavy blue underline, as do half the other tags in the template. I deplore working with these lines on the screen, as they indicate there is something wrong (OK, maybe for the W3C it is wrong), when there is nothing wrong. Can, and how, I get rid of these damned blue lines?

2条回答
甜甜的少女心
2楼-- · 2019-06-16 19:44

Well I'm a big believer in writing valid html. Standards are there for a reason, and we can't complain about Microsoft not following them with IE if we don't follow them ourselves.

I did some searching and couldn't find any information on whether Ionic could be written as valid html.

So personally were I in your position I'd either consider whether writing an XHTML DTD that supported Ionic's mark-up was an option, or chose a framework that I could write valid mark-up in.

Since I'm guessing neither of those is an option you could go to:

Resharper -> Options -> Code Inspection -> Settings

Look for the section under the heading Elements to skip - Either find File masks and add *.html (or whatever other file extension you might be using) or find Files and folders and mark the specific files/folders that you don't want Resharper to look at.

查看更多
唯我独甜
3楼-- · 2019-06-16 19:48

I want to suggest a better alternative. Instead of skipping inspections of all *.html files it should be possible to just ignore the inspection for Unknown Tags:

enter image description here

查看更多
登录 后发表回答