문제

What the best way to omit a block of code from being checked (by jHint) in Codekit.

The direct example is that I and using FlexSlider which when I paste the provided code from the tutorial page: http://flexslider.woothemes.com/video.html I get a bunch of errors.

I still want the rest of my code to be jHinted just not the stuff that I didn't write.

도움이 되었습니까?

해결책

From JSHint's documentation:

ignore

A directive for telling JSHint to ignore a block of code.

// Code here will be linted with JSHint.
/* jshint ignore:start */
// Code here will be linted with ignored by JSHint.
/* jshint ignore:end */

All code in between ignore:start and ignore:end won't be passed to JSHint so you can use any language extension such as Facebook React. Additionally, you can ignore a single line with a trailing comment:

ignoreThis(); // jshint ignore:line
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top