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

Bug 429815

Summary: [eslint] provide a no-fallthrough rule
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: 6.0 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Michael Rennie CLA 2014-03-06 14:36:03 EST
We should warn users about fall-throughs in switch stateents, unless of course they have the magic $FALL-THROUGH$ comment.

Preference should match Eclipse (for familiarity):

pref page: 'switch' case fall-through
error: Switch case may be entered by falling through previous case. If intended, add a new comment //$FALL-THROUGH$ on the line above
Comment 1 Michael Rennie CLA 2014-06-17 15:56:36 EDT
Pushed fix + tests to:

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

Note that this rule does not do any form of flow analysis, but only checks for a returnable statement in the case statements block. 

An expected fall-through can be silenced using the //$FALLTHROUGH$ comment