Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 478720

Summary: Support the no-fallthrough comments permitted in upstream ESLint
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 10.0   
Target Milestone: 10.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2015-09-30 10:23:14 EDT
It would be nice if Orion's no-fallthrough rule was more lenient in what kind of "falls through" comments it accepted. Orion expects you to use a "$FALLTHROUGH$" comment to indicate a case where falling through is intentional. 

But the upstream ESLint will accept stuff like this, which is arguably easier for mortals to remember:

> switch(foo) {
>     case 1:
>         doSomething();
>         // fallsthrough
> 
>     case 2:
>         doSomethingElse();
> }

> switch(foo) {
>     case 1:
>         doSomething();
>         // falls through
> 
>     case 2:
>         doSomething();
> }

https://github.com/eslint/eslint/blob/master/lib/rules/no-fallthrough.js#L8
Comment 1 Michael Rennie CLA 2015-09-30 12:01:37 EDT
Good idea.

Fix + tests:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=8c03254f5d396a077e017dfa09df95da511f0d9a

We now support patterns like:

//$FALLTHROUGH$
//$FALLSTHROUGH$
//FALLTHROUGH
//FALLSTHROUGH
//FALLS THROUGH
//FALL THROUGH

and any combination of casing thereof