Syntastic: How to skip angularJS tag and empty element in html

Created on 11 Apr 2013  路  12Comments  路  Source: vim-syntastic/syntastic

I want to skip these errors since it makes no sense for me. Is there anyway I can do this ?

Screen Shot 2013-04-11 at 13 45 35

syntax checkers

Most helpful comment

This config solve that problem (and some others) and it is working fine for me:

let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute " ,"trimming empty \<", "inserting implicit ", "unescaped \&" , "lacks \"action", "lacks value", "lacks \"src", "is not recognized!", "discarding unexpected", "replacing obsolete "]

The rule you are looking for is is not recognized! but I find these others very useful:

  • proprietary attribute: as commented before it is really helpful for all ng- attributes but it is usual to define custom directives restricted to attributes like
  • trimming empty < : working with angular it is common to use empty tags like . This will avoid this message
  • unescaped & : for all conditionals inside attributes like ng-if
  • lacks \"action: when a form doesn't have attribute action.usually angular forms are used in other way.
  • discarding unexpected : with angular we use to build lots of unexpected tags.

Hope it helps

All 12 comments

I presume your question is about tidy. Please apply 49b0318. It adds a variable g:syntastic_html_tidy_ignore_errors that you can define in your vimrc, and set it to the list of errors you want to ignore, for example:

let g:syntastic_html_tidy_ignore_errors = ['proprietary attribute "ng-show"']

thanks for pointing this out :). But this is really not a solution. But due to what I see, there is nothing we can do. I'm looking for a better lint for html.

If you want to hide all warnings for any "ng-*" attributes, you may do

let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]

@chuanma thanks for your suggestion :)

How can I turn off errors for custom angular directives, eg, I make my own element , synastic is complaining.
Actually, is there any way to just kill syntastic for html files alltogether?

To tell syntastic not to complain about your elements, assuming you're using the tidy checker: note down the error messages you get, and add them to a list g:syntastic_html_tidy_ignore_errors, as explained above.

To tell syntastic not to check HTML files automatically: run :help syntastic_mode_map, read about passive filetypes, and change your vimrc accordingly. But you might want to read the entire manual while you are at it, it's pretty useful, and not that long.

how to skip like {/* some comment */}

This config solve that problem (and some others) and it is working fine for me:

let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute " ,"trimming empty \<", "inserting implicit ", "unescaped \&" , "lacks \"action", "lacks value", "lacks \"src", "is not recognized!", "discarding unexpected", "replacing obsolete "]

The rule you are looking for is is not recognized! but I find these others very useful:

  • proprietary attribute: as commented before it is really helpful for all ng- attributes but it is usual to define custom directives restricted to attributes like
  • trimming empty < : working with angular it is common to use empty tags like . This will avoid this message
  • unescaped & : for all conditionals inside attributes like ng-if
  • lacks \"action: when a form doesn't have attribute action.usually angular forms are used in other way.
  • discarding unexpected : with angular we use to build lots of unexpected tags.

Hope it helps

See also HTML Tidy for HTML5. It's a fork of HTML Tidy, and it can be used without changes by syntastic.

Thanks a lot @lcd047. :)

@JaimeBeneytez Thanks for the quick fix. Still using it?
In any case, saving the edited .vimrc file with it raises an error for the double quotes in
"lacks "action".

Hi @carusog.

Sorry, my fault, I didn't pay much attention and the GitHub editor was correctly parsing the text of the answer removing the slash to scape the character \".

this is my configuration and still working fine for me:

let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute " ,"trimming empty \<", "inserting implicit ", "unescaped \&" , "lacks \"action", "lacks value", "lacks \"src", "is not recognized!", "discarding unexpected", "replacing obsolete "]

It's fixed now

Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ijanos picture ijanos  路  7Comments

duckpuppy picture duckpuppy  路  8Comments

jasonkuhrt picture jasonkuhrt  路  8Comments

yoshuawuyts picture yoshuawuyts  路  6Comments

cookiengineer picture cookiengineer  路  7Comments