I often have this problem when using Twitter Bootstrap with other 3rd-party JS libraries, such as html5.js
from WordPress' "Twenty Twelve" theme, where the build fails because jshint
(or jslint
in previous versions of TB I think) throws an error due to the third-party JS library, e.g.
##################################################
Building Bootstrap...
##################################################
js/html5.js: line 3, col 122, Expected ')' to match '(' from line 3 and instead
saw ','.
js/html5.js: line 3, col 140, Expected an identifier and instead saw ')'.
js/html5.js: line 4, col 101, eval is evil.
js/html5.js: line 6, col 369, Confusing use of '!'.
js/html5.js: line 6, col 422, Confusing use of '!'.
js/html5.js: line 7, col 61, 'b' is already defined.
js/theme-customizer.js: line 26, col 26, Use '===' to compare with ''.
7 errors
make: *** [build] Error 1
I'd like to avoid modifying third-party libraries or modify TB's Makefile, as that'll cause problems for upgrades in the future; is my only option to put 3rd-party JS files into a separate folder.
Is there a way to get jshint or TB's build process to ignore certain JS files (perhaps through some .jshintrc
configuration I'm not aware of?)?
question from:
https://stackoverflow.com/questions/14741110/have-jshint-ignore-certain-files-when-building-twitter-bootstrap 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…