Topic on Extension talk:CodeEditor

False positive syntax error

3
Anerisys (talkcontribs)

The syntax check indicates "Warning: Too many errors. (81% scanned)" on the following code. When removing one "test1();", no error is reported anymore.

// syntax check demo: false positive error
function test1(){ return true }

function test2(){
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();test1();
test1();test1();test1();test1();test1();test1();test1();test1();test1();
}
Jdforrester (WMF) (talkcontribs)

Yes, jshint is pretty poor. T250315 is a proposal to replace it with eslint which has much better behaviour in general, and might (?) fix your problem here, but some people are concerned that switching will change which "false positives" (and new true positives) are flagged. Your input would be welcome if you think this would fix it or otherwise be a good move.

Anerisys (talkcontribs)

I tested it again and the error appears to have been repaired. No syntax error is reported, even if I add multiple times as many test1(); as before. Thanks much!

Reply to "False positive syntax error"