简体   繁体   中英

Using JSHint (Vim) with .html Files

I just installed JSHint in Vim and so far it works as expected. The only thing I don't seem to get working is checking syntax in .html files (in .js it works flawlessly). Ie, when I have a <script> -Section in a .html File, it would like to get that checked as well upon saving the buffer or calling :JSHint .

What to do?

jshint added support for extracting js from inside html files about a month ago . It's the --extract option at the command line ( docs here )

I'm not sure which jshint plugin you're using, but if you can tweak the command-line params it passes to jshint, then you just need to add

--extract=always

and then somehow set jshint to also do linting for html files.

I'm trying to get this to work in syntastic...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM