Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I ignore angular directive lint errors with Vim and syntastic

It's confusing when Syntastic's lint tools keep warning me when I use proprietary html attributes, especially so when using Angular directives.

enter image description here

This quite quickly drowns out actual errors in my html, decreases the value of the linter errors, and adds visual noise.

Is there anyway that to avoid this ?

like image 501
Dzung Nguyen Avatar asked Aug 16 '13 09:08

Dzung Nguyen


2 Answers

I asked this exact question about tidy errors in VIM on Syntastic's issue tracker.

Add to your vimrc:

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

This will get rid of errors for any attributes prepended with ng-, leaving errors for all other proprietary attributes.

If you have a namespace prefix for your own directives, you can add it to this list as well.

let g:syntastic_html_tidy_ignore_errors=[
    \'proprietary attribute "ng-',
    \'proprietary attribute "pdk-'
\]
like image 144
Dzung Nguyen Avatar answered Oct 17 '22 18:10

Dzung Nguyen


Add a data prefix, it's html5 too:

data-ng-model=...
like image 22
XAVIER Avatar answered Oct 17 '22 18:10

XAVIER