Lint for fallthrough in switch

This commit is contained in:
Andy Hanson committed 2017-03-27 15:09:00 -07:00
1 parent 5e4b8d66ff
commit 1cf765d664
20 files changed
+64 -38

No files matched your search

+4 -4
View File
@@ -941,8 +941,7 @@ namespace ts {
diagnostics.push(createDiagnosticForNode(node, Diagnostics._0_can_only_be_used_in_a_ts_file, "?"));
return;
}
// Pass through
// falls through
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
case SyntaxKind.Constructor:
@@ -1022,7 +1021,7 @@ namespace ts {
diagnostics.push(createDiagnosticForNodeArray(nodes, Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file));
return;
}
// pass through
// falls through
case SyntaxKind.VariableStatement:
// Check modifiers
if (nodes === (<ClassDeclaration | FunctionLikeDeclaration | VariableStatement>parent).modifiers) {
@@ -1070,7 +1069,8 @@ namespace ts {
if (isConstValid) {
continue;
}
// Fallthrough to report error
// to report error,
// falls through
case SyntaxKind.PublicKeyword:
case SyntaxKind.PrivateKeyword:
case SyntaxKind.ProtectedKeyword: