I'm running my code through JSHint, and I'm hitting this error:
Expected a
break
statement beforecase
On 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 version information for a file, and upgrades it to be compatible with the latest version of the software. It's therefore intentional for the case
s to fall through, so that a file can be upgraded through multiple versions.
However, I still receive the error message, with /*falls through*
added, even though it is supposedly valid.
How can I allow my case
s to fall through successfully in JSHint?