This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 429815 - [eslint] provide a no-fallthrough rule
Summary: [eslint] provide a no-fallthrough rule
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: JS Tools (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 6.0 RC1   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-06 14:36 EST by Michael Rennie CLA
Modified: 2014-06-17 15:56 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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