Bug 1391699 - Disallow fallthrough case statements. r=automatedtester

We recently had a serious bug in Marionette (https://bugzil.la/1254136)
due to a case statement that fell through due to a missing "break"
statement.  This patch introduces a lint rule to prevent similar episodes
in the future.

When you do want a case to fall through, it is possible to add a comment
like this:

	switch (foo) {
	  case 1:
	    doSomething();
	    // fall through

	  case 2:
	    doSomething();
	    break;
	}

MozReview-Commit-ID: Gu8cFGsdne2

--HG--
extra : rebase_source : 8b29c663167783770d0eb0a32b7a7c2cb83a529e
This commit is contained in:
Andreas Tolfsen 2017-08-18 18:55:56 +01:00
Родитель a73c085820
Коммит 802a866314
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -13,6 +13,7 @@ module.exports = {
"ignoreStrings": true,
"ignoreUrls": true,
}],
"no-fallthrough": "error",
"no-new-object": "error",
"no-undef-init": "error",
"object-curly-spacing": ["error", "never"],