I run my code through JSHint and I push this error:
Expected break statement before case
In this block of code:
switch(true) { // Renames skill1=abc to section_8_1_body=abc case Major === 0 && Minor === 0 && Patch < 433: upgraded = upgraded.replace(/(\s+)skill(\d)=/gm, '$1section_8_$2_body='); /*falls through*/ // Example case Major === 0 && Minor === 0 && Patch < 442: console.log('test'); /*falls through*/ }
The code checks the version information for the file and updates it for compatibility with the latest software version. Therefore, he intends to skip case so that the file can be updated through several versions.
However, I still get the error message with the addition of /*falls through* , although it is supposedly valid .
How can I let my case succeed in JSHint?
javascript jshint
Danny Beckett Sep 25 '13 at 21:37 2013-09-25 21:37
source share