문제

The project I joined is using JSLint and JSHint at the same time. They're launched for the same files, with a unique grunt task. My understanding is that one could use one of them, but when using both of them there's an overlap on the analysis and the checks made.

Is it reasonable to use both of them in the same project ?

도움이 되었습니까?

해결책

JSHint started life as a fork of JSLint. It retains much of the same functionality, to the point you can configure it to behave almost exactly as JSLint does.

A few warnings from JSLint have been removed from JSHint, but these tend to be ones that give little benefit to you. Off the top of my head, one of these warnings is "Unexpected 'else' after disruption", which warns you that you have a redundant else block following a return or throw statement:

if (x) {
    return y;
} else { // This `else` block is unnecessary
    return z;
}

It is reasonable to use both JSLint and JSHint if you need to cover situations like this. But on the whole, it is usually possible to configure JSHint to cover all situations you are concerned about.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top